ci(pytest): Added pytest job to run tests against build.
This CI job runs all tests in the tests/ directory. MR !2
This commit is contained in:
10
.gitignore
vendored
10
.gitignore
vendored
@ -1,3 +1,13 @@
|
|||||||
# Ignore build Directory
|
# Ignore build Directory
|
||||||
build/
|
build/
|
||||||
aux/
|
aux/
|
||||||
|
|
||||||
|
# ignore dev env
|
||||||
|
dev_env
|
||||||
|
__pycache__
|
||||||
|
|
||||||
|
# ignore junit
|
||||||
|
*.junit.xml
|
||||||
|
|
||||||
|
# ignore log files
|
||||||
|
*.log
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
stages:
|
stages:
|
||||||
- validation
|
- validation
|
||||||
- build
|
- build
|
||||||
|
- test
|
||||||
- release
|
- release
|
||||||
- publish
|
- publish
|
||||||
|
- deploy
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
GIT_SUBMODULE_STRATEGY: recursive
|
GIT_SUBMODULE_STRATEGY: recursive
|
||||||
@ -28,6 +29,37 @@ Static Pages:
|
|||||||
extends: .MKDocs_Build
|
extends: .MKDocs_Build
|
||||||
|
|
||||||
|
|
||||||
|
Unit Tests:
|
||||||
|
image: ubuntu:18.04
|
||||||
|
needs: ['Static Pages']
|
||||||
|
before_script:
|
||||||
|
- mkdir -p "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME"
|
||||||
|
- mkdir -p "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests"
|
||||||
|
- apt update
|
||||||
|
- apt install -y python3 python3-pip ca-certificates
|
||||||
|
- apt install --no-install-recommends -y chromium-chromedriver
|
||||||
|
- pip3 install --upgrade pip
|
||||||
|
- pip3 install -r test/requirements.txt
|
||||||
|
- mv "$CI_PROJECT_DIR/artifacts/build/Static Pages/build" build
|
||||||
|
script:
|
||||||
|
- pytest --junitxml=unit_test.junit.xml --tb=line -s
|
||||||
|
- cp *.junit.xml "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/"
|
||||||
|
- echo "[DEBUG] python_exit[$python_exit]"
|
||||||
|
artifacts:
|
||||||
|
expire_in: 24 hrs
|
||||||
|
when: always
|
||||||
|
paths:
|
||||||
|
- "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/*"
|
||||||
|
reports:
|
||||||
|
junit:
|
||||||
|
- "*.junit.xml"
|
||||||
|
|
||||||
|
|
||||||
|
rules:
|
||||||
|
- if: '$CI_COMMIT_BRANCH'
|
||||||
|
when: always
|
||||||
|
- when: never
|
||||||
|
|
||||||
Gitlab Release:
|
Gitlab Release:
|
||||||
extends:
|
extends:
|
||||||
- .gitlab_release
|
- .gitlab_release
|
||||||
|
5
pytest.ini
Normal file
5
pytest.ini
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
[pytest]
|
||||||
|
#junit_suite_name=Unit Test
|
||||||
|
junit_log_passing_tests=true
|
||||||
|
#enable_assertion_pass_hook=true
|
||||||
|
junit_logging=all
|
Reference in New Issue
Block a user