Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/taskgraph/util/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,14 +351,14 @@ def verify_run_task_caches(task, taskgraph, scratch_pad, graph_config, parameter

if not run_task:
raise Exception(
f"{task['label']} is using a cache ({cache}) reserved for run-task "
f"{task.label} is using a cache ({cache}) reserved for run-task "
"change the task to use run-task or use a different "
"cache name"
)

if suffix not in cache:
raise Exception(
f"{task['label']} is using a cache ({cache}) reserved for run-task "
f"{task.label} is using a cache ({cache}) reserved for run-task "
"but the cache name is not dependent on the contents "
"of run-task; change the cache name to conform to the "
"naming requirements"
Expand Down
37 changes: 37 additions & 0 deletions test/test_util_verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,43 @@ def make_task_treeherder(label, symbol, platform="linux/opt"):
pytest.raises(Exception),
id="dependencies over limit",
),
pytest.param(
"verify_run_task_caches",
make_graph(
make_task("task1", task_def={"payload": {"cache": {"foo": {}}}})
),
pytest.raises(Exception, match="not appropriate for its trust-domain"),
id="using cache with wrong trust-domain",
),
pytest.param(
"verify_run_task_caches",
make_graph(
make_task(
"task1",
task_def={
"payload": {"cache": {"test-domain-level-1-checkouts": {}}}
},
)
),
pytest.raises(Exception, match="reserved for run-task"),
id="using reserved cache",
),
pytest.param(
"verify_run_task_caches",
make_graph(
make_task(
"task1",
task_def={
"payload": {
"cache": {"test-domain-level-1-checkouts": {}},
"command": ["run-task"],
}
},
)
),
pytest.raises(Exception, match="cache name is not dep"),
id="using run-task without cache suffix",
),
),
)
@pytest.mark.filterwarnings("error")
Expand Down
Loading