Skip to content

Commit 2a67f29

Browse files
committed
Add tests with dry-run inventory caching.
1 parent 0ad5d3d commit 2a67f29

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

tests/common.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ def run(
178178
until=frozenset(),
179179
omit_from=frozenset(),
180180
forcerun=frozenset(),
181+
trust_mtime_cache=False,
181182
conda_list_envs=False,
182183
conda_create_envs=False,
183184
conda_prefix=None,
@@ -374,6 +375,7 @@ def run(
374375
force_incomplete=force_incomplete,
375376
forceall=forceall,
376377
rerun_triggers=rerun_triggers,
378+
trust_mtime_cache=trust_mtime_cache,
377379
),
378380
)
379381

tests/tests.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2051,3 +2051,24 @@ def test_failed_intermediate():
20512051
tmpdir = run(path, config={"fail": "init"}, cleanup=False, check_results=False)
20522052
run(path, config={"fail": "true"}, shouldfail=True, cleanup=False, tmpdir=tmpdir)
20532053
run(path, config={"fail": "false"}, cleanup=False, tmpdir=tmpdir)
2054+
2055+
2056+
@pytest.mark.parametrize(
2057+
"testdir,kwargs",
2058+
[
2059+
# ("test01", {}), # TODO: Figure out how to @skip_on_windows
2060+
("test02", {}),
2061+
("test03", {"targets": ["test.out"]}),
2062+
("test04", {"targets": ["test.out"]}),
2063+
# ("test05", {}), # TODO: Figure out how to @skip_on_windows
2064+
("test06", {"targets": ["test.bla.out"]}),
2065+
("test07", {"targets": ["test.out", "test2.out"]}),
2066+
("test08", {"targets": ["test.out", "test2.out"]}),
2067+
# ("test09", {"shouldfail": True}), # TODO: Figure out how to only fail in the second pass.
2068+
],
2069+
)
2070+
def test_inventory_cache_with_dryrun_first(testdir, kwargs):
2071+
tmpdir = run(
2072+
dpath(testdir), executor="dryrun", **kwargs, cleanup=False, check_results=False
2073+
)
2074+
run(dpath(testdir), **kwargs, tmpdir=tmpdir, trust_mtime_cache=True)

0 commit comments

Comments
 (0)