From 752c692170a828a4ca6dd6c16070940670da6c8e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 22 Oct 2023 12:46:39 +0300 Subject: use CI_COMMIT_SHORT_SHA for selenium test mock --- tests/selenium/test.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/selenium/test.py b/tests/selenium/test.py index b1576cac1..6280b58b8 100644 --- a/tests/selenium/test.py +++ b/tests/selenium/test.py @@ -1,7 +1,14 @@ #!/usr/bin/python3 +import os from selenium import webdriver +CI_COMMIT_SHORT_SHA = os.getenv("CI_COMMIT_SHORT_SHA") + +if not CI_COMMIT_SHORT_SHA: + print("CI_COMMIT_SHORT_SHA env var should be defined") + exit(1) + options = webdriver.ChromeOptions() driver = webdriver.Remote( @@ -9,7 +16,10 @@ driver = webdriver.Remote( options=options ) -driver.get("http://tt-rss-latest-app.gitlab-fakecake.svc.cluster.local/tt-rss") +app_url = f"http://tt-rss-{CI_COMMIT_SHORT_SHA}-app.gitlab-fakecake.svc.cluster.local/tt-rss" + +print(f"base url = {app_url}") + +driver.get(app_url) print(driver.page_source) driver.quit() - -- cgit v1.2.3