Skip to content

Commit

Permalink
feat: add coverage generation in test CI (for dd) (#1493)
Browse files Browse the repository at this point in the history
* feat: add coverage generation in test CI (for dd)

* fix: add missing run keyword for npm script

* fix: add more heap size for ci coverage script

adding coverage makes node run out of memory if not enabled

* feat: update jest packages

* fix: jest OOM by using --runInBand

run serially, don't choke on resources
  • Loading branch information
karrui authored Oct 11, 2024
1 parent 7ea5d02 commit 9671b26
Show file tree
Hide file tree
Showing 4 changed files with 2,492 additions and 3,397 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ jobs:
languages: js
service-name: ${{ secrets.DD_SERVICE_NAME }}
api-key: ${{ secrets.DD_API_KEY }}
- run: npm test
- run: npm run test:coverage
env:
# Required to allow Datadog to trace Vitest tests
NODE_OPTIONS: -r ${{ env.DD_TRACE_PACKAGE }} --import ${{ env.DD_TRACE_ESM_IMPORT }}
NODE_OPTIONS: --max-old-space-size=4096 -r ${{ env.DD_TRACE_PACKAGE }}
gatekeep:
name: Determine if Build & Deploy is needed
outputs:
Expand Down
5 changes: 4 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/** @type {import('ts-jest').JestConfigWithTsJest} **/
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
transform: {
'^.+.tsx?$': ['ts-jest', {}],
},
moduleNameMapper: {
'^.+\\.(css)$': '<rootDir>/config/css-stub.ts',
},
Expand Down
Loading

0 comments on commit 9671b26

Please sign in to comment.