Skip to content

Commit 7854126

Browse files
authored
Merge pull request #36 from metagenlab/unit-tests
Optimized unit tests
2 parents 6dd8f2d + e1346b2 commit 7854126

8 files changed

+17
-11
lines changed

.github/workflows/unit-tests.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,25 @@ jobs:
4949
- name: Setup apptainer
5050
uses: eWaterCycle/setup-apptainer@v2.0.0
5151

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

6059
- name: Install MeSS and pytest-cov
6160
run: |
62-
pip install -e .
61+
pip install -e .
6362
pip install pytest coverage
6463
64+
- name: Cache apptainer containers
65+
uses: actions/cache@v3
66+
with:
67+
path: .snakemake/apptainer # Cache the Apptainer containers directory
68+
key: ${{ runner.os }}-apptainer-${{ hashFiles('mess/workflow/envs/containers.yml') }}
69+
restore-keys: |
70+
${{ runner.os }}-apptainer-
6571
- name: Run tests on ${{ matrix.os }} for python ${{ matrix.python-version }}
6672
run: |
6773
coverage run -m pytest
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

mess/test_data/minimal_test.tsv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
taxon nb cov_sim sample
2-
staphylococcus_aureus 1 0.1 sample1
3-
1290 1 0.1 sample2
2+
candidatus_carsonella 1 0.1 sample1
3+
336810 1 0.1 sample2

mess/test_data/simulate_test.tsv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
fasta tax_id cov_sim sample
2-
GCF_000418345.1 1280 0.1 sample1
3-
GCF_003812505.1 1290 0.1 sample2
2+
GCF_000287275.1 1202538 0.1 sample1
3+
GCF_001447915.1 336810 0.1 sample2

mess/workflow/rules/preflight/functions.smk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def list_reads(wildcards):
4242
bam=["bam", "bam.bai"],
4343
)
4444
reads = reads + bams_ef
45-
45+
4646
return reads
4747

4848

0 commit comments

Comments
 (0)