Skip to content

Commit

Permalink
Merge pull request #843 from atlassian/release/6.2.2
Browse files Browse the repository at this point in the history
Release/6.2.2
  • Loading branch information
OlehStefanyshyn committed Jun 9, 2022
2 parents a306099 + babbb22 commit 22020fb
Show file tree
Hide file tree
Showing 17 changed files with 88 additions and 59 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This repository contains Taurus scripts for performance testing of Atlassian Dat
* Jira Service Management [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `4.13.20`, `4.20.8`

* Supported Confluence versions:
* Confluence [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `7.13.5`, `7.4.16`
* Confluence [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `7.13.7`, `7.4.17`

* Supported Bitbucket Server versions:
* Bitbucket Server [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `7.6.14`, `7.17.6`
Expand Down
2 changes: 1 addition & 1 deletion app/bamboo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ modules:
httpsampler.ignore_failed_embedded_resources: "true"
selenium:
chromedriver:
version: "101.0.4951.41" # Supports Chrome version 101. You can refer to http://chromedriver.chromium.org/downloads
version: "102.0.5005.61" # Supports Chrome version 102. You can refer to http://chromedriver.chromium.org/downloads
reporting:
- data-source: sample-labels
module: junit-xml
2 changes: 1 addition & 1 deletion app/bitbucket.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ modules:
httpsampler.ignore_failed_embedded_resources: "true"
selenium:
chromedriver:
version: "101.0.4951.41" # Supports Chrome version 101. You can refer to http://chromedriver.chromium.org/downloads
version: "102.0.5005.61" # Supports Chrome version 102. You can refer to http://chromedriver.chromium.org/downloads
reporting:
- data-source: sample-labels
module: junit-xml
2 changes: 1 addition & 1 deletion app/confluence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ modules:
httpsampler.ignore_failed_embedded_resources: "true"
selenium:
chromedriver:
version: "101.0.4951.41" # Supports Chrome version 101. You can refer to http://chromedriver.chromium.org/downloads
version: "102.0.5005.61" # Supports Chrome version 102. You can refer to http://chromedriver.chromium.org/downloads
reporting:
- data-source: sample-labels
module: junit-xml
2 changes: 1 addition & 1 deletion app/jira.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ modules:
httpsampler.ignore_failed_embedded_resources: "true"
selenium:
chromedriver:
version: "101.0.4951.41" # Supports Chrome version 101. You can refer to http://chromedriver.chromium.org/downloads
version: "102.0.5005.61" # Supports Chrome version 102. You can refer to http://chromedriver.chromium.org/downloads
reporting:
- data-source: sample-labels
module: junit-xml
2 changes: 1 addition & 1 deletion app/jsm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ modules:
httpsampler.ignore_failed_embedded_resources: "true"
selenium:
chromedriver:
version: "101.0.4951.41" # Supports Chrome version 101. You can refer to http://chromedriver.chromium.org/downloads
version: "102.0.5005.61" # Supports Chrome version 102. You can refer to http://chromedriver.chromium.org/downloads
reporting:
- data-source: sample-labels
module: junit-xml
9 changes: 4 additions & 5 deletions app/selenium_ui/jira_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ def test_0_selenium_a_login(jira_webdriver, jira_datasets, jira_screen_shots):
modules.login(jira_webdriver, jira_datasets)


def test_1_selenium_view_project_summary(jira_webdriver, jira_datasets, jira_screen_shots):
modules.view_project_summary(jira_webdriver, jira_datasets)


def test_1_selenium_browse_projects_list(jira_webdriver, jira_datasets, jira_screen_shots):
modules.browse_projects_list(jira_webdriver, jira_datasets)

Expand Down Expand Up @@ -51,11 +55,6 @@ def test_1_selenium_view_issue(jira_webdriver, jira_datasets, jira_screen_shots)
modules.view_issue(jira_webdriver, jira_datasets)


def test_1_selenium_view_project_summary(jira_webdriver, jira_datasets, jira_screen_shots):
modules.view_project_summary(jira_webdriver, jira_datasets)



"""
Add custom actions anywhere between login and log out action. Move this to a different line as needed.
Write your custom selenium scripts in `app/extension/jira/extension_ui.py`.
Expand Down
2 changes: 2 additions & 0 deletions app/util/analytics/analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ def __init__(self, application: BaseApplication):
self.application_version = application.version
self.nodes_count = application.nodes_count
self.dataset_information = application.dataset_information
if self.app_type != CROWD:
self.processors = application.processors
# JSM(INSIGHT) app type has additional concurrency fields: concurrency_agents, concurrency_customers
if self.app_type == INSIGHT:
self.concurrency_agents = self.conf.agents_concurrency
Expand Down
2 changes: 2 additions & 0 deletions app/util/analytics/analytics_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ def generate_report_summary(collector):
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}')
if not collector.app_type == CROWD:
summary_report.append(f'Available Processors|{collector.processors}')
summary_report.append(f'Concurrency|{collector.concurrency}')
summary_report.append(f'Expected test run duration from yml file|{collector.duration} sec')
summary_report.append(f'Actual test run duration|{collector.actual_duration} sec')
Expand Down
22 changes: 8 additions & 14 deletions app/util/analytics/application_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from util.api.bitbucket_clients import BitbucketRestClient
from util.api.crowd_clients import CrowdRestClient
from util.api.bamboo_clients import BambooClient
from lxml import etree
import json

JIRA = 'jira'
Expand Down Expand Up @@ -52,6 +51,10 @@ def selenium_default_actions(self):
def locust_default_actions(self):
return self.get_default_actions()['locust']

@property
def processors(self):
return self.client.get_available_processors()


class Jira(BaseApplication):
type = JIRA
Expand All @@ -64,7 +67,7 @@ def version(self):

@property
def nodes_count(self):
return self.client.get_cluster_nodes_count(jira_version=self.version)
return len(self.client.get_nodes())

def __issues_count(self):
return self.client.get_total_issues_count()
Expand All @@ -83,7 +86,7 @@ def version(self):

@property
def nodes_count(self):
return self.client.get_confluence_nodes_count()
return len(self.client.get_confluence_nodes())

@property
def dataset_information(self):
Expand All @@ -92,7 +95,6 @@ def dataset_information(self):

class Bitbucket(BaseApplication):
type = BITBUCKET
bitbucket_repos_selector = "#content-bitbucket\.atst\.repositories-0>.field-group>.field-value" # noqa W605

@property
def version(self):
Expand All @@ -104,13 +106,7 @@ def nodes_count(self):

@property
def dataset_information(self):
system_page_html = self.client.get_bitbucket_system_page()
if 'Repositories' in system_page_html:
dom = etree.HTML(system_page_html)
repos_count = dom.cssselect(self.bitbucket_repos_selector)[0].text
return f'{repos_count} repositories'
else:
return 'Could not parse number of Bitbucket repositories'
return f'{self.client.get_bitbucket_repo_count()} repositories'


class Jsm(BaseApplication):
Expand All @@ -123,9 +119,7 @@ def version(self):

@property
def nodes_count(self):
jira_server_info = self.client.get_server_info()
jira_server_version = jira_server_info.get('version', '')
return self.client.get_cluster_nodes_count(jira_version=jira_server_version)
return len(self.client.get_nodes())

def __issues_count(self):
return self.client.get_total_issues_count()
Expand Down
12 changes: 12 additions & 0 deletions app/util/api/bamboo_clients.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from lxml import html

from util.api.abstract_clients import RestClient
from selenium_ui.conftest import retry

Expand Down Expand Up @@ -156,6 +158,16 @@ def get_server_info(self):
r = self.get(f'{self.host}/rest/applinks/1.0/manifest', error_msg="Could not get Bamboo server info")
return r.json()

def get_available_processors(self):
processors = None
page = self.get(f'{self.host}/admin/systemInfo.action', 'Could not get Page content')
tree = html.fromstring(page.content)
try:
processors = tree.xpath('//*[@id="systemInfo_availableProcessors"]/text()')[0]
except Exception as error:
print(f"Warning: Could not parse number of Bamboo available processors: {error}")
return processors

def get_nodes_count(self):
r = self.get(f'{self.host}/rest/api/latest/server/nodes', error_msg="Could not get Bamboo nodes count")
return len(r.json()["nodeStatuses"])
Expand Down
28 changes: 24 additions & 4 deletions app/util/api/bitbucket_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,33 @@ def get_bitbucket_system_page(self):
headers = LOGIN_POST_HEADERS
headers['Origin'] = self.host
session.post(url, data=body, headers=headers)
r = session.get(f"{self.host}/plugins/servlet/troubleshooting/view/system-info/view")
return r.content.decode('utf-8')
response = session.get(f"{self.host}/plugins/servlet/troubleshooting/view/system-info/view")
return response

def get_bitbucket_repo_count(self):
repos_count = None
page = self.get_bitbucket_system_page()
tree = html.fromstring(page.content)
try:
repos_count = tree.xpath('//*[@id="content-bitbucket.atst.repositories-0"]/div[1]/span/text()')[0]
except Exception as error:
print(f"Warning: Could not parse number of Bitbucket repositories: {error}")
return repos_count

def get_available_processors(self):
processors = None
page = self.get_bitbucket_system_page()
tree = html.fromstring(page.content)
try:
processors = tree.xpath('//*[@id="content-stp.properties.os-0"]/div[4]/span/text()')[0]
except Exception as error:
print(f"Warning: Could not parse number of Bitbucket available processors: {error}")
return processors

def get_locale(self):
language = None
page = self.get(f'{self.host}/dashboard', "Could not get page content.", headers=LOGIN_POST_HEADERS).content
tree = html.fromstring(page)
page = self.get(f'{self.host}/dashboard', "Could not get page content.", headers=LOGIN_POST_HEADERS)
tree = html.fromstring(page.content)
try:
language = tree.xpath('//html/@lang')[0]
except Exception as error:
Expand Down
27 changes: 16 additions & 11 deletions app/util/api/confluence_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,10 @@ def get_users(self, prefix, count):
return users_list

def get_confluence_version(self):
version = ''
api_url = f'{self.host}/rest/applinks/1.0/manifest'
response = self.get(api_url, 'Could not get Confluence manifest')
tree = html.fromstring(response.content)
for child in tree:
if child.tag == 'version':
version = child.text
return version

return response.json()['version']

def search(self, cql, cqlcontext=None, expand=None, start=0, limit=500):
"""
Expand Down Expand Up @@ -132,12 +128,21 @@ def is_remote_api_enabled(self):
'General Configuration - Further Configuration - Remote API')
return response.status_code == 200

def get_confluence_nodes_count(self):
def get_confluence_nodes(self):
api_url = f"{self.host}/rest/atlassian-cluster-monitoring/cluster/nodes"
response = self.get(api_url, error_msg='Could not get Confluence nodes count via API',
expected_status_codes=[200, 500])
return 'Server' if response.status_code == 500 and 'NonClusterMonitoring' in response.text\
else len(response.json())
if response.status_code == 500 and 'NonClusterMonitoring' in response.text:
return 'Server'
nodes = [node['nodeId'] for node in response.json()]
return nodes

def get_available_processors(self):
node_id = self.get_confluence_nodes()[0]
api_url = f'{self.host}/rest/atlassian-cluster-monitoring/cluster/suppliers/data/com.atlassian.cluster' \
f'.monitoring.cluster-monitoring-plugin/runtime-information/{node_id}'
response = self.get(api_url, "Could not get Available Processors information")
return response.json()['data']['rows']['availableProcessors'][1]

def get_total_pages_count(self):
api_url = f"{self.host}/rest/api/search?cql=type=page"
Expand All @@ -151,8 +156,8 @@ def get_collaborative_editing_status(self):

def get_locale(self):
language = None
page = self.get(f"{self.host}/index.action#all-updates", "Could not get page content.").content
tree = html.fromstring(page)
page = self.get(f"{self.host}/index.action#all-updates", "Could not get page content.")
tree = html.fromstring(page.content)
try:
language = tree.xpath('.//meta[@name="ajs-user-locale"]/@content')[0]
except Exception as error:
Expand Down
23 changes: 9 additions & 14 deletions app/util/api/jira_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,13 @@ def get_server_info(self):

return response.json()

def get_nodes_count_via_rest(self):
# Works for Jira version >= 8.1.0
def get_nodes(self):
api_url = f'{self.host}/rest/api/2/cluster/nodes'
response = self.get(api_url, 'Could not get Jira nodes count', expected_status_codes=[200, 405])
if response.status_code == 405 and 'This Jira instance is not clustered' in response.text:
return 'Server'
nodes = [1 if node['state'] == "ACTIVE" and node['alive'] else 0 for node in response.json()]
return nodes.count(1)
nodes = [node['nodeId'] if node['state'] == "ACTIVE" and node['alive'] else 0 for node in response.json()]
return nodes

def get_system_info_page(self):
session = self._session
Expand All @@ -205,16 +204,12 @@ def get_system_info_page(self):
system_info_html = auth_request.content.decode("utf-8")
return system_info_html

def get_cluster_nodes_count(self, jira_version):
html_pattern = '<td><strong>Nodestate:</strong></td><td>Active</td>'
if jira_version >= '8.1.0':
return self.get_nodes_count_via_rest()
else:
jira_system_page = self.get_system_info_page()
nodes_count = jira_system_page.replace(' ', '').replace('\n', '').count(html_pattern)
if nodes_count == 0:
return 'Server'
return nodes_count
def get_available_processors(self):
node_id = self.get_nodes()[0]
api_url = f'{self.host}/rest/atlassian-cluster-monitoring/cluster/suppliers/data/com.atlassian.cluster' \
f'.monitoring.cluster-monitoring-plugin/runtime-information/{node_id}'
response = self.get(api_url, "Could not get Available Processors information")
return response.json()['data']['rows']['availableProcessors'][1]

def get_locale(self):
api_url = f'{self.host}/rest/api/2/myself'
Expand Down
2 changes: 1 addition & 1 deletion app/util/confluence/populate_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ CONFLUENCE_DB_PASS="Password1!"
SELECT_CONFLUENCE_SETTING_SQL="select BANDANAVALUE from BANDANA where BANDANACONTEXT = '_GLOBAL' and BANDANAKEY = 'atlassian.confluence.settings';"

# Confluence version variables
SUPPORTED_CONFLUENCE_VERSIONS=(7.4.16 7.13.5)
SUPPORTED_CONFLUENCE_VERSIONS=(7.4.17 7.13.7)

if [[ ! $(systemctl status confluence) ]]; then
echo "The Confluence service was not found on this host." \
Expand Down
2 changes: 1 addition & 1 deletion app/util/confluence/upload_attachments.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
################### Variables section ###################
# Confluence version variables
CONFLUENCE_VERSION_FILE="/media/atl/confluence/shared-home/confluence.version"
SUPPORTED_CONFLUENCE_VERSIONS=(7.4.16 7.13.5)
SUPPORTED_CONFLUENCE_VERSIONS=(7.4.17 7.13.7)
CONFLUENCE_VERSION=$(sudo su confluence -c "cat ${CONFLUENCE_VERSION_FILE}")
if [[ -z "$CONFLUENCE_VERSION" ]]; then
echo The $CONFLUENCE_VERSION_FILE file does not exists or emtpy. Please check if CONFLUENCE_VERSION_FILE variable \
Expand Down
6 changes: 3 additions & 3 deletions docs/dc-apps-performance-toolkit-user-guide-confluence.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ platform: platform
product: marketplace
category: devguide
subcategory: build
date: "2022-05-06"
date: "2022-06-09"
---
# Data Center App Performance Toolkit User Guide For Confluence

Expand Down Expand Up @@ -66,7 +66,7 @@ All important parameters are listed and described in this section. For all other
| Parameter | Recommended value |
| --------- |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Collaborative editing mode | synchrony-local |
| Confluence Version | The Data Center App Performance Toolkit officially supports `7.13.5` and `7.4.16` ([Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html)) |
| Confluence Version | The Data Center App Performance Toolkit officially supports `7.13.7` and `7.4.17` ([Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html)) |


**Cluster nodes**
Expand Down Expand Up @@ -384,7 +384,7 @@ All important parameters are listed and described in this section. For all other
| Parameter | Recommended value |
| --------- |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Collaborative editing mode | synchrony-local |
| Confluence Version | The Data Center App Performance Toolkit officially supports `7.13.5` and `7.4.16` ([Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html)) |
| Confluence Version | The Data Center App Performance Toolkit officially supports `7.13.7` and `7.4.17` ([Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html)) |

**Cluster nodes**

Expand Down

0 comments on commit 22020fb

Please sign in to comment.