Skip to content

Commit

Permalink
Allow null ci link in start-test endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
rpbritton committed Jan 13, 2025
1 parent 9c9a97a commit ec07cd5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/test_observer/controllers/test_executions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from datetime import datetime
from enum import Enum
from typing import Annotated, Literal
from typing import Annotated, Literal, Optional

from pydantic import (
AliasPath,
Expand All @@ -46,7 +46,7 @@ class _StartTestExecutionRequest(BaseModel):
arch: str
execution_stage: StageName
environment: str
ci_link: Annotated[str, HttpUrl]
ci_link: Optional[Annotated[str, HttpUrl]]
test_plan: str = Field(max_length=200)
initial_status: TestExecutionStatus = TestExecutionStatus.IN_PROGRESS

Expand Down
9 changes: 9 additions & 0 deletions backend/tests/controllers/test_executions/test_start_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,3 +361,12 @@ def test_sets_initial_test_execution_status(db_session: Session, execute: Execut
te = db_session.get(TestExecution, response.json()["id"])
assert te is not None
assert te.status == TestExecutionStatus.NOT_STARTED


def test_allows_null_ci_link(db_session: Session, execute: Execute):
response = execute({**deb_test_request, "ci_link": None})

assert response.status_code == 200
te = db_session.get(TestExecution, response.json()["id"])
assert te is not None
assert te.ci_link == None

0 comments on commit ec07cd5

Please sign in to comment.