Skip to content

Commit

Permalink
Revert "Add artefact test executions rerun filter by environment name"
Browse files Browse the repository at this point in the history
This reverts commit 4804771.
  • Loading branch information
omar-selo committed May 8, 2024
1 parent b25cf36 commit b72ed72
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 25 deletions.
4 changes: 0 additions & 4 deletions backend/test_observer/controllers/artefacts/artefacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,6 @@ def rerun_artefact_test_executions(
test_executions = (
te for te in test_executions if set(te.review_decision) == decision
)
if environment := request.test_execution_environment_contains:
test_executions = (
te for te in test_executions if environment in te.environment.name
)

for te in test_executions:
get_or_create(db, TestExecutionRerunRequest, {"test_execution_id": te.id})
1 change: 0 additions & 1 deletion backend/test_observer/controllers/artefacts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,3 @@ class ArtefactPatch(BaseModel):
class RerunArtefactTestExecutionsRequest(BaseModel):
test_execution_status: TestExecutionStatus | None = None
test_execution_review_decision: set[TestExecutionReviewDecision] | None = None
test_execution_environment_contains: str | None = None
20 changes: 0 additions & 20 deletions backend/tests/controllers/artefacts/test_artefacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,23 +435,3 @@ def test_rerun_filters_ignore_review_decisions_order(

assert response.status_code == 200
assert test_execution.rerun_request


def test_rerun_filters_by_environment_name(
test_client: TestClient, generator: DataGenerator
):
a = generator.gen_artefact("candidate")
ab = generator.gen_artefact_build(a)
e1 = generator.gen_environment(name="laptop")
e2 = generator.gen_environment(name="server")
te1 = generator.gen_test_execution(ab, e1)
te2 = generator.gen_test_execution(ab, e2)

response = test_client.post(
f"/v1/artefacts/{a.id}/reruns",
json={"test_execution_environment_contains": "serv"},
)

assert response.status_code == 200
assert te1.rerun_request is None
assert te2.rerun_request

0 comments on commit b72ed72

Please sign in to comment.