Skip to content

Commit b522a08

Browse files
authored
Merge pull request #1835 from atlassian/issue/add-chrome-binary-location-in-ymls
Add chrome binary location to ymls files
2 parents 9728ade + 8afbdab commit b522a08

File tree

8 files changed

+26
-2
lines changed

8 files changed

+26
-2
lines changed

app/bamboo.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ settings:
3737
parallel_plans_count: 40 # number of parallel plans execution
3838
start_plan_timeout: 60 # maximum timeout of plan to start
3939
default_dataset_plan_duration: 60 # expected plan execution duration
40+
local_chrome_binary_path: # e.g. /usr/bin/google-chrome-stable. Leave it blank to use default Chrome binary path.
41+
4042
services:
4143
- module: shellexec
4244
prepare:

app/bitbucket.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ settings:
2020
WEBDRIVER_VISIBLE: False
2121
JMETER_VERSION: 5.6.3
2222
LANGUAGE: en_US.utf8
23-
allow_analytics: No # 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.
23+
allow_analytics: No # 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.
2424
environment_compliance_check: True # Pre-test environment compliance validation. Set to "False" to skip it.
25+
local_chrome_binary_path: # e.g. /usr/bin/google-chrome-stable. Leave it blank to use default Chrome binary path.
26+
2527
services:
2628
- module: shellexec
2729
prepare:

app/confluence.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ settings:
3838
standalone_extension: 0 # By default disabled
3939
# Custom dataset section.
4040
custom_dataset_query: # Write CQL query to add CQL output to the app/datasets/confluence/custom_pages.csv, e.g. "title ~ 'AppPage*'"
41+
local_chrome_binary_path: # e.g. /usr/bin/google-chrome-stable. Leave it blank to use default Chrome binary path.
42+
4143
services:
4244
- module: shellexec
4345
prepare:

app/jira.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ settings:
3838
standalone_extension: 0 # By default disabled
3939
# Custom dataset section.
4040
custom_dataset_query: # Write JQL query to add JQL output to the app/datasets/jira/custom-issues.csv, e.g. "summary ~ 'AppIssue*'"
41+
local_chrome_binary_path: # e.g. /usr/bin/google-chrome-stable. Leave it blank to use default Chrome binary path.
42+
4143
services:
4244
- module: shellexec
4345
prepare:

app/jsm.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ settings:
5252
customer_create_request: 16
5353
customer_insight_view_request: 6
5454
customer_standalone_extension: 0
55+
custom_dataset_query: # Write JQL query to add JQL output to the app/datasets/jsm/custom-issues.csv, e.g. "summary ~ 'AppRequests*'"
56+
local_chrome_binary_path: # e.g. /usr/bin/google-chrome-stable. Leave it blank to use default Chrome binary path.
5557

56-
custom_dataset_query: "" # Write JQL query to add JQL output to the app/datasets/jsm/custom-issues.csv, e.g. "summary ~ 'AppRequests*'"
5758
services:
5859
- module: shellexec
5960
prepare:

app/selenium_ui/conftest.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ def driver_init():
213213
chrome_options.add_argument("--headless")
214214
if not app_settings.secure:
215215
chrome_options.add_argument('--ignore-certificate-errors')
216+
if app_settings.local_chrome_binary_path is not None:
217+
chrome_options.binary_location = app_settings.local_chrome_binary_path
218+
print(f"Using custom local chrome binary path: {chrome_options.binary_location}")
216219
chrome_options.add_argument(
217220
"--window-size={},{}".format(SCREEN_WIDTH, SCREEN_HEIGHT))
218221
chrome_options.add_argument("--no-sandbox")

app/util/conf.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def __init__(self, config_yml):
5050
self.custom_dataset_query = self.get_property('custom_dataset_query') or ""
5151
self.verbose = self.settings['verbose']
5252
self.total_actions_per_hour = self.get_property('total_actions_per_hour')
53+
self.local_chrome_binary_path = self.get_property('local_chrome_binary_path')
5354

5455

5556
class ConfluenceSettings(BaseAppSettings):
@@ -62,6 +63,7 @@ def __init__(self, config_yml):
6263
self.verbose = self.settings['verbose']
6364
self.total_actions_per_hour = self.get_property('total_actions_per_hour')
6465
self.extended_metrics = self.get_property('extended_metrics')
66+
self.local_chrome_binary_path = self.get_property('local_chrome_binary_path')
6567

6668

6769
class BitbucketSettings(BaseAppSettings):
@@ -72,6 +74,7 @@ def __init__(self, config_yml):
7274
self.concurrency = self.get_property('concurrency')
7375
self.verbose = self.settings['verbose']
7476
self.total_actions_per_hour = self.get_property('total_actions_per_hour')
77+
self.local_chrome_binary_path = self.get_property('local_chrome_binary_path')
7578

7679

7780
class JsmSettings(BaseAppSettings):
@@ -87,6 +90,7 @@ def __init__(self, config_yml):
8790
self.custom_dataset_query = self.get_property('custom_dataset_query') or ""
8891
self.verbose = self.settings['verbose']
8992
self.insight = self.get_property('insight')
93+
self.local_chrome_binary_path = self.get_property('local_chrome_binary_path')
9094

9195

9296
class CrowdSettings(BaseAppSettings):
@@ -112,6 +116,7 @@ def __init__(self, config_yml):
112116
self.start_plan_timeout = self.env_settings['start_plan_timeout']
113117
self.default_dataset_plan_duration = self.env_settings['default_dataset_plan_duration']
114118
self.total_actions_per_hour = self.get_property('total_actions_per_hour')
119+
self.local_chrome_binary_path = self.get_property('local_chrome_binary_path')
115120

116121

117122
JIRA_SETTINGS = JiraSettings(config_yml=JIRA_YML)

app/util/pre_run/environment_compliance_check.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import subprocess
22
import sys
3+
import os
34

45
from packaging import version
56
from selenium import webdriver
@@ -80,6 +81,11 @@ def validate_chromedriver_version(app_name, app_settings):
8081
options = webdriver.ChromeOptions()
8182
options.add_argument("--headless")
8283
options.add_argument("--no-sandbox")
84+
if app_settings.local_chrome_binary_path is not None:
85+
print("INFO: Setting up local chrome binary path")
86+
if not os.path.exists(app_settings.local_chrome_binary_path):
87+
raise FileNotFoundError(f"ERROR: Chrome binary not found at {app_settings.local_chrome_binary_path}")
88+
options.binary_location = app_settings.local_chrome_binary_path
8389
driver = webdriver.Chrome(options=options)
8490
current_chrome_version = version.parse(driver.capabilities['browserVersion'])
8591
if app_settings.chromedriver_version:
@@ -123,6 +129,7 @@ def analyze_application_configuration(app_name, app_settings):
123129
print(f"INFO: application_postfix: {app_settings.postfix}")
124130
url = f"{app_settings.protocol}://{app_settings.hostname}:{app_settings.port}{app_settings.postfix}"
125131
print(f"INFO: Product URL: {url}")
132+
print(f"INFO: Local chrome binary path: {app_settings.local_chrome_binary_path}")
126133

127134
try:
128135
status = app.status

0 commit comments

Comments
 (0)