mirror of
https://github.com/ansible/awx.git
synced 2026-05-17 06:17:36 -02:30
🧪 Upload coverage from the rest of CI jobs (#15526)
This commit is contained in:
committed by
GitHub
parent
0a4370acf0
commit
66e7210ba4
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
codecov:
|
codecov:
|
||||||
notify:
|
notify:
|
||||||
after_n_builds: 1 # Number of test matrix+lint jobs uploading coverage
|
after_n_builds: 5 # Number of test matrix+lint jobs uploading coverage
|
||||||
wait_for_ci: false
|
wait_for_ci: false
|
||||||
|
|
||||||
require_ci_to_pass: false
|
require_ci_to_pass: false
|
||||||
|
|||||||
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -59,7 +59,6 @@ jobs:
|
|||||||
- name: Upload test coverage to Codecov
|
- name: Upload test coverage to Codecov
|
||||||
if: >-
|
if: >-
|
||||||
!cancelled()
|
!cancelled()
|
||||||
&& matrix.tests.name == 'api-test'
|
|
||||||
&& steps.make-run.outputs.cov-report-files != ''
|
&& steps.make-run.outputs.cov-report-files != ''
|
||||||
uses: codecov/codecov-action@v4
|
uses: codecov/codecov-action@v4
|
||||||
with:
|
with:
|
||||||
@@ -79,7 +78,6 @@ jobs:
|
|||||||
- name: Upload test results to Codecov
|
- name: Upload test results to Codecov
|
||||||
if: >-
|
if: >-
|
||||||
!cancelled()
|
!cancelled()
|
||||||
&& matrix.tests.name == 'api-test'
|
|
||||||
&& steps.make-run.outputs.test-result-files != ''
|
&& steps.make-run.outputs.test-result-files != ''
|
||||||
uses: codecov/test-results-action@v1
|
uses: codecov/test-results-action@v1
|
||||||
with:
|
with:
|
||||||
|
|||||||
24
Makefile
24
Makefile
@@ -327,7 +327,12 @@ swagger: reports
|
|||||||
@if [ "$(VENV_BASE)" ]; then \
|
@if [ "$(VENV_BASE)" ]; then \
|
||||||
. $(VENV_BASE)/awx/bin/activate; \
|
. $(VENV_BASE)/awx/bin/activate; \
|
||||||
fi; \
|
fi; \
|
||||||
(set -o pipefail && py.test $(PYTEST_ARGS) awx/conf/tests/functional awx/main/tests/functional/api awx/main/tests/docs | tee reports/$@.report)
|
(set -o pipefail && py.test --cov --cov-report=xml --junitxml=reports/junit.xml $(PYTEST_ARGS) awx/conf/tests/functional awx/main/tests/functional/api awx/main/tests/docs | tee reports/$@.report)
|
||||||
|
@if [ "${GITHUB_ACTIONS}" = "true" ]; \
|
||||||
|
then \
|
||||||
|
echo 'cov-report-files=reports/coverage.xml' >> "${GITHUB_OUTPUT}"; \
|
||||||
|
echo 'test-result-files=reports/junit.xml' >> "${GITHUB_OUTPUT}"; \
|
||||||
|
fi
|
||||||
|
|
||||||
check: black
|
check: black
|
||||||
|
|
||||||
@@ -361,10 +366,12 @@ test_coverage:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
test_migrations:
|
test_migrations:
|
||||||
if [ "$(VENV_BASE)" ]; then \
|
PYTHONDONTWRITEBYTECODE=1 py.test -p no:cacheprovider --migrations -m migration_test --create-db --cov=awx --cov-report=xml --junitxml=reports/junit.xml $(PYTEST_ARGS) $(TEST_DIRS)
|
||||||
. $(VENV_BASE)/awx/bin/activate; \
|
@if [ "${GITHUB_ACTIONS}" = "true" ]; \
|
||||||
fi; \
|
then \
|
||||||
PYTHONDONTWRITEBYTECODE=1 py.test -p no:cacheprovider --migrations -m migration_test $(PYTEST_ARGS) $(TEST_DIRS)
|
echo 'cov-report-files=reports/coverage.xml' >> "${GITHUB_OUTPUT}"; \
|
||||||
|
echo 'test-result-files=reports/junit.xml' >> "${GITHUB_OUTPUT}"; \
|
||||||
|
fi
|
||||||
|
|
||||||
## Runs AWX_DOCKER_CMD inside a new docker container.
|
## Runs AWX_DOCKER_CMD inside a new docker container.
|
||||||
docker-runner:
|
docker-runner:
|
||||||
@@ -377,7 +384,12 @@ test_collection:
|
|||||||
fi && \
|
fi && \
|
||||||
if ! [ -x "$(shell command -v ansible-playbook)" ]; then pip install ansible-core; fi
|
if ! [ -x "$(shell command -v ansible-playbook)" ]; then pip install ansible-core; fi
|
||||||
ansible --version
|
ansible --version
|
||||||
py.test $(COLLECTION_TEST_DIRS) -v
|
py.test $(COLLECTION_TEST_DIRS) --cov --cov-report=xml --junitxml=reports/junit.xml -v
|
||||||
|
@if [ "${GITHUB_ACTIONS}" = "true" ]; \
|
||||||
|
then \
|
||||||
|
echo 'cov-report-files=reports/coverage.xml' >> "${GITHUB_OUTPUT}"; \
|
||||||
|
echo 'test-result-files=reports/junit.xml' >> "${GITHUB_OUTPUT}"; \
|
||||||
|
fi
|
||||||
# The python path needs to be modified so that the tests can find Ansible within the container
|
# The python path needs to be modified so that the tests can find Ansible within the container
|
||||||
# First we will use anything expility set as PYTHONPATH
|
# First we will use anything expility set as PYTHONPATH
|
||||||
# Second we will load any libraries out of the virtualenv (if it's unspecified that should be ok because python should not load out of an empty directory)
|
# Second we will load any libraries out of the virtualenv (if it's unspecified that should be ok because python should not load out of an empty directory)
|
||||||
|
|||||||
Reference in New Issue
Block a user