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

Bump test coverage to 20% #418

Merged
merged 43 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
5cb3977
Set up a dockerfile that can run tests
alneberg Nov 7, 2023
5542e32
Changed command for running tests in readme
alneberg Nov 7, 2023
5e77e96
Added gitlens to devcontainer
alneberg Dec 4, 2023
8b847da
Updated dockerfile
alneberg Dec 4, 2023
0f9aa82
Updated minimal test config to match removal of port
alneberg Dec 4, 2023
eb7557b
Updated test_utils to make tests pass
alneberg Dec 4, 2023
e0a41bb
New rsync command and samplesheet location for miseq
alneberg Dec 11, 2023
401f92f
Update in flowcellparser to replace NaN with 0
alneberg Dec 11, 2023
e41e0dc
CopyComplete needed in test data as well to indicate sequencing done
alneberg Dec 11, 2023
a2ff964
Update to send mail signature
alneberg Dec 11, 2023
855e636
Updates to how demultiplexing is called
alneberg Dec 11, 2023
1371a92
Add copycomplete to hiseqX as well
alneberg Dec 11, 2023
cbb96eb
Moved samplesheet location
alneberg Dec 11, 2023
f1dde79
Stderr output from bcl2fastq for testing
alneberg Dec 12, 2023
d9da3f2
Broadly updating tests
alneberg Dec 12, 2023
8cbb12d
Started fixing the ONT tests
alneberg Dec 20, 2023
c589b42
Merge remote-tracking branch 'alneberg/container' into tests
kedhammar Feb 12, 2024
71f5f36
improve docs, add debugging
kedhammar Feb 12, 2024
15e38ce
try reorganizing tests dir structure
kedhammar Feb 12, 2024
16fc940
more reorganizing ._.
kedhammar Feb 12, 2024
0697eda
segregate old and new tests
kedhammar Feb 12, 2024
c8b0251
clarify names
kedhammar Feb 12, 2024
d4f4ba9
expand testing fixture
kedhammar Feb 12, 2024
400f591
start working on illumina tests
kedhammar Feb 12, 2024
ac150ed
reset file to Johannes latest
kedhammar Feb 12, 2024
c0d8044
annotate source code
kedhammar Feb 12, 2024
560acfe
wip
kedhammar Feb 12, 2024
377afd1
try adding test RunParameters.xml
kedhammar Feb 12, 2024
1f52b1c
set up run parameter parsing
kedhammar Feb 12, 2024
fac4228
overwrite dir if it exists
kedhammar Feb 13, 2024
0411c50
add NovaSeqXPlus samplesheets dir
kedhammar Feb 13, 2024
17249b5
improve docs, put run ss in external dir
kedhammar Feb 13, 2024
1a6e545
add indexes
kedhammar Feb 13, 2024
d1524b1
fix docs
kedhammar Feb 13, 2024
ff8a329
IT'S ALIVE
kedhammar Feb 29, 2024
11eece7
formatting
kedhammar Feb 29, 2024
e6fd2e3
bump versionlog
kedhammar Feb 29, 2024
8479475
don't lint old tests, underscore unused variable
kedhammar Feb 29, 2024
9c6c5e1
fix prettier errors
kedhammar Feb 29, 2024
a55a93d
only use pipreqs to check requirements of taca, not tests
kedhammar Feb 29, 2024
1e65f46
rm sphinx-rtd-theme from reqs, already in dev-reqs
kedhammar Feb 29, 2024
e689454
fix typo
kedhammar Feb 29, 2024
2990971
remove accidentally duplicated dir
kedhammar Feb 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerfile": "../Dockerfile"
"dockerfile": "../Dockerfile",
"target": "base"
},
"features": {},
"customizations": {
"vscode": {
"extensions": ["ms-python.python"]
"extensions": ["ms-python.python", "eamodio.gitlens"]
}
},
// Features to add to the dev container. More info: https://containers.dev/features.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
run: pip install -r requirements.txt

- name: Run pipreqs
run: pipreqs --savepath pipreqs.txt
run: pipreqs --savepath pipreqs.txt taca

- name: Compare requirements
run: |
Expand Down
15 changes: 10 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
FROM python:3.10
FROM python:3.10 AS base

# Update pip to latest version
RUN python -m pip install --upgrade pip


# Install Nextflow dependencies
# Install dependencies
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y git \
&& apt-get install -y curl
&& apt-get install -y curl \
&& apt-get install -y rsync

# Needed to install requirements,
# in devcontainer a local mounted version of flowcell_parser is used
Expand All @@ -25,3 +24,9 @@ RUN python -m pip install -r requirements-dev.txt

RUN mkdir /root/.taca/
COPY tests/data/taca_test_cfg.yaml /root/.taca/taca.yaml

FROM base AS testing
COPY . /taca
RUN python -m pip install -e /taca
WORKDIR /taca/tests
CMD ["python", "-m", "unittest"]
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@

This package contains several tools for projects and data management in the [National Genomics Infrastructure](https://ngisweden.scilifelab.se/) in Stockholm, Sweden.

### Run tests in docker

```shell
git clone https://github.com/SciLifeLab/TACA.git
cd TACA
docker build -t taca_testing --target testing .
docker run -it taca_testing
```

## Installation

Inside the repo, run `pip install .`
Expand Down
4 changes: 4 additions & 0 deletions VERSIONLOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# TACA Version Log

## 20240229.1

Increase test coverage to 20%.

## 20240209.1

Implement CodeCoverage in CI.
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ title = "taca"

# === LINTING ================================================================

[tool.ruff]
exclude = ["tests_old/**"]

[tool.ruff.lint]
select = [
# Ruff default rules
Expand Down Expand Up @@ -34,7 +37,7 @@ filterwarnings = [
'ignore::DeprecationWarning:couchdb.*',
'ignore::DeprecationWarning:pkg_resources.*',
]
addopts = "--cov=./taca --cov-report term-missing -vv --cache-clear tests/pytest/"
addopts = "--cov=./taca --cov-report term-missing -vv --cache-clear tests/"

[tool.coverage.run]
# The comment "# pragma: no cover" can be used to exclude a line from coverage
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ pandas
python_crontab
python_dateutil
setuptools
sphinx_rtd_theme
11 changes: 4 additions & 7 deletions taca/analysis/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,11 @@
logger = logging.getLogger(__name__)


def get_runObj(run, software):
def get_runObj(
run: os.PathLike, software: str
) -> MiSeq_Run | NextSeq_Run | NovaSeq_Run | NovaSeqXPlus_Run | None:
"""Tries to read runParameters.xml to parse the type of sequencer
and then return the respective Run object (MiSeq, HiSeq..)

:param run: run name identifier
:type run: string
:returns: returns the sequencer type object,
None if the sequencer type is unknown of there was an error
and then return the respective Run object (MiSeq, HiSeq..)
"""

if os.path.exists(os.path.join(run, "runParameters.xml")):
Expand Down
File renamed without changes.
Loading
Loading