Closed gagnonanthony closed 5 months ago
Thanks @AlexVCaron ! Yes, the tests passed locally. I think once we figure out the actions/etc., the switch between pytest and nf-test will be fairly easy.
Thanks @AlexVCaron ! Yes, the tests passed locally. I think once we figure out the actions/etc., the switch between pytest and nf-test will be fairly easy.
I'm super happy ! I'll give a look on the action framework, make sure everything is run correctly, with the right workflow versions. There may be something to modify in the checks.yml
workflow, it think the nf-test
modules are not fetched in the failing-modules
step.
Yeah, that's exactly what I was looking at! I'll go through the nf-core/modules
repo to see what they are doing over there.
Update: I've added the fetching of nf-test
modules and a separate workflow to test them (to avoid using pytest
when it is an nf-test
module). That way, it shouldn't mess up other modules that are still using pytest
. Two minor issues: nf-test
action isn't set up in the workflow, not sure why and the module's linting requires the environment-schema.json which I added, but can't be used until the PR is merged. @AlexVCaron, I'm not sure the environment.yml file is really necessary in our case since we do not really use environments, should we just remove it?
You're a rockstar :metal: I'll add the schema for the environment
file to the main
, I'll keep you updated. Also, I opened an issues for the setup
action for nf-test
, waiting on it, it'll fix the current test step failure !
Waiting on nf-core/setup-nf-test#6
I trickled a bit in the action. Can you try AlexVCaron/setup-nf-test@main
instead of the one from nf-core
, see if it fixes our problem ?
Done, seems like it returned a different error message this time: Error: File not found: '/home/runner/_work/_actions/AlexVCaron/setup-nf-test/main/dist/index.js'
Allright. The setup-nf-test
action is working correctly. The environment-schema
file is also available on the main
. There seems to still be a problem with the testing. It doesn't look like the tests are run inside the docker container, even with the PROFILE=docker
supplied to nf-test
. Is there a missing configuration ?
This is the first attempt to migrate a module from the pytest framework to nf-test. Here is a list of changes made to make it work:
Configs (@AlexVCaron feel free to make changes to how I did things, it sure isn't perfect!):
nf-test.config
file in the root directory.nf-test.config
file intests/config/
specifying the profiles, parameters, etc. (similar to thenextflow.config
file).nf-test
installation in the Dockerfile.nf-core
to the latest version (2.13.1
).false
. Having it totrue
made nf-test fetching the nf-core template as a test to run which was falling each time.nf-test
testing section to thetest_modules.yml
GitHub action (not sure if it works as is). UPDATE: nf-test setup action isn't authorized to be used in workflows.Steps to convert pytest to nf-test (@ThoumyreStanislas I'll make it cleaner so you can add it to the workflow doc soon.):
environment.yml
file within the module's folder. The conversion crashes if this file isn't available.nf-core modules create --migrate-pytest <tool/subtool>
and fill out the prompts.main.nf.test
file with the one in your previous test file. Those inputs are positional, so it is mandatory to keep the structureinput[0] = file(...
.nf-core modules --git-remote https://github.com/scilus/nf-scil.git test segmentation/fastseg
. In the latestnf-core
, using--git-remote
solves the previous issue of the hardcoded nf-core directory structure.114 #116 #117