diff --git a/argus/backend/plugins/sct/testrun.py b/argus/backend/plugins/sct/testrun.py index d3067c56..417e8a25 100644 --- a/argus/backend/plugins/sct/testrun.py +++ b/argus/backend/plugins/sct/testrun.py @@ -267,7 +267,7 @@ def sut_timestamp(self) -> float: except IndexError: scylla_package_upgraded = None try: - scylla_package = [package for package in self.packages if package.name == "scylla-server"][0] + scylla_package = scylla_package_upgraded or [package for package in self.packages if package.name == "scylla-server"][0] except IndexError: raise ValueError("Scylla package not found in packages - cannot determine SUT timestamp") return (datetime.strptime(scylla_package.date, '%Y%m%d').replace(tzinfo=timezone.utc).timestamp() diff --git a/argus/backend/service/results_service.py b/argus/backend/service/results_service.py index 4ba00413..02f6dc14 100644 --- a/argus/backend/service/results_service.py +++ b/argus/backend/service/results_service.py @@ -593,14 +593,14 @@ def get_tests_by_version(self, sut_package_name: str, test_ids: list[UUID]) -> d test_method = row['test_method'] if not test_method: continue - sut_version = next( - (f"{pkg.version}-{pkg.date}-{pkg.revision_id}" for pkg in packages if pkg.name == f"{sut_package_name}-upgraded"), - None - ) or next( - (f"{pkg.version}-{pkg.date}-{pkg.revision_id}" for pkg in packages if pkg.name.startswith(sut_package_name)), - None - ) - + for sut_name in [f"{sut_package_name}-upgraded", + f"{sut_package_name}-upgrade-target", + sut_package_name, + f"{sut_package_name}-target" + ]: + sut_version = next((f"{pkg.version}-{pkg.date}-{pkg.revision_id}" for pkg in packages if pkg.name == sut_name), None) + if sut_version: + break if sut_version is None: continue method_name = test_method.rsplit('.', 1)[-1]