Skip to content

Commit

Permalink
Optionally patch fields & rename jenkins to ci on TestExecution
Browse files Browse the repository at this point in the history
  • Loading branch information
omar-selo committed Dec 1, 2023
1 parent 5ecd073 commit 44e6df0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions backend/test_observer/controllers/test_executions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ def validate_required_fields(self) -> "StartTestExecutionRequest":


class TestExecutionsPatchRequest(BaseModel):
c3_link: str
jenkins_link: str
status: TestExecutionStatus
c3_link: HttpUrl | None
ci_link: HttpUrl | None
status: TestExecutionStatus | None
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,6 @@ def patch_test_execution(
):
test_execution = db.query(TestExecution).filter(TestExecution.id == id).one()
test_execution.c3_link = request.c3_link
test_execution.ci_link = request.jenkins_link
test_execution.ci_link = request.ci_link
test_execution.status = request.status
db.commit()
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,13 @@ def test_updates_test_execution(db_session: Session, test_client: TestClient):
test_client.patch(
f"/v1/test-executions/{test_execution.id}",
json={
"jenkins_link": "some jenkins link",
"c3_link": "some c3 link",
"ci_link": "http://ci_link/",
"c3_link": "http://c3_link/",
"status": TestExecutionStatus.PASSED.name,
},
)

db_session.refresh(test_execution)
assert test_execution.ci_link == "some jenkins link"
assert test_execution.c3_link == "some c3 link"
assert test_execution.ci_link == "http://ci_link/"
assert test_execution.c3_link == "http://c3_link/"
assert test_execution.status == TestExecutionStatus.PASSED

0 comments on commit 44e6df0

Please sign in to comment.