From 0a2b93a8c7017ca0771fd709fee879fdb65da9ec Mon Sep 17 00:00:00 2001 From: Devin Major Date: Wed, 29 Apr 2026 13:30:25 -0400 Subject: [PATCH] output the test results and coverage report as artifacts --- .gitea/workflows/run-tests.yaml | 12 +++++++++++- Development/server/jest.integration.config.js | 7 +++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/run-tests.yaml b/.gitea/workflows/run-tests.yaml index 615af2e..b85be3f 100644 --- a/.gitea/workflows/run-tests.yaml +++ b/.gitea/workflows/run-tests.yaml @@ -106,13 +106,23 @@ jobs: TEST_ENV_FILE: ./environment.test.env NODE_ENV: test MONGOMS_VERSION: 4.4.28 - run: npm run test:integration:jest -- --ci + run: | + set -o pipefail + npm run test:integration:jest -- --ci --coverage 2>&1 | tee jest-integration.log - name: Upload Jest results if: always() uses: actions/upload-artifact@v4 with: name: jest-integration-results + path: Development/server/jest-integration.log + + - name: Upload Jest coverage + if: always() + uses: actions/upload-artifact@v4 + with: + name: jest-integration-coverage + path: Development/server/coverage/integration # ══════════════════════════════════════════════════════════════════════════ # Job 2: Mocha/Chai tests – tests/ and tests/utils/ # These tests are self-contained unit tests that do not require MongoDB. diff --git a/Development/server/jest.integration.config.js b/Development/server/jest.integration.config.js index 5841a87..53d3ee3 100644 --- a/Development/server/jest.integration.config.js +++ b/Development/server/jest.integration.config.js @@ -4,6 +4,13 @@ module.exports = { testMatch: ['**/tests/integration/**/*.integration.test.js'], testEnvironment: 'node', + collectCoverageFrom: [ + 'controllers/**/*.js', + '!controllers/export.js', + '!controllers/upload_job.js', + ], + coverageDirectory: 'coverage/integration', + coverageReporters: ['text', 'lcov', 'json-summary'], // Allow extra time on first run when mongodb-memory-server downloads its binary. testTimeout: 60000, // Each test file spins up its own in-memory MongoDB instance so files can