Skip to content

Commit

Permalink
Pass retention to testrun if set
Browse files Browse the repository at this point in the history
  • Loading branch information
t-persson committed Aug 26, 2024
1 parent c57d5b3 commit d70bb1d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions python/src/etos_api/routers/testrun/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
Providers,
Image,
Metadata,
Retention,
TestRunner,
)
from etos_lib.kubernetes import TestRun, Environment, Kubernetes
Expand Down Expand Up @@ -138,6 +139,11 @@ async def _create_testrun(etos: StartTestrunRequest, span: Span) -> dict:
name = f"testrun-{testrun_id}-"
LOGGER.error("Could not get name from test suite, defaulting to %s", name)

retention = Retention(
failure=os.getenv("TESTRUN_FAILURE_RETENTION"),
success=os.getenv("TESTRUN_SUCCESS_RETENTION"),
)

testrun_spec = TestRunSchema(
metadata=Metadata(
generateName=name,
Expand All @@ -150,6 +156,7 @@ async def _create_testrun(etos: StartTestrunRequest, span: Span) -> dict:
spec=TestRunSpec(
cluster=os.getenv("ETOS_CLUSTER", "Unknown"),
id=testrun_id,
retention=retention,
suiteRunner=Image(
image=os.getenv(
"SUITE_RUNNER_IMAGE", "registry.nordix.org/eiffel/etos-suite-runner:latest"
Expand Down

0 comments on commit d70bb1d

Please sign in to comment.