Skip to content

Commit d76aa06

Browse files
committed
chore(tests): add a slow marker
1 parent d27d700 commit d76aa06

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

Taskfile.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,19 @@ tasks:
7676

7777
unit-test:
7878
desc: Run the unit tests
79+
vars:
80+
# If CLI_ARGS are set, append them as an "and" after the -m unit
81+
MARK_EXPR: unit{{if .CLI_ARGS}} and {{.CLI_ARGS}}{{end}}
7982
cmds:
80-
- '{{.RUN_SCRIPT}} pytest --keep-baked-projects -m unit tests/'
83+
- '{{.RUN_SCRIPT}} pytest --keep-baked-projects -m "{{.MARK_EXPR}}" tests/'
8184

8285
integration-test:
8386
desc: Run the integration tests
87+
vars:
88+
# If CLI_ARGS are set, append them as an "and" after the -m integration
89+
MARK_EXPR: integration{{if .CLI_ARGS}} and {{.CLI_ARGS}}{{end}}
8490
cmds:
85-
- '{{.RUN_SCRIPT}} pytest --keep-baked-projects -m integration tests/'
91+
- '{{.RUN_SCRIPT}} pytest --keep-baked-projects -m "{{.MARK_EXPR}}" tests/'
8692

8793
update:
8894
desc: Update the project dev and runtime dependencies

{{cookiecutter.project_name|replace(" ", "")}}/Taskfile.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,17 +164,23 @@ tasks:
164164
unit-test:
165165
desc: Run the project unit tests
166166
deps: ["coverage-erase"]
167+
vars:
168+
# If CLI_ARGS are set, append them as an "and" after the -m unit
169+
MARK_EXPR: unit{{ '{{if .CLI_ARGS}}' }} and {{ '{{.CLI_ARGS}}{{end}}' }}
167170
cmds:
168-
- '{{ '{{.RUN_SCRIPT}}' }} pytest -m unit tests/'
171+
- '{{ '{{.RUN_SCRIPT}}' }} pytest -m "{{ '{{.MARK_EXPR}}' }}" tests/'
169172

170173
integration-test:
171174
desc: Run the project integration tests
172175
deps: ["coverage-erase"]
176+
vars:
177+
# If CLI_ARGS are set, append them as an "and" after the -m integration
178+
MARK_EXPR: integration{{ '{{if .CLI_ARGS}}' }} and {{ '{{.CLI_ARGS}}{{end}}' }}
173179
status:
174180
# Only run integration tests when the PLATFORM is set to all or the same platform as we're running on
175181
- '{{ '{{if or (eq .PLATFORM "all") (eq .PLATFORM .LOCAL_PLATFORM) (not .PLATFORM)}}' }}exit 1{{ '{{else}}' }}exit 0{{ '{{end}}' }}'
176182
cmds:
177-
- '{{ '{{.RUN_SCRIPT}}' }} pytest -m integration tests/'
183+
- '{{ '{{.RUN_SCRIPT}}' }} pytest -m "{{ '{{.MARK_EXPR}}' }}" tests/'
178184

179185
update:
180186
desc: Update the project dev and runtime dependencies

0 commit comments

Comments
 (0)