diff options
author | Sviatoslav Sydorenko (Святослав Сидоренко) <wk@sydorenko.org.ua> | 2024-09-13 16:46:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-13 16:46:48 +0200 |
commit | 090511e65b726d16d0d0221116dde1d52eb32abd (patch) | |
tree | d2bc39e02480d1f15db2ee695fdd2049a98044e8 /Makefile | |
parent | fix: avoid race conditions when removing multiple instance (#15495) (diff) | |
download | awx-090511e65b726d16d0d0221116dde1d52eb32abd.tar.xz awx-090511e65b726d16d0d0221116dde1d52eb32abd.zip |
🧪 Gather coverage @ CI and upload to Codecov (#15499)
Diffstat (limited to '')
-rw-r--r-- | Makefile | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -351,6 +351,15 @@ test: cd awxkit && $(VENV_BASE)/awx/bin/tox -re py3 awx-manage check_migrations --dry-run --check -n 'missing_migration_file' +## Run all API unit tests with coverage enabled. +test_coverage: + $(MAKE) test PYTEST_ARGS="--create-db --cov=awx --cov-report=xml --junitxml=reports/junit.xml" + @if [ "${GITHUB_ACTIONS}" = "true" ]; \ + then \ + echo 'cov-report-files=coverage.xml' >> "${GITHUB_OUTPUT}"; \ + echo 'test-result-files=reports/junit.xml' >> "${GITHUB_OUTPUT}"; \ + fi + test_migrations: if [ "$(VENV_BASE)" ]; then \ . $(VENV_BASE)/awx/bin/activate; \ @@ -359,7 +368,7 @@ test_migrations: ## Runs AWX_DOCKER_CMD inside a new docker container. docker-runner: - docker run -u $(shell id -u) --rm -v $(shell pwd):/awx_devel/:Z --workdir=/awx_devel $(DEVEL_IMAGE_NAME) $(AWX_DOCKER_CMD) + docker run -u $(shell id -u) --rm -v $(shell pwd):/awx_devel/:Z $(AWX_DOCKER_ARGS) --workdir=/awx_devel $(DEVEL_IMAGE_NAME) $(AWX_DOCKER_CMD) test_collection: rm -f $(shell ls -d $(VENV_BASE)/awx/lib/python* | head -n 1)/no-global-site-packages.txt @@ -414,13 +423,6 @@ test_unit: fi; \ py.test awx/main/tests/unit awx/conf/tests/unit awx/sso/tests/unit -## Run all API unit tests with coverage enabled. -test_coverage: - @if [ "$(VENV_BASE)" ]; then \ - . $(VENV_BASE)/awx/bin/activate; \ - fi; \ - py.test --create-db --cov=awx --cov-report=xml --junitxml=./reports/junit.xml $(TEST_DIRS) - ## Output test coverage as HTML (into htmlcov directory). coverage_html: coverage html |