Comments (6)
This feature is now available in version 0.7.1
👉 https://code.askimed.com/nf-test/testcases/global_variables/
from nf-test.
I just realized that it does work to define params using standard groovy for nested objects, as in:
when {
params {
output_dir = "tests/results"
outer = [inner: 'value']
}
...
It's not a bad workaround, but it would be nice to have a unified syntax between Nextflow and nf-test
. I'd also still be interested in passing params as a file if that were possible.
from nf-test.
Thanks for reporting this issues and giving nf-test a try. It definitely makes sense to use the same syntax as Nextflow. 👍 We will try to fix it.
Passing params as a file is not yet supported, but we will think about it...
from nf-test.
Thanks for reporting this issues and giving nf-test a try. It definitely makes sense to use the same syntax as Nextflow. 👍 We will try to fix it.
Passing params as a file is not yet supported, but we will think about it...
We tried doing that and it is working for us:
def other_param_yaml = new FileInputStream(new File("file name"))
new Yaml().load(other_param_yaml).each { k, v -> delegate[k] = v }
from nf-test.
Thank you @Khushbu04in! I will reuse your code to create a load
function:
when {
params {
load("file name")
}
Best, lukas.
from nf-test.
Passing params from a file (json, yaml, etc) is almost a must have feature, IMO. We have big datasets we'd like to test and it would (will) be very painful to convert the json to the groovy object notation. I'm not sure of anyway to do it other than by hand.
@Khushbu04in could you share your full approach? I'm not sure how to get the data into the when {}
closure.
I can do this outside of nextflow_pipeline{}
:
slurper = new groovy.json.JsonSlurper()
params_file = new File('tests/data/params/params.json')
params_data = slurper.parseText(params_file.text)
... and it works in the sense that params_data
holds the params in groovy dotted notation.
But if I then do this:
test("Should run without failures") {
when {
params = params_data
}
I get this:
groovy.lang.MissingPropertyException: No such property: params_data for class: com.askimed.nf.test.lang.TestContext
from nf-test.
Related Issues (20)
- [feature] exclude tests by tag
- Weird behaviour when Gzipped files are empty HOT 4
- [Docs] Broken link for navigating to getting started HOT 1
- Automatic staging of `assets` `bin` and `lib` folders broken HOT 1
- Repeated 'permission denied' when running `nf-test clean` or `rm -rf .nf-test` HOT 2
- Add --target option to nf-test list HOT 2
- is there a way we can allow for deliberate snapshot matching? HOT 3
- Only run tests for changed files HOT 3
- Test file not created for workflow when workflow.onComplete is in main.nf HOT 1
- Can snapshots entries be made unique by `test-name + id` instead of just the `id` ?
- Problem when pipeline param is the same as nf-test param
- Broken link HOT 1
- bug: When an input is passed to output with no modification it causes the snapshot to have the absolute path HOT 1
- Access to output channels of unnamed/implicit workflow
- Keyword Arguments
- Allow capture and assertion of `.command.{err,out,log}`
- Conda environment reuse HOT 1
- Need the ability to skip md5 check for some files in snapshot HOT 1
- All tests' meta/output/work directories are deleted and recreated unnecessarily
- Caching of setup fixtures' results HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nf-test.