mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-09-19 23:21:46 +03:00
create and upload individual and combined junit reports (#16149)
* create and upload individual and combined junit reports * sudo * debug * fixup * fixup * data vs. results * debug * pretty format xml * try again on formatting * Update test.yml * blah * yq * again * swap * Revert "debug" This reverts commitea6f7447c3
. * Revert "debug" This reverts commite0d1f64d33
. * tidy
This commit is contained in:
parent
0dde80b89a
commit
0c525f6169
9
.github/workflows/test-single.yml
vendored
9
.github/workflows/test-single.yml
vendored
@ -221,12 +221,19 @@ jobs:
|
||||
env:
|
||||
ENABLE_PYTEST_MONITOR: ${{ matrix.os.matrix == 'ubuntu' && matrix.configuration.enable_pytest_monitor || '' }}
|
||||
run: |
|
||||
pytest --cov=chia --cov=tests --cov-config=.coveragerc --cov-report= --durations=10 ${{ matrix.configuration.pytest_parallel_args[matrix.os.matrix] }} -m "not benchmark" ${{ env.ENABLE_PYTEST_MONITOR }} ${{ matrix.configuration.test_files }}
|
||||
pytest --cov=chia --cov=tests --cov-config=.coveragerc --cov-report= -o 'junit_suite_name=${{ env.JOB_FILE_NAME }}' --junitxml=junit-data/junit.${{ env.JOB_FILE_NAME }}.xml --durations=10 ${{ matrix.configuration.pytest_parallel_args[matrix.os.matrix] }} -m "not benchmark" ${{ env.ENABLE_PYTEST_MONITOR }} ${{ matrix.configuration.test_files }}
|
||||
|
||||
- name: Move back to chia/ for coverage
|
||||
run: |
|
||||
mv notchia/ chia/
|
||||
|
||||
- name: Publish JUnit results
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: junit-data
|
||||
path: junit-data/*
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
|
31
.github/workflows/test.yml
vendored
31
.github/workflows/test.yml
vendored
@ -116,6 +116,37 @@ jobs:
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Download Results
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: junit-data
|
||||
path: junit-data
|
||||
|
||||
- name: Format JUnit data and prepare results
|
||||
run: |
|
||||
sudo snap install yq
|
||||
ls junit-data/*.xml | xargs --max-procs=10 --replace={} yq eval '.testsuites.testsuite.testcase |= sort_by(.+@classname, .+@name)' --inplace {}
|
||||
|
||||
sudo apt-get install junitparser
|
||||
mkdir junit-results
|
||||
junitparser merge junit-data/*.xml junit-results/junit.xml
|
||||
ls junit-results/*.xml | xargs --max-procs=10 --replace={} yq eval '.testsuites.testsuite |= sort_by(.+@name) | .testsuites.testsuite[].testcase |= sort_by(.+@classname, .+@name)' --inplace {}
|
||||
|
||||
- name: Publish formatted JUnit data
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: junit-data
|
||||
path: junit-data/*
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Publish JUnit results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: junit-results
|
||||
path: junit-results/*
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Download Coverage
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
|
Loading…
Reference in New Issue
Block a user