Skip to content

Commit 22e6b16

Browse files
authored
Update codecoverage config (#1209)
1 parent 32582be commit 22e6b16

File tree

3 files changed

+21
-18
lines changed

3 files changed

+21
-18
lines changed

.buildkite/pipeline.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
env:
22
SEGMENT_CONTEXTS: 'snyk,npm,aws-credentials,ecr,npm-publish'
33
SEGMENT_BUILDKITE_IMAGE: 'analytics-next-ci-agent'
4+
COVERAGE: true
45
steps:
56
- label: Log Environment
67
agents:
@@ -32,6 +33,9 @@ steps:
3233
key: browser-lint-test
3334
agents:
3435
queue: v1
36+
env:
37+
SEGMENT_CODECOV_FLAGS: 'browser'
38+
SEGMENT_CODECOV_ARGS: '--dir=./packages/browser/coverage'
3539
commands:
3640
- npm config set "//registry.npmjs.org/:_authToken" $${NPM_TOKEN}
3741
- echo "--- Install dependencies"
@@ -48,9 +52,7 @@ steps:
4852
agents:
4953
queue: v1
5054
env:
51-
SEGMENT_CODECOV_FLAGS: 'browser'
52-
SEGMENT_CODECOV_ARGS: '--dir=./packages/browser/coverage'
53-
COVERAGE: true
55+
COVERAGE: false
5456
commands:
5557
- npm config set "//registry.npmjs.org/:_authToken" $${NPM_TOKEN}
5658
- echo "--- Install dependencies"
@@ -70,6 +72,8 @@ steps:
7072
key: browser-integ
7173
agents:
7274
queue: v1
75+
env:
76+
COVERAGE: false
7377
commands:
7478
- echo "--- Install dependencies"
7579
- PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 yarn install --immutable
@@ -89,7 +93,6 @@ steps:
8993
env:
9094
SEGMENT_CODECOV_FLAGS: 'core'
9195
SEGMENT_CODECOV_ARGS: '--dir=./packages/core/coverage'
92-
COVERAGE: true
9396
agents:
9497
queue: v1
9598
commands:
@@ -163,6 +166,8 @@ steps:
163166
key: destinations
164167
agents:
165168
queue: v1
169+
env:
170+
COVERAGE: false
166171
commands:
167172
- npm config set "//registry.npmjs.org/:_authToken" $${NPM_TOKEN}
168173
- echo "--- Install dependencies"

packages/browser/Makefile

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,21 @@ test-unit: node_modules ## Runs unit tests
3535
$(yarn_run) test
3636
.PHONY: test-unit
3737

38-
test-coverage: node_modules ## Runs unit tests with coverage
39-
$(yarn_run) test --coverage --forceExit
40-
.PHONY: test-coverage
41-
4238
test-qa: build-browser ## Runs all QA tests in a single command
43-
$(yarn_run) test --runTestsByPath qa/__tests__/*.test.ts --testPathIgnorePatterns qa/__tests__/destinations.test.ts --reporters="default" --reporters="<rootDir>/qa/lib/jest-reporter.js" ${args}
44-
.PHONY: test-coverage
39+
COVERAGE=false $(yarn_run) test --runTestsByPath qa/__tests__/*.test.ts --testPathIgnorePatterns qa/__tests__/destinations.test.ts --reporters="default" --reporters="<rootDir>/qa/lib/jest-reporter.js" ${args}
40+
.PHONY: test-qa
4541

4642
test-qa-destinations: build-browser ## Runs Destination QA tests. options. DESTINATION=amplitude DEBUG=true
47-
$(yarn_run) test --forceExit --runTestsByPath qa/__tests__/destinations.test.ts --reporters="default" --reporters="<rootDir>/qa/lib/jest-reporter.js" ${args}
48-
.PHONY: test-coverage
43+
COVERAGE=false $(yarn_run) test --forceExit --runTestsByPath qa/__tests__/destinations.test.ts --reporters="default" --reporters="<rootDir>/qa/lib/jest-reporter.js" ${args}
44+
.PHONY: test-qa-destinations
4945

5046
test-integration: build ## Runs all integration tests in a single command
51-
$(yarn_run) test --forceExit --runTestsByPath e2e-tests/**/*.test.ts ${args}
52-
.PHONY: test-coverage
47+
COVERAGE=false $(yarn_run) test --forceExit --runTestsByPath e2e-tests/**/*.test.ts ${args}
48+
.PHONY: test-integration
5349

5450
test-perf: build ## Runs all integration tests in a single command
5551
$(yarn_run) test --forceExit --runTestsByPath e2e-tests/performance/*.test.ts ${args}
56-
.PHONY: test-coverage
52+
.PHONY: test-perf
5753

5854
lint: node_modules ## Lints the source code
5955
$(yarn_run) lint

packages/config/src/jest/config.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@ const createJestTSConfig = (
2525
...(process.env.COVERAGE === 'true'
2626
? {
2727
collectCoverage: true,
28-
coverageReporters: ['json'],
28+
coverageReporters: ['json', 'text'],
2929
collectCoverageFrom: [
3030
'src/**/*.{js,jsx,ts,tsx}',
3131
'!src/**/*.test.{js,jsx,ts,tsx}',
32-
// Exclude test files "!src/**/index.{js,ts}",
33-
// Exclude index files
32+
'!src/**/__tests__/**',
33+
'!**/test*/**',
34+
'!**/e2e-tests/**',
35+
'!**/qa/**',
3436
],
3537
coverageDirectory: '<rootDir>/coverage',
3638
}

0 commit comments

Comments
 (0)