Skip to content

Commit

Permalink
Merge pull request #688 from atlassian/release/5.1.0
Browse files Browse the repository at this point in the history
Release 5.1.0
  • Loading branch information
ometelytsia committed Sep 20, 2021
2 parents 1189f47 + 546ece5 commit f05089b
Show file tree
Hide file tree
Showing 31 changed files with 617 additions and 157 deletions.
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Default code owners - Atlassian Data Center App Performance Toolkit
* @ometelytsia @SergeyMoroz0703 @astashys @mmizin
* @ometelytsia @SergeyMoroz0703 @astashys @opopovss @OlehStefanyshyn
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ FROM blazemeter/taurus

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

# Remove bintray manually until PR https://github.com/Blazemeter/taurus/pull/1484/files is promoted to prod
RUN sed -i '/dl.bintray.com/d' /etc/apt/sources.list

RUN apt-get -y update \
&& $APT_INSTALL vim git openssh-server python3.8-dev python3-pip wget \
&& update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1 \
Expand Down
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
# Data Center App Performance Toolkit
The Data Center App Performance Toolkit extends [Taurus](https://gettaurus.org/) which is an open source performance framework that executes JMeter and Selenium.

This repository contains Taurus scripts for performance testing of Atlassian Data Center products: Jira, Jira Service Management, Confluence, and Bitbucket.
This repository contains Taurus scripts for performance testing of Atlassian Data Center products: Jira, Jira Service Management, Confluence, Bitbucket and Crowd.

## Supported versions
* Supported Jira versions:
* Jira [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `8.13.7`, `8.5.15`
* Jira [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `8.13.10`, `8.5.18`

* Supported Jira Service Management versions:
* Jira Service Management [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `4.13.7`, `4.5.15`
* Jira Service Management [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `4.13.10`, `4.5.18`

* Supported Confluence versions:
* Confluence [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `7.4.9`
* Confluence Platform release: `7.0.5`
* Confluence [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `7.13.0`, `7.4.11`

* Supported Bitbucket Server versions:
* Bitbucket Server [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `7.6.7`, `6.10.11`
* Bitbucket Server [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `7.6.9`, `6.10.13`
* Bitbucket Server Platform release: `7.0.5`

* Supported Crowd versions:
* Crowd [Long Term Support release](https://confluence.atlassian.com/crowd/crowd-release-notes-199094.html): `4.3.0`
* Crowd [Long Term Support release](https://confluence.atlassian.com/crowd/crowd-release-notes-199094.html): `4.3.5`

## 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 Down
3 changes: 2 additions & 1 deletion app/bitbucket.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ services:
- module: shellexec
prepare:
- python util/pre_run/environment_checker.py
- python util/pre_run/check_for_updates.py
- python util/pre_run/git_client_check.py
- python util/data_preparation/bitbucket_prepare_data.py
shutdown:
Expand Down Expand Up @@ -85,7 +86,7 @@ modules:
httpsampler.ignore_failed_embedded_resources: "true"
selenium:
chromedriver:
version: "91.0.4472.101" # Supports Chrome version 91. You can refer to http://chromedriver.chromium.org/downloads
version: "93.0.4577.63" # Supports Chrome version 93. You can refer to http://chromedriver.chromium.org/downloads
reporting:
- data-source: sample-labels
module: junit-xml
3 changes: 2 additions & 1 deletion app/confluence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ services:
- module: shellexec
prepare:
- python util/pre_run/environment_checker.py
- python util/pre_run/check_for_updates.py
- python util/data_preparation/confluence_prepare_data.py
shutdown:
- python util/post_run/jmeter_post_check.py
Expand Down Expand Up @@ -109,7 +110,7 @@ modules:
httpsampler.ignore_failed_embedded_resources: "true"
selenium:
chromedriver:
version: "91.0.4472.101" # Supports Chrome version 91. You can refer to http://chromedriver.chromium.org/downloads
version: "93.0.4577.63" # Supports Chrome version 93. You can refer to http://chromedriver.chromium.org/downloads
reporting:
- data-source: sample-labels
module: junit-xml
3 changes: 2 additions & 1 deletion app/crowd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ settings:

JMETER_VERSION: 5.2.1
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:
- python util/pre_run/environment_checker.py
- python util/pre_run/check_for_updates.py
- python util/data_preparation/crowd_prepare_data.py
- python util/data_preparation/crowd_sync_check.py
shutdown:
Expand Down
3 changes: 2 additions & 1 deletion app/jira.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ services:
- module: shellexec
prepare:
- python util/pre_run/environment_checker.py
- python util/pre_run/check_for_updates.py
- python util/data_preparation/jira_prepare_data.py
shutdown:
- python util/post_run/jmeter_post_check.py
Expand Down Expand Up @@ -113,7 +114,7 @@ modules:
httpsampler.ignore_failed_embedded_resources: "true"
selenium:
chromedriver:
version: "91.0.4472.101" # Supports Chrome version 91. You can refer to http://chromedriver.chromium.org/downloads
version: "93.0.4577.63" # Supports Chrome version 93. You can refer to http://chromedriver.chromium.org/downloads
reporting:
- data-source: sample-labels
module: junit-xml
4 changes: 2 additions & 2 deletions app/jsm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ settings:
WEBDRIVER_VISIBLE: False
JMETER_VERSION: 5.2.1
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.
# Action percentage for Jmeter and Locust load executors
agent_browse_projects: 10
agent_view_request: 24
Expand Down Expand Up @@ -150,7 +150,7 @@ modules:
httpsampler.ignore_failed_embedded_resources: "true"
selenium:
chromedriver:
version: "90.0.4430.24" # Supports Chrome version 90. You can refer to http://chromedriver.chromium.org/downloads
version: "91.0.4472.101" # Supports Chrome version 91. You can refer to http://chromedriver.chromium.org/downloads
reporting:
- data-source: sample-labels
module: junit-xml
2 changes: 1 addition & 1 deletion app/selenium_ui/bitbucket/pages/selectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,4 @@ class UserSettingsLocator:


class RepoCommitsLocator:
repo_commits_graph = (By.CSS_SELECTOR, 'svg.commit-graph')
repo_commits_graph = (By.ID, 'commits-table')
49 changes: 31 additions & 18 deletions app/selenium_ui/jsm/pages/agent_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,27 +90,38 @@ def __init__(self, driver, request_key=None):
def wait_for_page_loaded(self):
self.wait_until_visible(ViewCustomerRequestLocators.bread_crumbs)

def check_comment_text_is_displayed(self, text, rte_status=None):
if self.get_elements(ViewCustomerRequestLocators.comment_text_field_RTE) or \
self.get_elements(ViewCustomerRequestLocators.comment_text_field):
if rte_status:
self.wait_until_available_to_switch(ViewCustomerRequestLocators.comment_text_field_RTE)
if self.wait_until_present(ViewCustomerRequestLocators.comment_tinymce_field).text != text:
self.wait_until_present(ViewCustomerRequestLocators.comment_tinymce_field).send_keys(text)
self.return_to_parent_frame()
self.wait_until_present(ViewCustomerRequestLocators.comment_internally_btn).click()
elif self.wait_until_present(ViewCustomerRequestLocators.comment_text_field).text != text:
self.wait_until_present(ViewCustomerRequestLocators.comment_text_field).send_keys(text)
self.wait_until_present(ViewCustomerRequestLocators.comment_internally_btn).click()

def add_request_comment(self, rte_status):
comment_text = f"Add comment from selenium - {self.generate_random_string(30)}"
textarea = self.get_element(ViewCustomerRequestLocators.comment_collapsed_textarea)
self.driver.execute_script("arguments[0].scrollIntoView(true);", textarea)
textarea.click()
comment_button = self.get_element(ViewCustomerRequestLocators.comment_internally_btn)
self.driver.execute_script("arguments[0].scrollIntoView(true);", comment_button)

if rte_status:
self.wait_until_available_to_switch(ViewCustomerRequestLocators.comment_text_field_RTE)
tinymce_field = self.get_element(ViewCustomerRequestLocators.comment_tinymce_field)
self.driver.execute_script("arguments[0].scrollIntoView(true);", tinymce_field)
self.action_chains().send_keys_to_element(tinymce_field, comment_text).perform()
self.wait_until_present(ViewCustomerRequestLocators.comment_tinymce_field).send_keys(comment_text)
self.return_to_parent_frame()
comment_button.click()
self.check_comment_text_is_displayed(comment_text, True)
else:
comment_text_field = self.get_element(ViewCustomerRequestLocators.comment_text_field)
self.driver.execute_script("arguments[0].scrollIntoView(true);", comment_text_field)
self.action_chains().move_to_element(comment_text_field).click()\
.send_keys_to_element(comment_text_field, comment_text).perform()
self.wait_until_present(ViewCustomerRequestLocators.comment_text_field).send_keys(comment_text)
comment_button.click()
self.check_comment_text_is_displayed(comment_text)

comment_button = self.get_element(ViewCustomerRequestLocators.comment_internally_btn)
self.driver.execute_script("arguments[0].scrollIntoView(true);", comment_button)
comment_button.click()
self.wait_until_visible(ViewCustomerRequestLocators.comment_collapsed_textarea)


Expand Down Expand Up @@ -168,13 +179,15 @@ def __init__(self, driver, project_key=None, queue_id=None):
self.page_url = url_manager.view_queue_all_open()

def wait_for_page_loaded(self):
self.wait_until_visible(ViewQueueLocators.queues_status)
self.wait_until_any_ec_presented(
selector_names=[ViewQueueLocators.queues_status, ViewQueueLocators.queue_is_empty], timeout=self.timeout)

def get_random_queue(self):
queues = self.get_elements(ViewQueueLocators.queues)
random_queue = random.choice([queue for queue in queues
if queue.text.partition('\n')[0] not in
['All open', 'Recently resolved', 'Resolved past 7 days']
and queue.text.partition('\n')[2] != '0'])
random_queue.click()
self.wait_until_visible(ViewQueueLocators.queues_status, timeout=self.timeout)
if not self.get_elements(ViewQueueLocators.queue_is_empty):
queues = self.get_elements(ViewQueueLocators.queues)
random_queue = random.choice([queue for queue in queues
if queue.text.partition('\n')[0] not in
['All open', 'Recently resolved', 'Resolved past 7 days']
and queue.text.partition('\n')[2] != '0'])
random_queue.click()
self.wait_until_present(ViewQueueLocators.queues_status, timeout=self.timeout)
1 change: 1 addition & 0 deletions app/selenium_ui/jsm/pages/agent_selectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,4 @@ class ViewQueueLocators:

queues = (By.CSS_SELECTOR, "#pinnednav-opts-sd-queues-nav li")
queues_status = (By.XPATH, "//span[contains(text(),'Status')]")
queue_is_empty = (By.CSS_SELECTOR, '.sd-queue-empty')
17 changes: 16 additions & 1 deletion app/util/analytics/analytics_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
import getpass
import re
import socket

from datetime import datetime, timezone
from util.common_util import get_current_version, get_latest_version

latest_version = get_latest_version()
current_version = get_current_version()
SUCCESS_TEST_RATE = 95.00
SUCCESS_RT_THRESHOLD = 20
OS = {'macOS': ['Darwin'], 'Windows': ['Windows'], 'Linux': ['Linux']}
Expand Down Expand Up @@ -62,7 +66,18 @@ def generate_report_summary(collector):
summary_report.append(f'Summary run status|{overall_status}\n')
summary_report.append(f'Artifacts dir|{os.path.basename(collector.log_dir)}')
summary_report.append(f'OS|{collector.os}')
summary_report.append(f'DC Apps Performance Toolkit version|{collector.tool_version}')
if latest_version is None:
summary_report.append((f"DC Apps Performance Toolkit version|{collector.tool_version} "
f"(WARNING: Could not get the latest version.)"))
elif latest_version > current_version:
summary_report.append(f"DC Apps Performance Toolkit version|{collector.tool_version} "
f"(FAIL: Please update toolkit to the latest version - {latest_version})")
elif latest_version == current_version:
summary_report.append(f"DC Apps Performance Toolkit version|{collector.tool_version} "
f"(OK: Toolkit is up to date)")
else:
summary_report.append(f"DC Apps Performance Toolkit version|{collector.tool_version} "
f"(OK: Toolkit is ahead of the latest production version: {latest_version})")
summary_report.append(f'Application|{collector.app_type} {collector.application_version}')
summary_report.append(f'Dataset info|{collector.dataset_information}')
summary_report.append(f'Application nodes count|{collector.nodes_count}')
Expand Down
35 changes: 30 additions & 5 deletions app/util/bitbucket/populate_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@
################### Check if NFS exists ###################
pgrep nfsd > /dev/null && echo "NFS found" || { echo NFS process was not found. This script is intended to run only on the Bitbucket NFS Server machine. && exit 1; }

# Read command line arguments
while [[ "$#" -gt 0 ]]; do case $1 in
--small) small=1 ;;
--force)
if [ -n "$2" ] && [ "${2:0:1}" != "-" ]; then
force=1
version=${2}
shift
else
force=1
fi
;;
*) echo "Unknown parameter passed: $1"; exit 1;;
esac; shift; done

################### Variables section ###################
# Command to install psql client for Amazon Linux 2.
# In case of different distributive, please adjust accordingly or install manually.
Expand All @@ -23,7 +38,7 @@ BITBUCKET_DB_PASS="Password1!"
BITBUCKET_AUTO_DECLINE_VERSION="7.7.0"

# BITBUCKET version variables
SUPPORTED_BITBUCKET_VERSIONS=(6.10.11 7.0.5 7.6.7)
SUPPORTED_BITBUCKET_VERSIONS=(6.10.13 7.0.5 7.6.9)
BITBUCKET_VERSION=$(sudo su bitbucket -c "cat ${BITBUCKET_VERSION_FILE}")
if [[ -z "$BITBUCKET_VERSION" ]]; then
echo The $BITBUCKET_VERSION_FILE file does not exists or emtpy. Please check if BITBUCKET_VERSION_FILE variable \
Expand All @@ -33,8 +48,12 @@ fi
echo "Bitbucket version: ${BITBUCKET_VERSION}"

# Datasets AWS bucket and db dump name
DATASETS_AWS_BUCKET="https://centaurus-datasets.s3.amazonaws.com/bitbucket"

DATASETS_SIZE="large"
if [[ ${small} == 1 ]]; then
DATASETS_SIZE="small"
fi
DATASETS_AWS_BUCKET="https://centaurus-datasets.s3.amazonaws.com/bitbucket"
DB_DUMP_NAME="db.dump"
DB_DUMP_URL="${DATASETS_AWS_BUCKET}/${BITBUCKET_VERSION}/${DATASETS_SIZE}/${DB_DUMP_NAME}"

Expand All @@ -48,10 +67,16 @@ if [[ ! "${SUPPORTED_BITBUCKET_VERSIONS[*]}" =~ ${BITBUCKET_VERSION} ]]; then
echo "e.g. ./populate_db.sh --force 6.10.0"
echo "!!! Warning !!! This may break your Bitbucket instance. Also, note that downgrade is not supported by Bitbucket."
# Check if --force flag is passed into command
if [[ "$1" == "--force" ]]; then
if [[ ${force} == 1 ]]; then
# Check if version was specified after --force flag
if [[ -z ${version} ]]; then
echo "Error: --force flag requires version after it."
echo "Specify one of these versions: ${SUPPORTED_BITBUCKET_VERSIONS[*]}"
exit 1
fi
# Check if passed Bitbucket version is in list of supported
if [[ "${SUPPORTED_BITBUCKET_VERSIONS[*]}" =~ ${2} ]]; then
DB_DUMP_URL="${DATASETS_AWS_BUCKET}/$2/${DATASETS_SIZE}/${DB_DUMP_NAME}"
if [[ " ${SUPPORTED_BITBUCKET_VERSIONS[@]} " =~ " ${version} " ]]; then
DB_DUMP_URL="${DATASETS_AWS_BUCKET}/${version}/${DATASETS_SIZE}/${DB_DUMP_NAME}"
echo "Force mode. Dataset URL: ${DB_DUMP_URL}"
else
LAST_DATASET_VERSION=${SUPPORTED_BITBUCKET_VERSIONS[${#SUPPORTED_BITBUCKET_VERSIONS[@]}-1]}
Expand Down
29 changes: 24 additions & 5 deletions app/util/bitbucket/upload_attachments.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,25 @@
################### Check if NFS exists ###################
pgrep nfsd > /dev/null && echo "NFS found" || { echo NFS process was not found. This script is intended to run only on the Bitbucket NFS Server machine. && exit 1; }

# Read command line arguments
while [[ "$#" -gt 0 ]]; do case $1 in
--small) small=1 ;;
--force)
if [ -n "$2" ] && [ "${2:0:1}" != "-" ]; then
force=1
version=${2}
shift
else
force=1
fi
;;
*) echo "Unknown parameter passed: $1"; exit 1;;
esac; shift; done

################### Variables section ###################
# Bitbucket version variables
BITBUCKET_VERSION_FILE="/media/atl/bitbucket/shared/bitbucket.version"
SUPPORTED_BITBUCKET_VERSIONS=(6.10.11 7.0.5 7.6.7)
SUPPORTED_BITBUCKET_VERSIONS=(6.10.13 7.0.5 7.6.9)
BITBUCKET_VERSION=$(sudo su bitbucket -c "cat ${BITBUCKET_VERSION_FILE}")
if [[ -z "$BITBUCKET_VERSION" ]]; then
echo The $BITBUCKET_VERSION_FILE file does not exists or emtpy. Please check if BITBUCKET_VERSION_FILE variable \
Expand All @@ -15,9 +30,13 @@ if [[ -z "$BITBUCKET_VERSION" ]]; then
fi
echo "Bitbucket Version: ${BITBUCKET_VERSION}"

DATASETS_SIZE="large"
if [[ ${small} == 1 ]]; then
DATASETS_SIZE="small"
fi

DATASETS_AWS_BUCKET="https://centaurus-datasets.s3.amazonaws.com/bitbucket"
ATTACHMENTS_TAR="attachments.tar.gz"
DATASETS_SIZE="large"
ATTACHMENTS_TAR_URL="${DATASETS_AWS_BUCKET}/${BITBUCKET_VERSION}/${DATASETS_SIZE}/${ATTACHMENTS_TAR}"
NFS_DIR="/media/atl/bitbucket/shared"
ATTACHMENT_DIR_DATA="data"
Expand All @@ -31,10 +50,10 @@ if [[ ! "${SUPPORTED_BITBUCKET_VERSIONS[*]}" =~ ${BITBUCKET_VERSION} ]]; then
echo "e.g. ./upload_attachments --force 6.10.0"
echo "!!! Warning !!! This may broke your Bitbucket instance."
# Check if --force flag is passed into command
if [[ "$1" == "--force" ]]; then
if [[ ${force} == 1 ]]; then
# Check if passed Bitbucket version is in list of supported
if [[ "${SUPPORTED_BITBUCKET_VERSIONS[*]}" =~ ${2} ]]; then
ATTACHMENTS_TAR_URL="${DATASETS_AWS_BUCKET}/$2/${DATASETS_SIZE}/${ATTACHMENTS_TAR}"
if [[ "${SUPPORTED_BITBUCKET_VERSIONS[*]}" =~ ${version} ]]; then
ATTACHMENTS_TAR_URL="${DATASETS_AWS_BUCKET}/${version}/${DATASETS_SIZE}/${ATTACHMENTS_TAR}"
echo "Force mode. Dataset URL: ${ATTACHMENTS_TAR_URL}"
else
LAST_DATASET_VERSION=${SUPPORTED_BITBUCKET_VERSIONS[${#SUPPORTED_BITBUCKET_VERSIONS[@]}-1]}
Expand Down
Loading

0 comments on commit f05089b

Please sign in to comment.