Skip to content

Commit

Permalink
ci(host_tests): Migrate from unittest to pytest
Browse files Browse the repository at this point in the history
Closes #747
  • Loading branch information
radimkarnis committed Oct 25, 2022
1 parent 52278a9 commit 40e6afd
Show file tree
Hide file tree
Showing 8 changed files with 330 additions and 409 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/test_esptool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:
run: |
python setup.py build
pip install --extra-index-url https://dl.espressif.com/pypi -e .[dev]
python test/test_imagegen.py
python test/test_espsecure.py
python test/test_merge_bin.py
python test/test_image_info.py
python test/test_modules.py
pytest test/test_imagegen.py
pytest test/test_espsecure.py
pytest test/test_merge_bin.py
pytest test/test_image_info.py
pytest test/test_modules.py
- name: Check the installed versions can run
run: |
Expand Down
17 changes: 11 additions & 6 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,13 @@ host_tests:
variables:
PYTHONPATH: "$PYTHONPATH:${CI_PROJECT_DIR}/test"
COVERAGE_PROCESS_START: "${CI_PROJECT_DIR}/test/.covconf"
PYTEST_ADDOPTS: "-sv --junitxml=test/report.xml --color=yes"
script:
- coverage run --parallel-mode ${CI_PROJECT_DIR}/test/test_imagegen.py
- coverage run --parallel-mode ${CI_PROJECT_DIR}/test/test_espsecure.py
- coverage run --parallel-mode ${CI_PROJECT_DIR}/test/test_merge_bin.py
- coverage run --parallel-mode ${CI_PROJECT_DIR}/test/test_image_info.py
- coverage run --parallel-mode ${CI_PROJECT_DIR}/test/test_modules.py
- coverage run --parallel-mode -m pytest ${CI_PROJECT_DIR}/test/test_imagegen.py
- coverage run --parallel-mode -m pytest ${CI_PROJECT_DIR}/test/test_espsecure.py
- coverage run --parallel-mode -m pytest ${CI_PROJECT_DIR}/test/test_merge_bin.py
- coverage run --parallel-mode -m pytest ${CI_PROJECT_DIR}/test/test_image_info.py
- coverage run --parallel-mode -m pytest ${CI_PROJECT_DIR}/test/test_modules.py
- coverage run --parallel-mode ${CI_PROJECT_DIR}/test/test_espefuse_host.py esp32
- coverage run --parallel-mode ${CI_PROJECT_DIR}/test/test_espefuse_host.py esp32c2
- coverage run --parallel-mode ${CI_PROJECT_DIR}/test/test_espefuse_host.py esp32c3
Expand Down Expand Up @@ -98,6 +99,8 @@ check_python_style:
check_install_coverage:
<<: *test_template
artifacts:
reports:
junit: test/report.xml
when: always
paths:
- "**/.coverage*"
Expand Down Expand Up @@ -271,7 +274,9 @@ combine_reports:
- host_test
artifacts:
reports:
cobertura: cobertura_report.xml
coverage_report:
coverage_format: cobertura
path: cobertura_report.xml
when: always
paths:
- ".coverage*"
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def find_version(*file_paths):
"coverage~=6.0",
"black",
"pre-commit",
"pytest",
],
},
install_requires=[
Expand Down
Loading

0 comments on commit 40e6afd

Please sign in to comment.