diff options
Diffstat (limited to 'taskcluster/gecko_taskgraph/test/conftest.py')
-rw-r--r-- | taskcluster/gecko_taskgraph/test/conftest.py | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/taskcluster/gecko_taskgraph/test/conftest.py b/taskcluster/gecko_taskgraph/test/conftest.py index 360c2da65e..ff3d6ce2bd 100644 --- a/taskcluster/gecko_taskgraph/test/conftest.py +++ b/taskcluster/gecko_taskgraph/test/conftest.py @@ -151,6 +151,20 @@ class FakeOptimization(OptimizationStrategy): return False +class FakeTransformConfig: + kind = "fake-kind" + path = "/root/ci/fake-kind" + config = {} + params = FakeParameters() + kind_dependencies_tasks = {} + graph_config = {} + write_artifacts = False + + def __init__(self, **kwargs): + for k, v in kwargs.items(): + setattr(self, k, v) + + @pytest.fixture def maketgg(monkeypatch): def inner(target_tasks=None, kinds=[("_fake", [])], params=None): @@ -195,12 +209,16 @@ def maketgg(monkeypatch): @pytest.fixture def run_transform(): graph_config = fake_load_graph_config("/root") - kind = FakeKind.create("fake", {}, graph_config) + config = FakeTransformConfig(graph_config=graph_config) + + def inner(xform, tasks, **extra_config): + if extra_config: + for k, v in extra_config.items(): + setattr(config, k, v) - def inner(xform, tasks): if isinstance(tasks, dict): tasks = [tasks] - return xform(kind.config, tasks) + return xform(config, tasks) return inner |