From 2d435cbb9b419efcdde3bc5cd8a8e799d559cea8 Mon Sep 17 00:00:00 2001 From: Dan Schultz Date: Fri, 25 Aug 2023 10:07:25 -0400 Subject: [PATCH] Ensure CI detects failing tests There is currently a bug in the `ts-jest` project [1] which causes compile failures to result in a masked failing exit code *if test coverage is being generated*. The best solution would be to patch upstream, but in lieu of that we are going to just run tests twice: once without coverage and once with coverage. Issue #457 npm run test:ci prints failures but exits success [1] https://github.com/kulshekhar/ts-jest/issues/4193 --- .github/workflows/test.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 120e4baf..c94e06c2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,7 +36,17 @@ jobs: - name: Run build run: npm run build - - name: Run all tests + - name: Run all tests (without coverage) + run: npm run test:ci -- --coverage=false + env: + PGHOST: localhost + PGPORT: 5432 + PGUSER: postgres + PGPASSWORD: postgres + AUTH_SERVER_ISSUER: https://totally-fake-server-name/realms/pdc + OPENAPI_DOCS_AUTH_CLIENT_ID: pdc-fake-client-id + + - name: Run all tests (with coverage) run: npm run test:ci env: PGHOST: localhost