Skip to content

Commit

Permalink
Merge pull request #36 from metagenlab/unit-tests
Browse files Browse the repository at this point in the history
Optimized unit tests
  • Loading branch information
farchaab authored Nov 4, 2024
2 parents 6dd8f2d + e1346b2 commit 7854126
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 11 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,25 @@ jobs:
- name: Setup apptainer
uses: eWaterCycle/[email protected]

- name: Setup MeSS environment
uses: conda-incubator/setup-miniconda@v3
- name: Setup pip
uses: actions/setup-python@v5
with:
miniforge-version: latest
activate-environment: mess
python-version: ${{ matrix.python-version }}
auto-update-conda: true
cache: "pip" # caching pip dependencies
cache-dependency-path: setup.py

- name: Install MeSS and pytest-cov
run: |
pip install -e .
pip install -e .
pip install pytest coverage
- name: Cache apptainer containers
uses: actions/cache@v3
with:
path: .snakemake/apptainer # Cache the Apptainer containers directory
key: ${{ runner.os }}-apptainer-${{ hashFiles('mess/workflow/envs/containers.yml') }}
restore-keys: |
${{ runner.os }}-apptainer-
- name: Run tests on ${{ matrix.os }} for python ${{ matrix.python-version }}
run: |
coverage run -m pytest
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions mess/test_data/minimal_test.tsv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
taxon nb cov_sim sample
staphylococcus_aureus 1 0.1 sample1
1290 1 0.1 sample2
candidatus_carsonella 1 0.1 sample1
336810 1 0.1 sample2
4 changes: 2 additions & 2 deletions mess/test_data/simulate_test.tsv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
fasta tax_id cov_sim sample
GCF_000418345.1 1280 0.1 sample1
GCF_003812505.1 1290 0.1 sample2
GCF_000287275.1 1202538 0.1 sample1
GCF_001447915.1 336810 0.1 sample2
2 changes: 1 addition & 1 deletion mess/workflow/rules/preflight/functions.smk
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def list_reads(wildcards):
bam=["bam", "bam.bai"],
)
reads = reads + bams_ef

return reads


Expand Down

0 comments on commit 7854126

Please sign in to comment.