diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3dcc0276d24837a8949d33d664186f2d19d6f475..30cd25ae40566f960137e1c36644c81068466cf3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,6 @@ before_script: - module load python/3.6.4-anaconda - - pip install --user attrs==19.1.0 pytest-pythonpath==0.7.1 pytest-cov==2.5.1 + - pip install --user attrs==20.3.0 pytest==6.2.2 pytest-pythonpath==0.7.3 pytest-cov==2.11.1 - module load singularity/3.5.3 - module load nextflow/20.01.0 - ln -sfn /project/BICF/BICF_Core/shared/gudmap/test_data/* ./test_data/ @@ -666,7 +666,7 @@ integration_se: - ulimit -a - nextflow -q run ./workflow/rna-seq.nf --deriva ./test_data/auth/credential.json --bdbag ./test_data/auth/cookies.txt --repRID 16-1ZX4 --source staging --upload true -with-dag dag.png --dev false --ci true -with-report ./SE_report.html - find . -type f -name "multiqc_data.json" -exec cp {} ./SE_multiqc_data.json \; - - pytest -m completion("SE_multiqc_data.json") + - pytest -m completionMultiqc --filename SE_multiqc_data.json artifacts: name: "$CI_JOB_NAME" when: always @@ -691,7 +691,7 @@ integration_pe: - ulimit -a - nextflow -q run ./workflow/rna-seq.nf --deriva ./test_data/auth/credential.json --bdbag ./test_data/auth/cookies.txt --repRID Q-Y5JA --source staging --upload true -with-dag dag.png --dev false --ci true -with-report ./PE_report.html - find . -type f -name "multiqc_data.json" -exec cp {} ./PE_multiqc_data.json \; - - pytest -m completion("PE_multiqc_data.json") + - pytest -m completionMultiqc --filename PE_multiqc_data.json artifacts: name: "$CI_JOB_NAME" when: always @@ -793,7 +793,7 @@ override_inputBag: - ulimit -a - nextflow -q run ./workflow/rna-seq.nf --deriva ./test_data/auth/credential.json --bdbag ./test_data/auth/cookies.txt --repRID Q-Y5F6 --source staging --inputBagForce ./test_data/bag/Q-Y5F6_inputBag_xxxxxxxx.zip --upload false --dev false --ci true -with-report ./inputBagOverride_report.html - find . -type f -name "multiqc_data.json" -exec cp {} ./inputBagOverride_PE_multiqc_data.json \; - - pytest -m completion("inputBagOverride_PE_multiqc_data.json") + - pytest -m completionMultiqc --filename inputBagOverride_PE_multiqc_data.json artifacts: name: "$CI_JOB_NAME" when: always @@ -816,7 +816,7 @@ override_fastq: - ulimit -a - nextflow -q run ./workflow/rna-seq.nf --deriva ./test_data/auth/credential.json --bdbag ./test_data/auth/cookies.txt --repRID Q-Y5F6 --source staging --fastqsForce './test_data/fastq/small/Q-Y5F6_1M.R{1,2}.fastq.gz' --upload false --dev false --ci true -with-report ./fastqOverride_report.html - find . -type f -name "multiqc_data.json" -exec cp {} ./fastqOverride_PE_multiqc_data.json \; - - pytest -m completion("fastqOverride_PE_multiqc_data.json") + - pytest -m completionMultiqc --filename fastqOverride_PE_multiqc_data.json artifacts: name: "$CI_JOB_NAME" when: always @@ -839,7 +839,7 @@ override_species: - ulimit -a - nextflow -q run ./workflow/rna-seq.nf --deriva ./test_data/auth/credential.json --bdbag ./test_data/auth/cookies.txt --repRID Q-Y5ER --source staging --speciesForce 'Homo sapiens' --upload false --dev false --ci true -with-report ./speciesOverride_report.html - find . -type f -name "multiqc_data.json" -exec cp {} ./speciesOverride_PE_multiqc_data.json \; - - pytest -m completion("speciesOverride_PE_multiqc_data.json") + - pytest -m completionMultiqc --filename speciesOverride_PE_multiqc_data.json artifacts: name: "$CI_JOB_NAME" when: always @@ -862,7 +862,7 @@ override_stranded: - ulimit -a - nextflow -q run ./workflow/rna-seq.nf --deriva ./test_data/auth/credential.json --bdbag ./test_data/auth/cookies.txt --repRID Q-Y5ER --source staging --strandedForce unstranded --upload false --dev false --ci true -with-report ./strandedOverride_report.html - find . -type f -name "multiqc_data.json" -exec cp {} ./strandedOverride_PE_multiqc_data.json \; - - pytest -m completion("strandedOverride_PE_multiqc_data.json") + - pytest -m completionMultiqc --filename strandedOverride_PE_multiqc_data.json artifacts: name: "$CI_JOB_NAME" when: always @@ -885,7 +885,7 @@ override_spike: - ulimit -a - nextflow -q run ./workflow/rna-seq.nf --deriva ./test_data/auth/credential.json --bdbag ./test_data/auth/cookies.txt --repRID Q-Y5ER --source staging --spikeForce t --upload false --dev false --ci true -with-report ./spikeOverride_report.html - find . -type f -name "multiqc_data.json" -exec cp {} ./spikeOverride_PE_multiqc_data.json \; - - pytest -m completion("spikedOverride_PE_multiqc_data.json") + - pytest -m completionMultiqc --filename spikedOverride_PE_multiqc_data.json artifacts: name: "$CI_JOB_NAME" when: always diff --git a/conftest.py b/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..289b4930cebfbe0f9850a46260c90e7d2f794d8f --- /dev/null +++ b/conftest.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +import pytest + + +def pytest_addoption(parser): + parser.addoption("--filename", action="store") + +@pytest.fixture(scope='session') +def filename(request): + filename_value = request.config.option.filename + if filename_value is None: + pytest.skip() + return filename_value \ No newline at end of file diff --git a/workflow/tests/test_completion.py b/workflow/tests/test_completion.py index 85ac430babbe104b243aa12bb0c56d9b14630e34..25a9941de634d36b84ad750c5968fa75009dfd27 100644 --- a/workflow/tests/test_completion.py +++ b/workflow/tests/test_completion.py @@ -9,8 +9,7 @@ import json test_output_path = os.path.dirname(os.path.abspath(__file__)) + \ '/../../' - -@pytest.mark.completion -def test_multiqc(file_name): +@pytest.mark.completionMultiqc +def test_multiqcExist(filename): assert os.path.exists(os.path.join( - test_output_path, file_name)) \ No newline at end of file + test_output_path, filename)) \ No newline at end of file