Skip to content

Commit 07b8681

Browse files
committed
Fix run-task detection in verify
1 parent 1e1ed20 commit 07b8681

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/taskgraph/util/verify.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55

66
import logging
7+
import os
78
import re
89
import sys
910
import warnings
@@ -333,7 +334,7 @@ def verify_run_task_caches(task, taskgraph, scratch_pad, graph_config, parameter
333334
command = payload.get("command") or [""]
334335

335336
main_command = command[0] if isinstance(command[0], str) else ""
336-
run_task = main_command.endswith("run-task")
337+
run_task = os.path.basename(main_command).startswith("run-task")
337338

338339
for cache in payload.get("cache", {}).get(
339340
"task-reference", payload.get("cache", {})

test/test_util_verify.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,22 @@ def make_task_treeherder(label, symbol, platform="linux/opt"):
302302
pytest.raises(Exception, match="cache name is not dep"),
303303
id="using run-task without cache suffix",
304304
),
305+
pytest.param(
306+
"verify_run_task_caches",
307+
make_graph(
308+
make_task(
309+
"task1",
310+
task_def={
311+
"payload": {
312+
"cache": {"test-domain-level-1-checkouts": {}},
313+
"command": ["run-task-hg"],
314+
}
315+
},
316+
)
317+
),
318+
pytest.raises(Exception, match="cache name is not dep"),
319+
id="using run-task-hg without cache suffix",
320+
),
305321
),
306322
)
307323
@pytest.mark.filterwarnings("error")

0 commit comments

Comments
 (0)