Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meta Tests #4899

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
11 changes: 11 additions & 0 deletions tests/meta/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Meta Tests

Minimal Proof of Concept to run nf-test on Tower.

Mainly for testing modules with full sized data(the stuff that really ends up breaking it) for optimization.

So we thought what if we wrap nf-test in a Nextflow process, and then let it test the module?

Then we could spin all of the tests up, and even get snapshots out of full test-data

It's a Nextflow workflow that wraps nf-test, which itself wraps Nextflow.
44 changes: 44 additions & 0 deletions tests/meta/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// TODO What if we took nf-test list?
params.module_dir = "./modules/nf-core/samtools/view"
params.repo = "../modules/"
params.nftest_config = "./tests/meta/nf-test.config"
params.nextflow_config = "./tests/meta/nf.config"


workflow {
NFTEST_MODULE (
file(params.module_dir + "/main.nf"),
file(params.module_dir + "/tests"),
file(params.nftest_config),
file(params.nextflow_config),
[], // TODO
false
)
}

process NFTEST_MODULE {
tag "$module_file"

input:
path module_file
path test_file
path nftest_config
path nextflow_config
path full_repo // optional for subworkflow
val update_snapshot

output:
path "*.snap", emit: snapshot, optional: true

script:
def snapshot = update_snapshot ? '--update-snapshot': ''
"""
# TODO cd $full_repo
nf-test test tests/*.nf.test \\
--profile docker \\
$snapshot \\
--silent \\
--verbose \\
-c $nftest_config
"""
}
13 changes: 13 additions & 0 deletions tests/meta/nf-test.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
config {
// location for all nf-tests
testsDir "."

// nf-test directory including temporary files for each test
workDir System.getenv("NFT_WORKDIR") ?: ".nf-test"

// location of an optional nextflow.config file specific for executing tests
configFile "nf.config"

// run all test with the defined docker profile from the main nextflow.config
profile ""
}
50 changes: 50 additions & 0 deletions tests/meta/nf.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
params {
publish_dir_mode = "copy"
singularity_pull_docker_container = false
test_data_base = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules'
modules_testdata_base_path = 's3://ngi-igenomes/testdata/nf-core/modules/'
}

process {
cpus = 2
memory = 3.GB
time = 2.h
}

profiles {
singularity {
singularity.enabled = true
singularity.autoMounts = true
}
conda {
conda.enabled = true
}
mamba {
conda.enabled = true
conda.useMamba = true
}
podman {
podman.enabled = true
podman.userEmulation = true
podman.runOptions = "--runtime crun --platform linux/x86_64 --systemd=always"
}
docker {
docker.enabled = true
docker.userEmulation = false
docker.runOptions = '-u $(id -u):$(id -g) --platform=linux/amd64'
}
}

docker.registry = 'quay.io'
podman.registry = 'quay.io'
singularity.registry = 'quay.io'

// Increase time available to build Conda environment
conda { createTimeout = "120 min" }

// Load test_data.config containing paths to test data
includeConfig 'https://raw.githubusercontent.com/nf-core/modules/master/tests/config/test_data.config'

manifest {
nextflowVersion = '!>=23.04.0'
}
Loading