Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
env:
COVERAGE: true
SEGMENT_CONTEXTS: 'snyk,npm,aws-credentials,ecr,npm-publish'
SEGMENT_BUILDKITE_IMAGE: 'analytics-next-ci-agent'
SEGMENT_BUILDKITE_IMAGE: 'buildkite-agent-node20'
steps:
- label: Log Environment
agents:
Expand All @@ -12,6 +13,9 @@ steps:
- echo "CI -> $CI"
- label: '[Monorepo] QA'
key: monorepo
env:
SEGMENT_CODECOV_FLAGS: 'scripts'
SEGMENT_CODECOV_ARGS: '--dir=packages/scripts/coverage'
agents:
queue: v1
commands:
Expand Down Expand Up @@ -64,6 +68,9 @@ steps:

- label: '[Browser] Integration Tests :perfection:'
key: browser-integ
env:
SEGMENT_CODECOV_FLAGS: 'browser'
SEGMENT_CODECOV_ARGS: '--dir=packages/browser/coverage'
agents:
queue: v1
commands:
Expand All @@ -82,6 +89,9 @@ steps:
paths: ['.yarn/cache/']

- label: '[Core] Lint + Test'
env:
SEGMENT_CODECOV_FLAGS: 'core'
SEGMENT_CODECOV_ARGS: '--dir=packages/core/coverage'
agents:
queue: v1
commands:
Expand Down Expand Up @@ -115,6 +125,9 @@ steps:
paths: ['.yarn/cache/']

- label: '[Consent] Lint + Test'
env:
SEGMENT_CODECOV_FLAGS: 'consent'
SEGMENT_CODECOV_ARGS: '--dir=packages/consent/coverage'
agents:
queue: v1
commands:
Expand All @@ -132,6 +145,9 @@ steps:
key: "v1.1-cache-dev-{{ checksum 'yarn.lock' }}"

- label: '[Signals] Lint + Test'
env:
SEGMENT_CODECOV_FLAGS: 'signals'
SEGMENT_CODECOV_ARGS: '--dir=packages/signals/coverage'
agents:
queue: v1
commands:
Expand Down
7 changes: 7 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
coverage:
status:
project:
default:
target: auto
threshold: 0%
base: auto
8 changes: 4 additions & 4 deletions packages/browser/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ module.exports = createJestTSConfig(__dirname, {
testEnvironment: 'jsdom',
coverageThreshold: {
global: {
branches: 80.91,
functions: 87.25,
lines: 91.03,
statements: 87.25,
branches: 74,
functions: 80,
lines: 87,
statements: 82,
},
},
})
13 changes: 13 additions & 0 deletions packages/config/src/jest/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ const createJestTSConfig = (
* No need to manually run yarn build all the time.
* This resolve packages for ts-jest so typescript compilation happens in-memory.
*/
...(process.env.COVERAGE === 'true'
? {
collectCoverage: true,
coverageReporters: ['json'],
collectCoverageFrom: [
'src/**/*.{js,jsx,ts,tsx}',
'!src/**/*.test.{js,jsx,ts,tsx}',
// Exclude test files "!src/**/index.{js,ts}",
// Exclude index files
],
coverageDirectory: '<rootDir>/coverage',
}
: {}),
moduleNameMapper: moduleMap,
preset: 'ts-jest',
modulePathIgnorePatterns: [
Expand Down
2 changes: 1 addition & 1 deletion scripts/clean.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
# Clear build artifacts and build cache

find . \( -name ".turbo" -o -name "dist" -o -name ".next" -o -name "tsconfig.tsbuildinfo" \) ! -path "*/node_modules/*" -print0 | xargs -0 rm -rf
find . \( -name ".turbo" -o -name "dist" -o -name ".next" -o -name "tsconfig.tsbuildinfo" -o -name "coverage" \) ! -path "*/node_modules/*" -print0 | xargs -0 rm -rf
rm -rf node_modules/.cache

echo "Build files and cache deleted."
Loading