in the context of <#C05V42SU8DP|>, we would be int...
# nf-test
g
in the context of #C05V42SU8DP, we would be interested in checking assertions on the results of the AWS full tests. This would be to ensure that with a new release of a pipeline, main result files do not change without being noticed. As far as I'm aware, the AWS full tests just trigger a pipeline run on seqera platform, but do not check any assertions on the output. Has anyone attempted to do assertions on AWS full tests before? If yes, how did you implement this? CC @Alex Peltzer @Anabella Trigila @Delfina Terradas @Maria Antonia Saracco
❤️ 2
In terms of implementations, I see a couple of options • implement manual tests on the results (essentially duplicating some functionality of nf-test) • implement a "fake" nf-test pipeline that just fetches the results from the seqera platform run, but then uses nf-test's functionality to check assertions • somehow modify nf-test such that it supports seqera platform as a backend to submit the pipeline runs. Maybe this is already possible, by adding the corresponding config options to nextflow. Just the pipeline wouldn't be triggered via seqera platform API, but it would be a local nextflow run that can be monitored on seqera platform.
m
So I love the idea
And that's definitively what we should be doing at some point
My guess is with current setup it's going to be hard to do
I would actually just want to uncouple the execution from the tests, and be able to verify the output
basically in my mind, what we're currently using nf-test for in the pipeline for pipeline tests is doing unit test at a global level, when we only check the output
I'm progressing towards a test declaration as simple as possible for pipeline level tests
and at some point just checking out the content towards a snapshot would be the endgoal
g
So you are essentially proposing a nf-test feature that allows it to compare outputs without actually executing any nextflow code?
Probably something like pytest-workflow could do that already (which we have been using in the pre-nf-test era)
m
n
Also something to keep in mind here is that your head job has enough resources to read in the files. nf-test is not that efficient at doing that and big files can take up a lot of memory
party this 1
m
I am definitively going towards that direction
I would say that all depends on what you actually want to check, if it's file name or existence, it's easy
and a good start already
I think I will start playing with that idea more
n
Also true, but I feel that #C05V42SU8DP would want to check more than just file existence
m
yeah, but you have to start somewhere
👍 1
Thanks @Gregor Sturm for the inspiration
n
True! We can also improve nf-test now so nothing we cannot overcome 😛
m
ok #C09MLN67BQU ASSEMBLE
extreme teamwork 2
r
• somehow modify nf-test such that it supports seqera platform as a backend to submit the pipeline runs. Maybe this is already possible, by adding the corresponding config options to nextflow. Just the pipeline wouldn't be triggered via seqera platform API, but it would be a local nextflow run that can be monitored on seqera platform.
for this would the target nf-core pipeline be submitted from this wrapper? I am wondering, because then the GHA would need to stay alive the whole test run, right?
love the idea. Definitely long overdue
g
how is it currently handled? I.e. when does the AWS full test switch to green?
r
when it submitted successfully. The passing of the tests needs to be checked in platform/nf-core website/ there is a slack channel somewhere that gets notifications. We recently talked about each pipeline sending a notification to it's own channel because people forget to check the platform submission. Historically this stems from a limitation of github actions runner when we were time limited by 6(?)h but a lot of pipelines having full size tests that run longer than that. Maybe with the self-hosted runners we could leave the instance up and check for the status. but I don't know how costly/practical that would be 💸
g
I see. I guess it would be more practical for the pipeline post run hook to trigger a github action run. Need to figure out the details, but I'm quite sure it's possible.
ok, a really dumb way of doing that would be to implement a nextflow process that runs
aws s3 cp <pipeline result> .
and test that with nf-test. Should work in principle, no? If such a prototype is successful, we could request the nf-test team to add a new directive for testing folders without running nextflow code, such as
Copy code
folder { 
  path "./s3_download"
  test(
     assert path("output.fastq.gz").md5 == "4a17df7a54b41a84df492da3f1bab1e3"
  )
}
a
I was also thinking in line with making use of Seqera's post-run script. After the AWS full size tests are triggered, then have a post-run script that checks the published s3 file hashes to the previous release snapshot/manifest or something like that.
👍 2
g
Yeah, the question is if we'd implement that functionality ourselves, or rely on nf-test/pytest-workflow for the checks. I think initially it'll be trivial to implement checksum checks ourselves, but as checksums tend to be not always stable, we'd end up implementing all the nice comparisons such as "contains", "number of lines", "size". And that doesn't even consider the file-type specific plugins nf-test supports by now: https://plugins.nf-test.com/