Add test pipeline step and a basic test
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
stages:
|
||||
- lint
|
||||
- test
|
||||
- build
|
||||
- deploy
|
||||
|
||||
@@ -11,17 +12,24 @@ stages:
|
||||
|
||||
.base:
|
||||
image: python:3.11.2
|
||||
only:
|
||||
changes:
|
||||
- "/poetry.lock"
|
||||
- "/pyproject.toml"
|
||||
- "/app/*"
|
||||
|
||||
.test:
|
||||
extends: .base
|
||||
stage: test
|
||||
before_script:
|
||||
- *install-deps
|
||||
|
||||
.lint:
|
||||
extends: .base
|
||||
stage: lint
|
||||
before_script:
|
||||
- *install-deps
|
||||
only:
|
||||
changes:
|
||||
- "/poetry.lock"
|
||||
- "/pyproject.toml"
|
||||
- "/app/*"
|
||||
|
||||
######################################
|
||||
# #
|
||||
# LINT STEPS #
|
||||
@@ -38,6 +46,18 @@ isort:
|
||||
script:
|
||||
- poetry run isort --check .
|
||||
|
||||
######################################
|
||||
# #
|
||||
# TEST STEPS #
|
||||
# #
|
||||
######################################
|
||||
|
||||
test:
|
||||
extends: .test
|
||||
coverage: '/TOTAL.*\s+(\d+\%)/'
|
||||
script:
|
||||
- poetry run pytest --cov -v
|
||||
|
||||
######################################
|
||||
# #
|
||||
# BUILD STEPS #
|
||||
|
||||
Reference in New Issue
Block a user