From 72bfd26fda07a11ccdb470ab85d4d60e42feee8e Mon Sep 17 00:00:00 2001 From: AmstlerStephan <96417996+AmstlerStephan@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:59:46 +0100 Subject: [PATCH] Update nf-test to v0.8.2 (#91) * update nf-test to v0.8.2 Should execute pipeline applying an additive model * update .gitignore Ignore .nf-test.log in commits * update test case regenie_step2 add snapshot remove redundant cases * update snapshot regenie_step1 --- .github/workflows/ci-tests.yml | 2 +- .gitignore | 1 + tests/main.nf.test.snap | 4 ++-- tests/modules/local/regenie_step1.nf.test.snap | 6 +++--- tests/modules/local/regenie_step2.nf.test | 8 ++------ tests/modules/local/regenie_step2.nf.test.snap | 12 ++++++++++++ 6 files changed, 21 insertions(+), 12 deletions(-) create mode 100644 tests/modules/local/regenie_step2.nf.test.snap diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 70f53a2..b6d249d 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -20,7 +20,7 @@ jobs: - name: Add nextflow to path run: echo "/opt/nextflow" >> $GITHUB_PATH; - name: Install nf-test - run: sudo bash; mkdir /opt/nf-test; cd /opt/nf-test; wget https://github.com/askimed/nf-test/releases/download/v0.8.0/nf-test-0.8.0.tar.gz; tar xvfz nf-test-*.tar.gz; chmod +x nf-test; + run: sudo bash; mkdir /opt/nf-test; cd /opt/nf-test; wget https://github.com/askimed/nf-test/releases/download/v0.8.2/nf-test-0.8.2.tar.gz; tar xvfz nf-test-*.tar.gz; chmod +x nf-test; - name: Add nf-test to pathdocker build -t genepi/nf-gwas . run: echo "/opt/nf-test" >> $GITHUB_PATH; - name: Run nf-test tests with development profile diff --git a/.gitignore b/.gitignore index 6d40cec..95cf9e2 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ tests/output nf-test .project .DS_Store +.nf-test.log diff --git a/tests/main.nf.test.snap b/tests/main.nf.test.snap index 9ef3c3c..38153ea 100644 --- a/tests/main.nf.test.snap +++ b/tests/main.nf.test.snap @@ -1,13 +1,13 @@ { "Should execute pipeline applying an additive model": { "content": [ - "Y1.regenie.gz:md5,e4ddf7505dc35e1173c4401f4090da76", + "Y1.regenie.gz:md5,3b46e913e302d59a27c87f989384a689", { "tasksFailed": 0, "tasksCount": 15, "tasksSucceeded": 15 } ], - "timestamp": "2023-09-08T15:21:44.585872" + "timestamp": "2023-12-14T13:41:14.112083" } } \ No newline at end of file diff --git a/tests/modules/local/regenie_step1.nf.test.snap b/tests/modules/local/regenie_step1.nf.test.snap index 39cc832..c8d4e77 100644 --- a/tests/modules/local/regenie_step1.nf.test.snap +++ b/tests/modules/local/regenie_step1.nf.test.snap @@ -1,9 +1,9 @@ { "Should execute regenie step 1 for 2 phenotypes ": { "content": [ - "regenie_step1_out_1.loco.gz:md5,7acd8ecadafb0eb9bbab2eb8b529e54f", - "regenie_step1_out_2.loco.gz:md5,41ab9671090c2f7af3834242e691d18a" + "regenie_step1_out_1.loco.gz:md5,5e3f3bd230d519c0740ae158d2ba2f41", + "regenie_step1_out_2.loco.gz:md5,ff2327b54520a6885df85ad27cebcd19" ], - "timestamp": "2023-09-08T13:14:33.253877" + "timestamp": "2023-12-14T15:05:10.807967" } } \ No newline at end of file diff --git a/tests/modules/local/regenie_step2.nf.test b/tests/modules/local/regenie_step2.nf.test index 7a5db75..df0e73d 100644 --- a/tests/modules/local/regenie_step2.nf.test +++ b/tests/modules/local/regenie_step2.nf.test @@ -31,17 +31,13 @@ nextflow_process { then { assert process.success - //check amount of processes assert process.trace.tasks().size() == 1 with(process.out) { + assert snapshot(regenie_step2_out.get(0)).match() with(regenie_step2_out.get(0)){ - assert size() == 3 - assert get(0) == "example" - assert path(get(1)).md5 == 'd02411453e1236fb378020bb95246cc5' - assert path(get(2)).md5 == '89086862ab0ea9b2a1a92f3bee0b55d3' - + // access second element of first tuple def lines = path(get(1)).readLinesGzip() diff --git a/tests/modules/local/regenie_step2.nf.test.snap b/tests/modules/local/regenie_step2.nf.test.snap new file mode 100644 index 0000000..c1c0b7b --- /dev/null +++ b/tests/modules/local/regenie_step2.nf.test.snap @@ -0,0 +1,12 @@ +{ + "Should execute regenie step2 without predictions": { + "content": [ + [ + "example", + "example.regenie.gz:md5,18c80204000d96c4cffbfd1859088111", + "example.regenie.Ydict:md5,89086862ab0ea9b2a1a92f3bee0b55d3" + ] + ], + "timestamp": "2023-12-14T14:47:08.826254" + } +} \ No newline at end of file