Skip to content

Commit

Permalink
Merge pull request #520 from escapewindow/no-cleanup
Browse files Browse the repository at this point in the history
Log tmpdir path before running cot verify
  • Loading branch information
escapewindow committed Sep 14, 2021
2 parents a2bc6f4 + b45728d commit 88ac950
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/scriptworker/cot/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -2070,13 +2070,13 @@ def verify_cot_cmdln(args=None, event_loop=None):
log.setLevel(level)
logging.basicConfig(level=level)
event_loop = event_loop or asyncio.get_event_loop()
if not opts.cleanup:
log.info("Artifacts will be in {}".format(tmp))
try:
event_loop.run_until_complete(_async_verify_cot_cmdln(opts, tmp))
finally:
if opts.cleanup:
rm(tmp)
else:
log.info("Artifacts are in {}".format(tmp))


# create_test_workdir {{{1
Expand Down
25 changes: 25 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,3 +644,28 @@ def test_fail_get_single_item_from_sequence(
utils.get_single_item_from_sequence(list_, condition)

assert str(exec_info.value) == expected_message


# add_projectid {{{1
@pytest.mark.parametrize(
"task, expected",
(
({"foo": "bar"}, {"projectId": "none", "foo": "bar"}),
({"projectId": "existing", "foo": "bar"}, {"projectId": "existing", "foo": "bar"}),
),
)
def test_add_projectid(task, expected):
assert utils.add_projectid(task) == expected


# add_taskqueueid {{{1
@pytest.mark.parametrize(
"task, expected",
(
({"provisionerId": "foo", "workerType": "bar"}, {"taskQueueId": "foo/bar"}),
({"taskQueueId": "foo/bar", "provisionerId": "foo", "workerType": "bar"}, {"taskQueueId": "foo/bar"}),
({"taskQueueId": "foo/bar"}, {"taskQueueId": "foo/bar"}),
),
)
def test_addtaskqueueid(task, expected):
assert utils.add_taskqueueid(task) == expected

0 comments on commit 88ac950

Please sign in to comment.