-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTaskfile.yml
179 lines (150 loc) · 5.51 KB
/
Taskfile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
version: "3"
dotenv: [".env"]
tasks:
install:
desc: >-
Install the project using poetry (including dependencies and git hooks).
cmds:
- poetry install
- pre-commit install
format-check:
desc: >-
Check code formatting using ruff.
cmds:
- ruff format --diff --check .
format:
desc: >-
Format code using ruff.
cmds:
- ruff format .
lint:
desc: >-
Run linting using ruff.
summary: |
Run linting using ruff.
This will check the code using the ruff linter.
If the `FIX` environment variable is set to "true", the linter will attempt to fix the issues.
If the `UNSAFE_FIXES` environment variable is set to "true", the linter will attempt to fix the issues using unsafe fixes.
vars:
FIX: '{{ .FIX | default "false" }}'
UNSAFE_FIXES: '{{ .UNSAFE_FIXES | default "false" }}'
cmds:
- ruff check src tests
{{ if eq .FIX "true" }}
--fix
{{end}}
{{ if eq .UNSAFE_FIXES "true" }}
--unsafe-fixes
{{end}}
typecheck:
desc: >-
Run type checking using mypy.
cmds:
- mypy --ignore-missing-imports --install-types --non-interactive src tests
test:
desc: |-
Run tests using pytest with the default flags defined in pyproject.toml.
cmds:
- pytest tests {{ .CLI_ARGS }}
test-workflow:
desc: >-
Run workflow tests using pytest.
cmds:
- pytest tests -m "workflow_test and not external_workflow_test" {{ .CLI_ARGS }}
test-workflow-external:
desc: >-
Run external workflow tests using pytest.
summary: |
Run external workflow tests using pytest.
This will run the tests marked with the `external_workflow_test` marker using pytest.
These tests can take a very long time to run and require input data to be available in a fixed location.
External workflow test are not included in the `test-all` task.
cmds:
- pytest tests -m external_workflow_test
test-web:
desc: >-
Run web tests using pytest.
cmds:
- pytest tests -m web_test {{ .CLI_ARGS }}
test-all:
desc: >-
Run all tests using pytest.
deps:
- test
- test-workflow
- test-web
test-watch:
desc: >-
Run tests using pytest anytime you save a file.
summary: Run tests using pytest every time a file changes.
This will run the tests using pytest in a watch loop. The tests will be re-run
whenever a file changes.
The `MARKS` environment variable can be used to filter the tests using pytest marks.
The `TEST_PATH` environment variable can be used to specify the path to the tests.
The default is to run all unit tests in `tests/`
vars:
MARKS: '{{ .MARKS | default "" }}'
TEST_PATH: '{{ .TEST_PATH | default "tests/" }}'
cmds:
- ptw -- {{ .TEST_PATH }} {{ .MARKS }}
test-benchmark:
desc: >-
Run only the benchmark tests using pytest.
cmds:
- pytest --benchmark-enable --benchmark-only tests/ {{ .CLI_ARGS }}
coverage:
desc: >-
Run tests using pytest and generate a coverage report.
summary: |
Run tests using pytest and generate a coverage report.
This will run the tests using pytest and generate a coverage report.
The coverage report will be output to the terminal.
The `WORKFLOW_TEST` environment variable can be set to "true" to run
the workflow tests as well. This will include the tests marked with the
`workflow_test` marker (but not the `external_workflow_test` marker).
This is disabled by default to reduce the runtime.
sources:
- src/**
- tests/**
- pyproject.toml
- poetry.lock
vars:
WORKFLOW_TEST: '{{ .WORKFLOW_TEST | default "false" }}'
cmds:
- 'coverage run --source src -m pytest
{{ if eq .WORKFLOW_TEST "true" }}
-m "not external_workflow_test and not web_test"
{{else}}
-m "not workflow_test and not web_test"
{{end}}'
- coverage report
test-nf-core-pixelator:
desc: >-
Run the default nf-core/pixelator test profile with this version of pixelator.
summary: |
Run the default nf-core/pixelator test profile with this version of pixelator.
If the pipeline is not found in the directory `PIPELINE_SOURCE_DIR`, it will be cloned
from the PixelgenTechnologies/nf-core-pixelator repository using the `PIPELINE_BRANCH` branch.
By default the "pixelator-next" branch of nf-core-pixelator will be used.
If the `PIPELINE_SOURCE_DIR` exists this task will assume that the pipeline is already present and checked out
in the right branch.
Note that the current dev version of pixelator must be installed and available in the PATH.
If the `RESUME` environment variable is set to "true", the pipeline will be resumed if it was previously run.
dir: "{{ .USER_WORKING_DIR }}"
vars:
RESUME: '{{ .RESUME | default "false" }}'
PIPELINE_BRANCH: '{{ .PIPELINE_BRANCH | default "pixelator-next" }}'
PIPELINE_SOURCE_DIR: '{{ .PIPELINE_SOURCE_DIR | default ".nf-core-pixelator-{{ .BRANCH }}" }}'
cmds:
- task: tests:pull-nf-core-pixelator
vars:
{
PIPELINE_BRANCH: "{{ .PIPELINE_BRANCH }}",
PIPELINE_SOURCE_DIR: "{{ .PIPELINE_SOURCE_DIR }}",
}
- task: tests:run-nf-core-pixelator-test-profile
vars: { PIPELINE_SOURCE_DIR: "{{ .PIPELINE_SOURCE_DIR }}" }
includes:
tests:
taskfile: ./tests/Taskfile.yml
dir: ./tests