Skip to content

Commit e74cfea

Browse files
authored
[ci] Add log session-id in CI tests (#2992)
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent 66521f3 commit e74cfea

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

tests/AutoscalingTests/common.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ def get_pod_count():
5050
def create_session(browser_name):
5151
options = BROWSER[browser_name]
5252
options.set_capability("platformName", "Linux")
53-
return webdriver.Remote(
53+
driver = webdriver.Remote(
5454
command_executor=CLIENT_CONFIG.remote_server_addr, options=options, client_config=CLIENT_CONFIG
5555
)
56+
print(f"Session created: {driver.session_id} ({browser_name})")
57+
return driver
5658

5759

5860
def wait_for_count_matches(sessions, timeout=10, interval=5):

tests/SeleniumTests/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
TEST_MULTIPLE_PLATFORMS = os.environ.get('TEST_MULTIPLE_PLATFORMS', 'false').lower() == 'true'
3737
TEST_MULTIPLE_PLATFORMS_RELAY = os.environ.get('TEST_MULTIPLE_PLATFORMS_RELAY', 'false').lower() == 'true'
3838
TEST_MULTIPLE_VERSIONS_EXPLICIT = os.environ.get('TEST_MULTIPLE_VERSIONS_EXPLICIT', 'true').lower() == 'true'
39-
LIST_CHROMIUM_VERSIONS = ['137.0', '136.0', '135.0', '134.0', '133.0', '132.0', '131.0']
40-
LIST_FIREFOX_VERSIONS = ['139.0', '138.0', '137.0', '136.0', '135.0', '134.0', '133.0']
39+
LIST_CHROMIUM_VERSIONS = ['140.0', '139.0', '138.0', '137.0', '136.0', '135.0', '134.0']
40+
LIST_FIREFOX_VERSIONS = ['142.0', '141.0', '140.0', '139.0', '138.0', '137.0', '136.0']
4141
LIST_PLATFORMS = ['Linux', None, 'Windows 11']
4242

4343
if not TEST_MULTIPLE_VERSIONS_EXPLICIT:
@@ -194,7 +194,7 @@ def setUp(self):
194194
)
195195
end_time = time.time()
196196
print(
197-
f"Begin: {self._testMethodName} ({self.__class__.__name__}) WebDriver initialization completed in {end_time - start_time} (s)"
197+
f"Begin: {self._testMethodName} ({self.__class__.__name__}) WebDriver initialization completed in {end_time - start_time} (s) - SessionID: {self.driver.session_id}"
198198
)
199199
except Exception as e:
200200
print(f"::error::Exception: {str(e)}")
@@ -243,7 +243,7 @@ def setUp(self):
243243
)
244244
end_time = time.time()
245245
print(
246-
f"Begin: {self._testMethodName} ({self.__class__.__name__}) WebDriver initialization completed in {end_time - start_time} (s)"
246+
f"Begin: {self._testMethodName} ({self.__class__.__name__}) WebDriver initialization completed in {end_time - start_time} (s) - SessionID: {self.driver.session_id}"
247247
)
248248
except Exception as e:
249249
print(f"::error::Exception: {str(e)}")
@@ -297,7 +297,7 @@ def setUp(self):
297297
)
298298
end_time = time.time()
299299
print(
300-
f"Begin: {self._testMethodName} ({self.__class__.__name__}) WebDriver initialization completed in {end_time - start_time} (s)"
300+
f"Begin: {self._testMethodName} ({self.__class__.__name__}) WebDriver initialization completed in {end_time - start_time} (s) - SessionID: {self.driver.session_id}"
301301
)
302302
except Exception as e:
303303
print(f"::error::Exception: {str(e)}")

tests/get_started.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def run_browser_instance(browser, grid_url):
3838
command_executor=grid_url,
3939
options=options,
4040
)
41+
print(f"Session created: {driver.session_id} ({browser})")
4142
driver.get('https://www.google.com/')
4243
print(driver.title)
4344
time.sleep(100)

0 commit comments

Comments
 (0)