Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read suites from Kubernetes testrun resource #74

Merged
merged 8 commits into from
Dec 2, 2024
Merged
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from etos_lib import ETOS
from etos_lib.kubernetes.schemas.testrun import Suite
from etos_lib.kubernetes.schemas.environment import Environment as EnvironmentSchema
from etos_lib.kubernetes import Kubernetes, Environment
from etos_lib.kubernetes import Kubernetes, Environment, TestRun
from eiffellib.events import EiffelTestExecutionRecipeCollectionCreatedEvent
from packageurl import PackageURL

Expand Down Expand Up @@ -160,14 +160,14 @@ def test_suite(self) -> list[Suite]:
"""Download and return test batches."""
with self.lock:
if self.__test_suite is None:
tercc = json.loads(os.getenv("TERCC", "{}"))
self.logger.info(tercc)
if isinstance(tercc, list):
self.__test_suite = [Suite(**suite) for suite in tercc]
if (testrun_id := os.getenv("TESTRUN")) is not None:
testrun = TestRun(Kubernetes()).get(testrun_id)
self.__test_suite = testrun.spec.suites
else:
tercc = json.loads(os.getenv("TERCC", "{}"))
test_suite = self._eiffel_test_suite(tercc)
# The dataset is not necessary for the suite runner.
andmat900 marked this conversation as resolved.
Show resolved Hide resolved
self.__test_suite = [Suite.from_tercc(suite, {}) for suite in test_suite]
test_suite = [Suite.from_tercc(suite, {}) for suite in test_suite]
self.__test_suite = test_suite
return self.__test_suite or []

def _eiffel_test_suite(self, tercc: dict) -> list[dict]:
Expand Down
Loading