Skip to content

Commit 83edc2f

Browse files
committed
Add tests for verify_run_task_caches
1 parent cbfa2b5 commit 83edc2f

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

test/test_util_verify.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,43 @@ def make_task_treeherder(label, symbol, platform="linux/opt"):
265265
pytest.raises(Exception),
266266
id="dependencies over limit",
267267
),
268+
pytest.param(
269+
"verify_run_task_caches",
270+
make_graph(
271+
make_task("task1", task_def={"payload": {"cache": {"foo": {}}}})
272+
),
273+
pytest.raises(Exception, match="not appropriate for its trust-domain"),
274+
id="using cache with wrong trust-domain",
275+
),
276+
pytest.param(
277+
"verify_run_task_caches",
278+
make_graph(
279+
make_task(
280+
"task1",
281+
task_def={
282+
"payload": {"cache": {"test-domain-level-1-checkouts": {}}}
283+
},
284+
)
285+
),
286+
pytest.raises(Exception, match="reserved for run-task"),
287+
id="using reserved cache",
288+
),
289+
pytest.param(
290+
"verify_run_task_caches",
291+
make_graph(
292+
make_task(
293+
"task1",
294+
task_def={
295+
"payload": {
296+
"cache": {"test-domain-level-1-checkouts": {}},
297+
"command": ["run-task"],
298+
}
299+
},
300+
)
301+
),
302+
pytest.raises(Exception, match="cache name is not dep"),
303+
id="using run-task without cache suffix",
304+
),
268305
),
269306
)
270307
@pytest.mark.filterwarnings("error")

0 commit comments

Comments
 (0)