Sofia Drobysheva
04/03/2026, 11:51 AMnf-test test runs are successful, but for some I get a failed assertion. I then saw that files that I specify in the .nftignore are still added to the snapshot (which shouldn't happen, right?).
The things I double checked is that my .nftignore is in the tests folder ( ./tests/.nftignore ),
.. I trigger .nftignore in ./nf-test.config as:
triggers 'nextflow.config', 'nf-test.config', 'conf/test.config', 'tests/nextflow.config', 'tests/.nftignore'
.. and I mention .nftignore my test_<name>.nf.test file:
...
then {
def stable_contents = getAllFilesFromDir(params.outdir,
relative: false,
includeDir: false,
ignoreFile: 'tests/.nftignore'
)
...
}
Is there anything else I can check to understand why my ./tests/.nftignore is not being used when updating the snapshot (I did try to rebuild it several times)?
Thank you! 🙏Maxime Garcia
04/03/2026, 12:38 PMSofia Drobysheva
04/03/2026, 1:15 PMMaxime Garcia
04/03/2026, 1:18 PMSofia Drobysheva
04/03/2026, 1:26 PM.nftignore ? For example, now, in the .nftignore I have **/PCA.png, this regex should exclude PCA.png files in all folders and subfolders, right?Maxime Garcia
04/03/2026, 1:30 PMSofia Drobysheva
04/03/2026, 3:30 PMMaxime Garcia
04/03/2026, 3:57 PMSofia Drobysheva
04/03/2026, 9:15 PMtest_<name>.nf.test :
...
then {
def stable_name = getAllFilesFromDir(params.outdir,
relative: true,
includeDir: true,
ignore: ['pipeline_info/*.{html,json,txt}', 'multiqc_dataset/*.html']
)
def stable_contents = getAllFilesFromDir(params.outdir,
relative: false,
includeDir: false,
ignoreFile: 'tests/.nftignore'
)
// DEBUGGING
def all_files = getAllFilesFromDir(
params.outdir,
relative: false,
includeDir: false
)
// DEBUGGING
println "\n--- IGNORED FILES ---"
(all_files - stable_contents).each { println it } // <---- printing files that are not in stable_contents, looks good! I see paths to files that I want to exclude.
assertAll(
// Check that file names and contents are stable
{ assert snapshot(
workflow.trace.succeeded().size(),
stable_name,
stable_contents
).match() }
....
And yet I get 1 failed assertion java.lang.RuntimeException: Different Snapshot: where I see files (that I saw being excluded from stable_contents) having unmatched md5sums ( filename:md5, .1aaa.. | filename:md5, .2bbb.. )
Really puzzled.Sofia Drobysheva
04/04/2026, 8:21 AMSofia Drobysheva
04/07/2026, 12:04 PMpublishDir with `mode: 'symlink'`:
publishDir "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}", mode: 'symlink', failOnError: true
Once I switched to mode: 'copy' I no longer got failed assertions.
Is there something that one should be aware of when using symlinks and nf-test?Maxime Garcia
04/07/2026, 12:09 PMMaxime Garcia
04/07/2026, 12:10 PMMaxime Garcia
04/07/2026, 12:11 PMNicolas Vannieuwkerke
04/07/2026, 12:13 PMNicolas Vannieuwkerke
04/07/2026, 12:13 PMMaxime Garcia
04/07/2026, 12:15 PMNicolas Vannieuwkerke
04/07/2026, 12:18 PMMaxime Garcia
04/07/2026, 12:20 PMNicolas Vannieuwkerke
04/07/2026, 12:23 PMSofia Drobysheva
04/07/2026, 12:28 PMSofia Drobysheva
04/08/2026, 11:22 AMpublishDir "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}", mode: 'symlink', failOnError: true
output:
path('test')
As a workaround, I now excluded the whole process output folder, e.g. by adding test/** to .nftignore.