Repository navigation
Add resume option - #339
LouisLeNezet wants to merge 8 commits into
Conversation
|
Hi @LouisLeNezet , it is what I also think about. Can you add the workflow.nf.test with the new compiled nf-test so it can be verify directly instead of testing only on the java abstraction ? |
|
Hi @nttg8100, I've added a test and made sure that the workflow was indeed resumed. |
I tested it locally and found no error. I think the error may come from the specific version. |
|
I've added the missing params.file initialisation for the |
|
Hi, |
mahesh-panchal
left a comment
There was a problem hiding this comment.
Claude review
I built the branch and ran it against Nextflow 26.10.3. The feature works, but I'd redesign it before merging. Three bugs come from adding a separate flag, and the new integration test can't pass.
Works
- On a pipeline test and a process test with
setup{}, run 1 showscached=0and run 2 showscached=1(cached=2for thesetup{}chain). Run 2 is faster. - A run without the flag still starts clean.
Suggested design: derive resume from options, drop the flag
Nextflow already has -resume, so I'd drop --dev-resume and have nf-test detect -resume in the test's options (from nf-test.config or a test file's options "..."). When it's present, keep the directories that make resume work.
- This removes
ITest.setDevResume, the engine and CLI plumbing,NextflowCommand.resumeandCommand.addEnvironment. - It fixes items 1 and 2 below by construction.
- Match only the exact token
-resume, not--resume, which is a pipeline parameter. - Log a debug line when it triggers.
- A shared
nf-test.configwith-resumemakes CI non-hermetic where work dirs persist, so the docs should recommend a local dev config via--config(not tested). - Anyone with
options "-resume"today gets a different directory lifecycle after this, so it needs a changelog entry.
Must fix
-
NXF_HOMEis redirected to<launchDir>/.nxf-home(NextflowCommand.java:251).
It has nothing to do with-resume. Plugins, secrets and assets are re-fetched for every test. Reproduction:plugins { id 'nf-schema@2.2.0' }withNXF_OFFLINE=true. Without the flag the test passes. With--dev-resumeit fails withPlugin with id nf-schema not found in any repository. Remove the redirect. -
-resumeis added unconditionally (NextflowCommand.java:184).
Withoptions "-resume"innf-test.configplus--dev-resume, Nextflow fails withCan only specify option -resume once. This disappears with the options-based design. -
testWorkflowDevResumecan never pass (WorkflowTest.java:224).- It asserts
std.outcontains"Stored process". In nf-test,std.outholds only the summary line, for example[SUCCESS] completed=0 failed=0 cached=1. Assertcached=is at least 1 instead. findStdOutFilereturns the firststd.outit finds under.nf-test, which may belong to another test. It should read the one for the test that was run. It also returns null when none exists, which gives a null pointer.- The
@BeforeAllto@BeforeEachchange slows the whole class. - On my machine the test also fails because the fixture's tuple input is rejected by Nextflow 26.10.3.
testRegexfails the same way on main, so that part isn't from this PR.
- It asserts
Should fix
-
Resume with
--update-snapshotcan record stale snapshots.
A task with an undeclared input (the script reads a file by path) is served from cache after the file changes. Reproduction:ext.txtchanged from v1 to v2, then--dev-resume --update-snapshotkeptv1in the snapshot. A fresh run fails withDifferent Snapshot. Reject the combination, or warn. -
setupDirectorykeeps every directory (AbstractTest.java:143).
Keeping the launch dir and work dir is needed, because<launchDir>/.nextflowholds the resume cache. Butoutput/andmeta/are kept too. Stale files inoutput/survive, soexists()-style assertions can pass on old data, andmeta/collectsnextflow.log.1rollovers. Clearoutput/andmeta/on each run. -
Docs. Add a docs note and say that results are not hermetic.
Tests to add
- Unit test: with
-resumein the options, marker files in the launch dir and work dir survivesetup(). The current unit test only covers thefalsecase. - Integration test: the fixed version of item 3.
NXF_HOMEis not overridden, withNXF_OFFLINE=true.--resume(double-dash) does not trigger resume, and-resumeappears only once on the command line.--update-snapshotcombined with-resumeis rejected or warns.- Stale
output/contents are cleared on resume. AbstractTestDevResumeTestsits inAbstractTestTest.javawith unused imports and a placeholder comment.
Nits
- Unrelated whitespace changes in
README.md,docs/installation.md,Config.javaandRunTestsCommand.java. - In
Command.javatheenvironment != nullcheck is dead. buildArgs()andexecute()both create the params file.
Not verified
- Function tests under resume.
- Shard and
--ciinteractions. - Third-party
ITestimplementers. Every implementer in the repo extendsAbstractTest. - Whether editing a test moves it to a new launch dir and loses the cache. I didn't read
getHash().
🤖 Generated with Claude Code
This is a experimental PR to answer the following problematic:
When running test we often want to rerun the test without having to download back all the input data.
Sometimes we also just want to rerun the nf-test logic and not all the nextflow processing.
This PR introduce a new flag, that would have the same concept as the
--resumeof nextflow.The aim is to not reset the test folder, and let nextflow do it's resume job by adding this flag to the execution.
I would like to go even further by putting all the input into a separate folder to allow it to be shared across test.
It is often the case that different test case use the same input file but with different configuration. This would then allow to reduce the memory used.
What do you think ?