output mocha's test results and coverage report as artifacts
This commit is contained in:
parent
a6d75af447
commit
ea46cbeb02
@ -177,14 +177,42 @@ jobs:
|
|||||||
|
|
||||||
# Run all top-level test_*.js files (skips integration/ and satloc/ sub-dirs
|
# Run all top-level test_*.js files (skips integration/ and satloc/ sub-dirs
|
||||||
# which are covered by the jest-integration job or need live connections).
|
# which are covered by the jest-integration job or need live connections).
|
||||||
- name: Run Mocha unit tests (tests/)
|
# Coverage is aggregated across this run and tests/utils/.
|
||||||
|
- name: Run Mocha unit tests with coverage
|
||||||
run: |
|
run: |
|
||||||
|
set -o pipefail
|
||||||
|
rm -rf .nyc_output coverage/mocha mocha-unit.log
|
||||||
|
|
||||||
|
npx nyc \
|
||||||
|
--silent \
|
||||||
|
--temp-dir .nyc_output \
|
||||||
npx mocha --exit --timeout 120000 \
|
npx mocha --exit --timeout 120000 \
|
||||||
--require tests/setup.js \
|
--require tests/setup.js \
|
||||||
'tests/test_*.js'
|
'tests/test_*.js' 2>&1 | tee mocha-unit.log
|
||||||
continue-on-error: false
|
|
||||||
|
|
||||||
# Run Mocha tests in tests/utils/
|
npx nyc \
|
||||||
- name: Run Mocha utility tests (tests/utils/)
|
--silent \
|
||||||
run: npm run test:utils
|
--temp-dir .nyc_output \
|
||||||
continue-on-error: false
|
--no-clean \
|
||||||
|
npm run test:utils 2>&1 | tee -a mocha-unit.log
|
||||||
|
|
||||||
|
npx nyc report \
|
||||||
|
--temp-dir .nyc_output \
|
||||||
|
--report-dir coverage/mocha \
|
||||||
|
--reporter=text \
|
||||||
|
--reporter=lcov \
|
||||||
|
--reporter=json-summary | tee -a mocha-unit.log
|
||||||
|
|
||||||
|
- name: Upload Mocha results
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: mocha-unit-results
|
||||||
|
path: Development/server/mocha-unit.log
|
||||||
|
|
||||||
|
- name: Upload Mocha coverage
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: mocha-unit-coverage
|
||||||
|
path: Development/server/coverage/mocha
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user