1010from taskgraph .transforms .docker_image import IMAGE_BUILDER_IMAGE
1111from taskgraph .util .vcs import get_repository
1212
13+ from .conftest import nowin
14+
1315
1416@pytest .fixture
1517def root_url ():
@@ -112,6 +114,7 @@ def test_load_task_invalid_task(run_load_task):
112114 assert run_load_task (task )[0 ] == 1
113115
114116
117+ @nowin
115118def test_load_task (run_load_task ):
116119 image_task_id = "def"
117120 task = {
@@ -172,6 +175,7 @@ def test_load_task(run_load_task):
172175 assert exp == actual [i ]
173176
174177
178+ @nowin
175179def test_load_task_env_init_and_remove (mocker , run_load_task ):
176180 # Mock NamedTemporaryFile to capture what's written to it
177181 mock_envfile = mocker .MagicMock ()
@@ -252,6 +256,7 @@ def test_load_task_env_init_and_remove(mocker, run_load_task):
252256 assert actual [6 :8 ] == ["-v" , "/tmp/test_initfile:/builds/worker/.bashrc" ]
253257
254258
259+ @nowin
255260@pytest .mark .parametrize (
256261 "image" ,
257262 [
@@ -292,6 +297,7 @@ def test_load_task_with_different_image_types(
292297 mocks ["load_image_by_task_id" ].assert_called_once_with (image_task_id )
293298
294299
300+ @nowin
295301def test_load_task_with_local_image (
296302 mocker ,
297303 run_load_task ,
@@ -322,6 +328,7 @@ def test_load_task_with_local_image(
322328 assert mocks ["build_image" ].call_args [0 ][1 ] == "hello-world"
323329
324330
331+ @nowin
325332def test_load_task_with_unsupported_image_type (caplog , run_load_task ):
326333 caplog .set_level (logging .DEBUG )
327334 task = {
@@ -343,6 +350,7 @@ def test_load_task_with_unsupported_image_type(caplog, run_load_task):
343350 assert "Tasks with unsupported-type images are not supported!" in caplog .text
344351
345352
353+ @nowin
346354def test_load_task_with_task_definition (run_load_task , caplog ):
347355 # Test passing a task definition directly instead of a task ID
348356 caplog .set_level (logging .INFO )
@@ -372,6 +380,7 @@ def test_load_task_with_task_definition(run_load_task, caplog):
372380 assert "Loading 'test-task-direct' from provided definition" in caplog .text
373381
374382
383+ @nowin
375384def test_load_task_with_interactive_false (run_load_task ):
376385 # Test non-interactive mode that doesn't require run-task
377386 # Task that doesn't use run-task (would fail in interactive mode)
@@ -427,6 +436,7 @@ def task():
427436 }
428437
429438
439+ @nowin
430440def test_load_task_with_custom_image_in_tree (run_load_task , task ):
431441 image = "hello-world"
432442 ret , mocks = run_load_task (task , custom_image = image )
@@ -453,13 +463,15 @@ def test_load_task_with_custom_image_in_tree(run_load_task, task):
453463 assert tag == f"taskcluster/{ image } :latest"
454464
455465
466+ @nowin
456467def test_load_task_with_custom_image_task_id (run_load_task , task ):
457468 image = "task-id=abc"
458469 ret , mocks = run_load_task (task , custom_image = image )
459470 assert ret == 0
460471 mocks ["load_image_by_task_id" ].assert_called_once_with ("abc" )
461472
462473
474+ @nowin
463475def test_load_task_with_custom_image_index (mocker , run_load_task , task ):
464476 image = "index=abc"
465477 mocker .patch .object (docker , "find_task_id" , return_value = "abc" )
@@ -468,6 +480,7 @@ def test_load_task_with_custom_image_index(mocker, run_load_task, task):
468480 mocks ["load_image_by_task_id" ].assert_called_once_with ("abc" )
469481
470482
483+ @nowin
471484def test_load_task_with_custom_image_registry (mocker , run_load_task , task ):
472485 image = "ubuntu:latest"
473486 ret , mocks = run_load_task (task , custom_image = image )
@@ -476,6 +489,7 @@ def test_load_task_with_custom_image_registry(mocker, run_load_task, task):
476489 assert not mocks ["build_image" ].called
477490
478491
492+ @nowin
479493def test_load_task_with_develop (mocker , run_load_task , task ):
480494 repo_name = "foo"
481495 repo_path = "/workdir/vcs"
@@ -623,6 +637,7 @@ def mock_path_constructor(path_arg):
623637 return inner
624638
625639
640+ @nowin
626641def test_build_image (run_build_image ):
627642 # Test building image without save_image
628643 result , mocks = run_build_image ("hello-world" )
@@ -654,6 +669,7 @@ def test_build_image(run_build_image):
654669 assert result == "hello-world:latest"
655670
656671
672+ @nowin
657673def test_build_image_with_parent (mocker , responses , root_url , run_build_image ):
658674 parent_task_id = "abc"
659675 responses .get (f"{ root_url } /api/queue/v1/task/{ parent_task_id } /status" )
@@ -687,6 +703,7 @@ def test_build_image_with_parent(mocker, responses, root_url, run_build_image):
687703 assert docker_load_args [:3 ] == ["docker" , "load" , "-i" ]
688704
689705
706+ @nowin
690707def test_build_image_with_parent_not_found (
691708 mocker , responses , root_url , run_build_image
692709):
@@ -725,6 +742,7 @@ def test_build_image_with_parent_not_found(
725742 assert docker_load_args [:3 ] == ["docker" , "load" , "-i" ]
726743
727744
745+ @nowin
728746def test_build_image_with_save_image (run_build_image ):
729747 save_path = "/path/to/save.tar"
730748
@@ -741,6 +759,7 @@ def test_build_image_with_save_image(run_build_image):
741759 assert save_path in str (result )
742760
743761
762+ @nowin
744763def test_build_image_context_only (run_build_image ):
745764 context_path = "/path/to/context.tar"
746765
0 commit comments