Hi all - I have found examples of excluding a file...
# nf-test
m
Hi all - I have found examples of excluding a file from a process snapshot but I am struggling to work out how to omit it in a workflow.out context. This is my snapshot
Copy code
{
  "Klebsiella pneumoniae -  long fastq": {
    "content": [
      {
        "0": [],
        "1": [
          [
            {
              "id": "K_pneumoniae",
              "single_end": false,
              "read_status": "filtered"
            },
            [
              "K_pneumoniae_filtered.raw.tsv:md5,8e57063daa44dc80334147c73fcf722f",
              "K_pneumoniae_filtered.tsv:md5,08c8ca8ce078f20032c8eda50d94257b"
            ]
          ]
        ],
        "2": [
          [
            {
              "id": "K_pneumoniae",
              "single_end": false,
              "read_status": "filtered"
            },
            "report.data:md5,bc1297846c1b52d8da460bb79dba3fcc"
          ]
        ],
        "3": [
          "versions.yml:md5,136aa7ed9644e4d30e9f07c6cad544d6",
          "versions.yml:md5,4f0556c59ceac7c95e42cac77c57209b"
        ],
        "fastqc_html_ch": [],
        "nanostat_tsv_ch": [
          [
            {
              "id": "K_pneumoniae",
              "single_end": false,
              "read_status": "filtered"
            },
            [
              "K_pneumoniae_filtered.raw.tsv:md5,8e57063daa44dc80334147c73fcf722f",
              "K_pneumoniae_filtered.tsv:md5,08c8ca8ce078f20032c8eda50d94257b"
            ]
          ]
        ],
        "toulligqc_out_dir": [
          [
            {
              "id": "K_pneumoniae",
              "single_end": false,
              "read_status": "filtered"
            },
            "report.data:md5,bc1297846c1b52d8da460bb79dba3fcc"
          ]
        ],
        "versions": [
          "versions.yml:md5,136aa7ed9644e4d30e9f07c6cad544d6",
          "versions.yml:md5,4f0556c59ceac7c95e42cac77c57209b"
        ]
      }
    ],
    "meta": {
      "nf-test": "0.9.2",
      "nextflow": "25.04.6"
    },
    "timestamp": "2025-11-24T16:45:44.233533029"
  }
}
report.data:md5,bc1297846c1b52d8da460bb79dba3fcc
- this file has some kind of timestamp (or is non-deterministic for whatever reason) I would like to exclude it from this assertion
Copy code
assert snapshot(workflow.out).match()
Can anyone give please give me some direction? 🙏
m
So what I would do is instead of snapshotting all from workflow.out, control what you aim to capture
what we've done with @Nicolas Vannieuwkerke is quite nice
m
Admittedly I was trying to avoid writing assertions for each individual output but it is probably good to do so as I will learn more about nf-test assertions 😛
So I am happy and sad that is your suggestion, haha
m
using
nft-utils
-> #C07PTBHLK7D. We filtered out all channels from the workflows. And from there we have a dedicated handling for specific output: https://github.com/nf-core/rnavar/blob/dev/subworkflows/local/prepare_genome/tests/main.nf.test#L76-L98
m
oh thats nice also
m
if it was a pipeline tests that would be different, and I would propose using the
.nftignore
file
m
Yeah I had seen thats an option too for pipelines
good to know it exists
Thanks for your response and for the link, much appreciated 🙂
Screenshot 2025-11-25 at 09.44.32.png
This looks nice also
party this 2
m
yeah, the plan was to allow similar usage as we have in pipeline tests
🙌 1
and simplify the way we deal with modules/subworkflows tests
❤️ 2