From e62e8c0061d2de30e16750c651939b883b86c7e5 Mon Sep 17 00:00:00 2001 From: hunkom <46744804+hunkom@users.noreply.github.com> Date: Tue, 3 Nov 2020 06:51:38 +0200 Subject: [PATCH] Update CC and observer versions (#134) Co-authored-by: mykhailo_hunko --- galloper/api/ui_planner.py | 3 ++- galloper/database/models/performance_tests.py | 8 ++++---- galloper/database/models/security_tests.py | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/galloper/api/ui_planner.py b/galloper/api/ui_planner.py index 7dace77b..4376e8ba 100644 --- a/galloper/api/ui_planner.py +++ b/galloper/api/ui_planner.py @@ -13,6 +13,7 @@ from galloper.database.models.project import Project from galloper.database.models.statistic import Statistic from galloper.utils.api_utils import build_req_parser, str2bool +from galloper.constants import CURRENT_RELEASE class UITestsApiPerformance(Resource): @@ -68,7 +69,7 @@ def post(self, project_id: int): project = Project.get_or_404(project_id) browser = args["browser"] - runner = "getcarrier/observer:latest" + runner = f"getcarrier/observer:{CURRENT_RELEASE}" job_type = "observer" if args.get("git"): diff --git a/galloper/database/models/performance_tests.py b/galloper/database/models/performance_tests.py index d8f1fbf4..d796638e 100644 --- a/galloper/database/models/performance_tests.py +++ b/galloper/database/models/performance_tests.py @@ -21,7 +21,7 @@ from galloper.database.db_manager import Base from galloper.database.abstract_base import AbstractBaseMixin from galloper.dal.vault import unsecret -from galloper.constants import JOB_CONTAINER_MAPPING +from galloper.constants import JOB_CONTAINER_MAPPING, CURRENT_RELEASE class PerformanceTests(AbstractBaseMixin, Base): @@ -193,9 +193,9 @@ def configure_execution_json(self, output='cc', test_type=None, params=None, env return execution_json else: return "docker run -e project_id=%s -e galloper_url=%s -e token=%s" \ - " getcarrier/control_tower:latest --test_id=%s" \ + " getcarrier/control_tower:%s --test_id=%s" \ "" % (self.project_id, unsecret("{{secret.galloper_url}}", project_id=self.project_id), - unsecret("{{secret.auth_token}}", project_id=self.project_id), self.test_uid) + unsecret("{{secret.auth_token}}", project_id=self.project_id), CURRENT_RELEASE, self.test_uid) def to_json(self, exclude_fields: tuple = ()) -> dict: test_param = super().to_json() @@ -299,5 +299,5 @@ def configure_execution_json(self, output='cc', browser=None, test_type=None, pa return f'docker run -t --rm -e project_id={self.project_id} ' \ f'-e galloper_url={unsecret("{{secret.galloper_url}}", project_id=self.project_id)} ' \ f"-e token=\"{unsecret('{{secret.auth_token}}', project_id=self.project_id)}\" " \ - f'getcarrier/control_tower:latest ' \ + f'getcarrier/control_tower:{CURRENT_RELEASE} ' \ f'--test_id {self.test_uid}' diff --git a/galloper/database/models/security_tests.py b/galloper/database/models/security_tests.py index 56bde497..001bec62 100644 --- a/galloper/database/models/security_tests.py +++ b/galloper/database/models/security_tests.py @@ -222,7 +222,7 @@ def configure_execution_json(self, output="cc", execution=False, thresholds={}): f"-e project_id={self.project_id} " \ f"-e galloper_url={unsecret('{{secret.galloper_url}}', project_id=self.project_id)} " \ f"-e token=\"{unsecret('{{secret.auth_token}}', project_id=self.project_id)}\" " \ - f"getcarrier/control_tower:latest " \ + f"getcarrier/control_tower:{CURRENT_RELEASE} " \ f"-tid {self.test_uid}" if output == "cc": execution_json = { @@ -460,7 +460,7 @@ def configure_execution_json(self, output="cc", execution=False, thresholds={}): f"-e project_id={self.project_id} " \ f"-e galloper_url={unsecret('{{secret.galloper_url}}', project_id=self.project_id)} " \ f"-e token=\"{unsecret('{{secret.auth_token}}', project_id=self.project_id)}\" " \ - f"getcarrier/control_tower:latest " \ + f"getcarrier/control_tower:{CURRENT_RELEASE} " \ f"-tid {self.test_uid}" if output == "cc": execution_json = {