Skip to content

Commit

Permalink
Update fuzzing-decision tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jschwartzentruber committed Feb 14, 2025
1 parent d6a51ad commit 7d63f6e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions services/fuzzing-decision/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ def mock_email(mocker):
mocker.patch("fuzzing_decision.decision.pool.OWNER_EMAIL", "[email protected]")


@pytest.fixture(autouse=True)
def mock_scheduler(mocker):
mocker.patch("fuzzing_decision.decision.pool.SCHEDULER_ID", "test")


@pytest.fixture(scope="module")
def appconfig():
# this is copied from:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ retries: 5
routes:
- [email protected]
- [email protected]
schedulerId: "-"
schedulerId: "test"
scopes:
- generic-worker:os-group:proj-fuzzing/windows-map2/Administrators
- generic-worker:run-as-administrator:proj-fuzzing/windows-map2
Expand Down
12 changes: 6 additions & 6 deletions services/fuzzing-decision/tests/test_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def _get_expected_hook(platform="linux"):
"provisionerId": "proj-fuzzing",
"retries": 5,
"routes": [],
"schedulerId": "-",
"schedulerId": "test",
"scopes": [f"assume:hook-id:project-fuzzing/{platform}-test"],
"tags": {},
"workerType": "decision",
Expand All @@ -148,10 +148,10 @@ def _get_expected_role(
"kind": "Role",
"roleId": f"hook-id:project-fuzzing/{platform}-test",
"scopes": [
"queue:cancel-task:-/*",
"queue:cancel-task:test/*",
"queue:create-task:highest:proj-fuzzing/decision",
f"queue:create-task:highest:proj-fuzzing/{platform}-test",
"queue:scheduler-id:-",
"queue:scheduler-id:test",
"secrets:get:project/fuzzing/decision",
],
}
Expand Down Expand Up @@ -762,7 +762,7 @@ def _get_date(value: str):
"provisionerId": "proj-fuzzing",
"retries": 5,
"routes": task["routes"],
"schedulerId": "-",
"schedulerId": "test",
"scopes": task["scopes"],
"tags": {},
"taskGroupId": "someTaskId",
Expand Down Expand Up @@ -872,7 +872,7 @@ def _get_date(value: str):
"provisionerId": "proj-fuzzing",
"retries": 5,
"routes": [],
"schedulerId": "-",
"schedulerId": "test",
"scopes": scopes,
"tags": {},
"taskGroupId": "someTaskId",
Expand Down Expand Up @@ -1280,7 +1280,7 @@ def _get_date(value: str):
"provisionerId": "proj-fuzzing",
"retries": 5,
"routes": task["routes"],
"schedulerId": "-",
"schedulerId": "test",
"scopes": task["scopes"],
"tags": {},
"taskGroupId": "someTaskId",
Expand Down

0 comments on commit 7d63f6e

Please sign in to comment.