Skip to content

Commit

Permalink
Merge pull request #796 from atlassian/release/6.1.0
Browse files Browse the repository at this point in the history
Release 6.1.0
  • Loading branch information
ometelytsia committed Jan 31, 2022
2 parents d593de1 + c11ccdf commit a8c7151
Show file tree
Hide file tree
Showing 50 changed files with 918 additions and 531 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# bzt run: docker run --shm-size=4g -v "$PWD:/dc-app-performance-toolkit" atlassian/dcapt jira.yml
# interactive run: docker run -it --entrypoint="/bin/bash" -v "$PWD:/dc-app-performance-toolkit" atlassian/dcapt

FROM blazemeter/taurus:1.16.0
FROM blazemeter/taurus:1.16.2

ENV APT_INSTALL="apt-get -y install --no-install-recommends"

Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ This repository contains Taurus scripts for performance testing of Atlassian Dat

## Supported versions
* Supported Jira versions:
* Jira [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `8.13.13`, `8.20.1`
* Jira [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `8.13.16`, `8.20.4`

* Supported Jira Service Management versions:
* Jira Service Management [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `4.13.13`, `4.20.1`
* Jira Service Management [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `4.13.16`, `4.20.4`

* Supported Confluence versions:
* Confluence [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `7.13.2`, `7.4.13`
* Confluence [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `7.13.3`, `7.4.14`

* Supported Bitbucket Server versions:
* Bitbucket Server [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `7.6.10`, `7.17.1`
* Bitbucket Server [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `7.6.13`, `7.17.5`

* Supported Crowd versions:
* Crowd [release notes](https://confluence.atlassian.com/crowd/crowd-release-notes-199094.html): `4.4.0`

* Supported Bamboo versions:
* Bamboo [release notes](https://confluence.atlassian.com/bamboo/bamboo-release-notes-671089224.html): `8.1.0`
* Bamboo [release notes](https://confluence.atlassian.com/bamboo/bamboo-release-notes-671089224.html): `8.1.1`

## Support
In case of technical questions, issues or problems with DC Apps Performance Toolkit, contact us for support in the [community Slack](http://bit.ly/dcapt_slack) **#data-center-app-performance-toolkit** channel.
Expand All @@ -41,7 +41,7 @@ If a first part of ChromeDriver version does not match with a first part of your
Make sure that you have:
* [Python](https://www.python.org/downloads/) (see [dependencies](#dependencies) section for supported versions)
* pip
* [JDK 8](https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) installed
* [JDK 11](https://www.oracle.com/java/technologies/downloads/#java11) installed
* XCode Command Line Tools
* Google Chrome web browser
```
Expand Down Expand Up @@ -119,7 +119,7 @@ pip install -r requirements.txt

### Windows setup
#### Installing Taurus manually
Make sure you have [Python](https://www.python.org/downloads/) (see [dependencies](#dependencies) section for supported versions), pip, and [JDK 8](https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) installed:
Make sure you have [Python](https://www.python.org/downloads/) (see [dependencies](#dependencies) section for supported versions), pip, and [JDK 11](https://www.oracle.com/java/technologies/downloads/#java11) installed:
```
python --version or python3 --version
pip --version
Expand Down Expand Up @@ -149,7 +149,7 @@ pip install virtualenv
```
2. Create new virtual env with python3:
```
virtualenv venv -p full_path_to_python # e.g. use `where python3.9` to find the path
virtualenv venv -p full_path_to_python # e.g. use `where python` to find the path to correct python
```
3. Activate virtual env:
```
Expand Down
28 changes: 21 additions & 7 deletions app/bamboo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,31 @@ settings:
env:
application_hostname: test-bamboo.atlassian.com # Bamboo DC hostname without protocol and port e.g. test-bamboo.atlassian.com or localhost
application_protocol: http # http or https
application_port: 8085 # 80, 443, 8085, etc
application_port: 80 # 80, 443, 8085, etc
secure: True # Set False to allow insecure connections, e.g. when using self-signed SSL certificate
application_postfix: # e.g. /bamboo in case of url like http://localhost/bamboo
admin_login: admin
admin_password: admin
load_executor: jmeter
concurrency: 200 # number of Bamboo users for Selenium actions
test_duration: 45m
ramp-up: 3m # time to spin all concurrent threads
ramp-up: 5m # time to spin all concurrent threads
total_actions_per_hour: 2000 # number of total JMeter actions per hour
WEBDRIVER_VISIBLE: False
JMETER_VERSION: 5.2.1
JMETER_VERSION: 5.4.2
LANGUAGE: en_US.utf8
allow_analytics: Yes # Allow sending basic run analytics to Atlassian. These analytics help us to understand how the tool is being used and help us to continue to invest in this tooling. For more details please see our README.
# Action percentage for JMeter load executor
view_all_builds: 15
view_build_result: 15
view_build_configuration: 10
view_job_configuration: 10
view_build_summary: 10
view_projects_list: 10
standalone_extension: 0 # By default disabled

standalone_extension: 0 # Standalone extension weight for JMeter. By default, disabled. Set appropriate weight to enable.
# Locust app specific
standalone_extension_locust: 0 # Standalone extension weight for Locust. By default, disabled. Set 1 to enable.
# Bamboo agents and plans settings
number_of_agents: 50 # number of available remote agents
parallel_plans_count: 40 # number of parallel plans execution
start_plan_timeout: 60 # maximum timeout of plan to start
Expand All @@ -39,10 +42,13 @@ services:
- python util/data_preparation/bamboo_prepare_data.py
shutdown:
- python util/post_run/jmeter_post_check.py
- python util/jtl_convertor/jtls-to-csv.py kpi.jtl kpi-1.jtl selenium.jtl
- python util/jtl_convertor/jtls-to-csv.py kpi*.jtl selenium.jtl
post-process:
- python util/analytics/analytics.py bamboo
- python util/post_run/cleanup_results_dir.py
- module: pip-install
packages:
- selenium==3.141.0
execution:
- scenario: jmeter
executor: jmeter
Expand All @@ -54,6 +60,12 @@ execution:
concurrency: ${parallel_plans_count}
hold-for: ${test_duration}
ramp-up: ${default_dataset_plan_duration}
## Locust app-specific scenario. Uncomment below lines to enable.
# - scenario: locust_app_specific
# executor: locust
# concurrency: ${concurrency}
# hold-for: ${test_duration}
# ramp-up: ${ramp-up}
- scenario: selenium
executor: selenium
runner: pytest
Expand All @@ -63,6 +75,8 @@ scenarios:
script: selenium_ui/bamboo_ui.py
locust:
script: locustio/bamboo/locustfile.py
locust_app_specific:
script: locustio/bamboo/locustfile_app_specific.py
jmeter:
script: jmeter/bamboo.jmx
properties:
Expand Down Expand Up @@ -108,7 +122,7 @@ modules:
httpsampler.ignore_failed_embedded_resources: "true"
selenium:
chromedriver:
version: "96.0.4664.45" # Supports Chrome version 96. You can refer to http://chromedriver.chromium.org/downloads
version: "97.0.4692.71" # Supports Chrome version 97. You can refer to http://chromedriver.chromium.org/downloads
reporting:
- data-source: sample-labels
module: junit-xml
7 changes: 5 additions & 2 deletions app/bitbucket.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ settings:
ramp-up: 10m # time to spin all concurrent users
total_actions_per_hour: 32700
WEBDRIVER_VISIBLE: False
JMETER_VERSION: 5.2.1
JMETER_VERSION: 5.4.2
LANGUAGE: en_US.utf8
allow_analytics: Yes # Allow sending basic run analytics to Atlassian. These analytics help us to understand how the tool is being used and help us to continue to invest in this tooling. For more details please see our README.
services:
Expand All @@ -33,6 +33,9 @@ services:
post-process:
- python util/analytics/analytics.py bitbucket
- python util/post_run/cleanup_results_dir.py
- module: pip-install
packages:
- selenium==3.141.0
execution:
- scenario: ${load_executor}
concurrency: ${concurrency}
Expand Down Expand Up @@ -86,7 +89,7 @@ modules:
httpsampler.ignore_failed_embedded_resources: "true"
selenium:
chromedriver:
version: "96.0.4664.45" # Supports Chrome version 96. You can refer to http://chromedriver.chromium.org/downloads
version: "97.0.4692.71" # Supports Chrome version 97. You can refer to http://chromedriver.chromium.org/downloads
reporting:
- data-source: sample-labels
module: junit-xml
7 changes: 5 additions & 2 deletions app/confluence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ settings:
ramp-up: 5m # time to spin all concurrent users
total_actions_per_hour: 20000
WEBDRIVER_VISIBLE: False
JMETER_VERSION: 5.2.1
JMETER_VERSION: 5.4.2
LANGUAGE: en_US.utf8
allow_analytics: Yes # Allow sending basic run analytics to Atlassian. These analytics help us to understand how the tool is being used and help us to continue to invest in this tooling. For more details please see our README.
# Action percentage for JMeter and Locust load executors
Expand Down Expand Up @@ -46,6 +46,9 @@ services:
post-process:
- python util/analytics/analytics.py confluence
- python util/post_run/cleanup_results_dir.py
- module: pip-install
packages:
- selenium==3.141.0
execution:
- scenario: ${load_executor}
executor: ${load_executor}
Expand Down Expand Up @@ -110,7 +113,7 @@ modules:
httpsampler.ignore_failed_embedded_resources: "true"
selenium:
chromedriver:
version: "96.0.4664.45" # Supports Chrome version 96. You can refer to http://chromedriver.chromium.org/downloads
version: "97.0.4692.71" # Supports Chrome version 97. You can refer to http://chromedriver.chromium.org/downloads
reporting:
- data-source: sample-labels
module: junit-xml
4 changes: 2 additions & 2 deletions app/crowd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ settings:
# ramp-up: 5s # time to spin all concurrent threads
# total_actions_per_hour: 720000 # number of total JMeter actions per hour

JMETER_VERSION: 5.2.1
JMETER_VERSION: 5.4.2
LANGUAGE: en_US.utf8
allow_analytics: Yes # Allow sending basic run analytics to Atlassian. These analytics help us to understand how the tool is being used and help us to continue to invest in this tooling. For more details please see our README.
allow_analytics: Yes # Allow sending basic run analytics to Atlassian. These analytics help us to understand how the tool is being used and help us to continue to invest in this tooling. For more details please see our README.
services:
- module: shellexec
prepare:
Expand Down
29 changes: 29 additions & 0 deletions app/extension/bamboo/extension_locust.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import re
from locustio.common_utils import init_logger, bamboo_measure, run_as_specific_user # noqa F401

logger = init_logger(app_type='bamboo')


@bamboo_measure("locust_app_specific_action")
# @run_as_specific_user(username='admin', password='admin') # run as specific user
def app_specific_action(locust):
r = locust.get('/app/get_endpoint', catch_response=True) # call app-specific GET endpoint
content = r.content.decode('utf-8') # decode response content

token_pattern_example = '"token":"(.+?)"'
id_pattern_example = '"id":"(.+?)"'
token = re.findall(token_pattern_example, content) # get TOKEN from response using regexp
id = re.findall(id_pattern_example, content) # get ID from response using regexp

logger.locust_info(f'token: {token}, id: {id}') # log info for debug when verbose is true in bamboo.yml file
if 'assertion string' not in content:
logger.error(f"'assertion string' was not found in {content}")
assert 'assertion string' in content # assert specific string in response content

body = {"id": id, "token": token} # include parsed variables to POST request body
headers = {'content-type': 'application/json'}
r = locust.post('/app/post_endpoint', body, headers, catch_response=True) # call app-specific POST endpoint
content = r.content.decode('utf-8')
if 'assertion string after successful POST request' not in content:
logger.error(f"'assertion string after successful POST request' was not found in {content}")
assert 'assertion string after successful POST request' in content # assertion after POST request
7 changes: 5 additions & 2 deletions app/jira.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ settings:
ramp-up: 3m # time to spin all concurrent users
total_actions_per_hour: 54500 # number of total JMeter/Locust actions per hour
WEBDRIVER_VISIBLE: False
JMETER_VERSION: 5.2.1
JMETER_VERSION: 5.4.2
LANGUAGE: en_US.utf8
allow_analytics: Yes # Allow sending basic run analytics to Atlassian. These analytics help us to understand how the tool is being used and help us to continue to invest in this tooling. For more details please see our README.
# Action percentage for Jmeter and Locust load executors
Expand Down Expand Up @@ -48,6 +48,9 @@ services:
post-process:
- python util/analytics/analytics.py jira
- python util/post_run/cleanup_results_dir.py
- module: pip-install
packages:
- selenium==3.141.0
execution:
- scenario: ${load_executor}
executor: ${load_executor}
Expand Down Expand Up @@ -114,7 +117,7 @@ modules:
httpsampler.ignore_failed_embedded_resources: "true"
selenium:
chromedriver:
version: "96.0.4664.45" # Supports Chrome version 96. You can refer to http://chromedriver.chromium.org/downloads
version: "97.0.4692.71" # Supports Chrome version 97. You can refer to http://chromedriver.chromium.org/downloads
reporting:
- data-source: sample-labels
module: junit-xml
9 changes: 6 additions & 3 deletions app/jsm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ settings:
total_actions_per_hour_agents: 5000
total_actions_per_hour_customers: 15000
WEBDRIVER_VISIBLE: False
JMETER_VERSION: 5.2.1
JMETER_VERSION: 5.4.2
LANGUAGE: en_US.utf8
allow_analytics: Yes # Allow sending basic run analytics to Atlassian. These analytics help us to understand how the tool is being used and help us to continue to invest in this tooling. For more details please see our README.
# Action percentage for Jmeter and Locust load executors
Expand Down Expand Up @@ -53,10 +53,13 @@ services:
- python util/data_preparation/jsm_prepare_data.py
shutdown:
- python util/post_run/jmeter_post_check.py
- python util/jtl_convertor/jtls-to-csv.py kpi.jtl kpi-1.jtl selenium.jtl
- python util/jtl_convertor/jtls-to-csv.py kpi*.jtl selenium.jtl
post-process:
- python util/analytics/analytics.py jsm
- python util/post_run/cleanup_results_dir.py
- module: pip-install
packages:
- selenium==3.141.0
execution:
- scenario: ${load_executor}_agents
executor: ${load_executor}
Expand Down Expand Up @@ -151,7 +154,7 @@ modules:
httpsampler.ignore_failed_embedded_resources: "true"
selenium:
chromedriver:
version: "96.0.4664.45" # Supports Chrome version 96. You can refer to http://chromedriver.chromium.org/downloads
version: "97.0.4692.71" # Supports Chrome version 97. You can refer to http://chromedriver.chromium.org/downloads
reporting:
- data-source: sample-labels
module: junit-xml
40 changes: 37 additions & 3 deletions app/locustio/bamboo/http_actions.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import random
import time
import uuid

from locustio.bamboo.requests_params import bamboo_datasets
from locustio.common_utils import init_logger, JSON_HEADERS
from util.api.bamboo_clients import BambooClient
from locust import events

from locustio.bamboo.requests_params import bamboo_datasets, Login
from locustio.common_utils import init_logger, JSON_HEADERS, TEXT_HEADERS, bamboo_measure
from util.api.bamboo_clients import BambooClient
from util.conf import BAMBOO_SETTINGS

logger = init_logger(app_type='bamboo')
Expand Down Expand Up @@ -88,3 +89,36 @@ def run_build_plan(locust):
logger.info(f'Total functions time: {total}. Expected full action time {action_time}. '
f'Plan {build_plan_id} is successfully started. Waiting {sleep_time}.\n')
time.sleep(sleep_time)


@bamboo_measure('locust_bamboo_login')
def locust_bamboo_login(locust):
session_id = str(uuid.uuid4())
locust.cross_action_storage[session_id] = dict()
locust.session_data_storage = locust.cross_action_storage[session_id]
locust.session_data_storage['app'] = 'bamboo'

params = Login()
user = random.choice(bamboo_dataset["users"])
username = user[0]
password = user[1]

login_body = params.login_body
login_body['os_username'] = username
login_body['os_password'] = password

# login
r = locust.post('/userlogin.action',
login_body,
TEXT_HEADERS,
catch_response=True)

content = r.content.decode('utf-8')

if 'Log Out' not in content:
logger.error(f'Login with {username}, {password} failed: {content}')
assert 'Log Out' in content, 'User authentication failed.'
logger.locust_info(f'User {username} is successfully logged in')

locust.session_data_storage['username'] = user[0]
locust.session_data_storage['password'] = user[1]
24 changes: 24 additions & 0 deletions app/locustio/bamboo/locustfile_app_specific.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from locust import HttpUser, task, between
from extension.bamboo.extension_locust import app_specific_action
from locustio.bamboo.http_actions import locust_bamboo_login
from locustio.common_utils import LocustConfig, MyBaseTaskSet
from util.conf import BAMBOO_SETTINGS

config = LocustConfig(config_yml=BAMBOO_SETTINGS)


class BambooBehavior(MyBaseTaskSet):

def on_start(self):
self.client.verify = config.secure
locust_bamboo_login(self)

@task(config.percentage('standalone_extension_locust'))
def custom_action(self):
app_specific_action(self)


class BambooUser(HttpUser):
host = BAMBOO_SETTINGS.server_url
tasks = [BambooBehavior]
wait_time = between(0, 0)
3 changes: 1 addition & 2 deletions app/locustio/bamboo/requests_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ class Login:
'os_username': '',
'os_password': '',
'os_destination': '',
'user_role': '',
'save': 'Log in',
'atl_token': '',
'login': 'Log in'
}


Expand Down
Loading

0 comments on commit a8c7151

Please sign in to comment.