Skip to content

Commit 50b6dce

Browse files
committed
Separate download from unzip in integration test, scale down to 1 core
1 parent ea72ceb commit 50b6dce

2 files changed

Lines changed: 19 additions & 6 deletions

File tree

tests/clio_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def test_standard_file_existance(module_path, file):
4040
def test_snakemake_all_failure(module_path):
4141
"""The snakemake 'all' rule should return an error by default."""
4242
process = subprocess.run(
43-
"snakemake --cores 4", shell=True, cwd=module_path, capture_output=True
43+
"snakemake --cores 1", shell=True, cwd=module_path, capture_output=True
4444
)
4545
assert "INVALID (missing locally)" in str(process.stderr)
4646

tests/integration/Snakefile

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,34 @@ rule download_netherlands_shapes:
1818

1919

2020
rule download_netherlands_protected_areas:
21+
message:
22+
"Download and unzip a dummy drop-in dataset for Netherlands protected areas (not based on WDPA)."
23+
output:
24+
"results/integration_test/resources/user/wdpa.gdb.zip"
25+
log:
26+
"results/integration_test/logs/download_netherlands_protected_areas.log",
27+
conda:
28+
"../../workflow/envs/shell.yaml"
29+
shell:
30+
"""
31+
curl -sSLo "{output}" "https://surfdrive.surf.nl/files/index.php/s/msuXQETNbCWawDh/download"
32+
"""
33+
34+
rule unzip_netherlands_protected_areas:
2135
message:
2236
"Download and unzip a dummy drop-in dataset for Netherlands protected areas (not based on WDPA)."
2337
input:
2438
script=workflow.source_path("../../workflow/scripts/unzip_like.py"),
39+
zipfile=rules.download_netherlands_protected_areas.output,
2540
output:
26-
zipfile="results/integration_test/resources/user/wdpa.gdb.zip",
27-
wdpa=directory("results/integration_test/resources/user/wdpa.gdb"),
41+
directory("results/integration_test/resources/user/wdpa.gdb"),
2842
log:
29-
"results/integration_test/logs/download_netherlands_protected_areas.log",
43+
"results/integration_test/logs/unzip_netherlands_protected_areas.log",
3044
conda:
3145
"../../workflow/envs/shell.yaml"
3246
shell:
3347
"""
34-
curl -sSLo "{output.zipfile}" "https://surfdrive.surf.nl/files/index.php/s/msuXQETNbCWawDh/download"
35-
python "{input.script}" "{output.zipfile}" -t "results/integration_test/resources/user/" 2> "{log}"
48+
python "{input.script}" "{input.zipfile}" -t "results/integration_test/resources/user/" 2> "{log}"
3649
"""
3750

3851

0 commit comments

Comments
 (0)