From 7abdf7022558a7c575272945a161ad1995ae7ed3 Mon Sep 17 00:00:00 2001 From: Michael Grosse Huelsewiesche Date: Fri, 22 Nov 2024 16:03:35 -0500 Subject: [PATCH 01/15] Add coverage upload to gh actions ci.yml --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a7db4a5a2..248ddcffc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,11 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: 'yarn' + - uses: codecov/codecov-action@v5 + with: + fail_ci_if_error: true + flags: node + token: ${{ secrets.CODECOV_TOKEN }} - run: yarn install --immutable - name: Turbo cache uses: actions/cache@v3 From 3b2f81e63bf8de7783e215d09274122db13193af Mon Sep 17 00:00:00 2001 From: Michael Grosse Huelsewiesche Date: Fri, 22 Nov 2024 16:07:48 -0500 Subject: [PATCH 02/15] Update order and coverage directory --- .github/workflows/ci.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 248ddcffc..c48409ea0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,11 +17,6 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: 'yarn' - - uses: codecov/codecov-action@v5 - with: - fail_ci_if_error: true - flags: node - token: ${{ secrets.CODECOV_TOKEN }} - run: yarn install --immutable - name: Turbo cache uses: actions/cache@v3 @@ -33,6 +28,12 @@ jobs: - run: yarn turbo run --filter='./packages/node*' lint - run: yarn turbo run --filter='./packages/node*' test - run: yarn turbo run --filter='./packages/node-integration-tests' test:perf-and-durability + - uses: codecov/codecov-action@v5 + with: + fail_ci_if_error: true + flags: node + directory: ./packages/node/coverage + token: ${{ secrets.CODECOV_TOKEN }} analytics-node-cf-workers: name: 'analytics-node QA (Cloudflare Workers)' runs-on: ubuntu-latest From b78b33eaacecad33a50771ead63e55b74dce9840 Mon Sep 17 00:00:00 2001 From: Michael Grosse Huelsewiesche Date: Fri, 22 Nov 2024 16:20:16 -0500 Subject: [PATCH 03/15] Enable coverage on test run --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c48409ea0..2f6617cdb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: restore-keys: | ${{ runner.os }}-turbo- - run: yarn turbo run --filter='./packages/node*' lint - - run: yarn turbo run --filter='./packages/node*' test + - run: COVERAGE=true yarn turbo run --filter='./packages/node*' test - run: yarn turbo run --filter='./packages/node-integration-tests' test:perf-and-durability - uses: codecov/codecov-action@v5 with: From 151b2402856a03b578ed4b3f7d07ba4b43e6a253 Mon Sep 17 00:00:00 2001 From: Michael Grosse Huelsewiesche Date: Fri, 22 Nov 2024 16:51:49 -0500 Subject: [PATCH 04/15] Testing flags and directory for buildkite pipeline --- .buildkite/pipeline.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 993722c91..426af9697 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -30,6 +30,9 @@ steps: - label: '[Browser] Lint + Test' key: browser-lint-test + env: + SEGMENT_CODECOV_FLAGS: 'browser' + SEGMENT_CODECOV_ARGS: '--dir=packages/browser/coverage' agents: queue: v1 commands: @@ -82,6 +85,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: From 726b7b0b847d607f84b02818adec7415ea528fb6 Mon Sep 17 00:00:00 2001 From: Michael Grosse Huelsewiesche Date: Fri, 22 Nov 2024 17:06:39 -0500 Subject: [PATCH 05/15] Fixing path for coverage --- .buildkite/pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 426af9697..f17b524c8 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -32,7 +32,7 @@ steps: key: browser-lint-test env: SEGMENT_CODECOV_FLAGS: 'browser' - SEGMENT_CODECOV_ARGS: '--dir=packages/browser/coverage' + SEGMENT_CODECOV_ARGS: '--dir=./packages/browser/coverage' agents: queue: v1 commands: @@ -87,7 +87,7 @@ steps: - label: '[Core] Lint + Test' env: SEGMENT_CODECOV_FLAGS: 'core' - SEGMENT_CODECOV_ARGS: '--dir=packages/core/coverage' + SEGMENT_CODECOV_ARGS: '--dir=./packages/core/coverage' agents: queue: v1 commands: From 86be3fb2f9c9964dbfb85253aea8180ea199766b Mon Sep 17 00:00:00 2001 From: Michael Grosse Huelsewiesche Date: Wed, 4 Dec 2024 16:50:47 -0500 Subject: [PATCH 06/15] Enable coverage for tests in buildkite --- .buildkite/pipeline.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index f17b524c8..2fe1f167c 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -33,6 +33,7 @@ steps: env: SEGMENT_CODECOV_FLAGS: 'browser' SEGMENT_CODECOV_ARGS: '--dir=./packages/browser/coverage' + COVERAGE: true agents: queue: v1 commands: @@ -88,6 +89,7 @@ steps: env: SEGMENT_CODECOV_FLAGS: 'core' SEGMENT_CODECOV_ARGS: '--dir=./packages/core/coverage' + COVERAGE: true agents: queue: v1 commands: From 1d6044c8cf2625e4c79f8faaa705f935ff1d7a7d Mon Sep 17 00:00:00 2001 From: Michael Grosse Huelsewiesche Date: Wed, 4 Dec 2024 17:06:19 -0500 Subject: [PATCH 07/15] Testing coverage generation --- .buildkite/pipeline.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 2fe1f167c..cc361e98e 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -41,6 +41,9 @@ steps: - echo "--- Install dependencies" - yarn install --immutable - yarn run -T browser exec make ci + - echo " ############### Are there coverage files here?" + - echo $PWD + - find . -name "coverage-*.json" plugins: - ssh://git@github.com/segmentio/cache-buildkite-plugin#v2.0.0: key: "v1.1-cache-dev-{{ checksum 'yarn.lock' }}" @@ -102,6 +105,9 @@ steps: - yarn run -T core lint - yarn run -T core test - yarn turbo run --filter=core-integration-tests lint + - echo " ############### Are there coverage files here?" + - echo $PWD + - find . -name "coverage-*.json" plugins: - ssh://git@github.com/segmentio/cache-buildkite-plugin#v2.0.0: key: "v1.1-cache-dev-{{ checksum 'yarn.lock' }}" From 36854f2c0e64a9e355f23a6a52d5f5b148c40d46 Mon Sep 17 00:00:00 2001 From: Michael Grosse Huelsewiesche Date: Wed, 4 Dec 2024 17:14:01 -0500 Subject: [PATCH 08/15] Trying another test --- .buildkite/pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index cc361e98e..9a4038b32 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -41,7 +41,7 @@ steps: - echo "--- Install dependencies" - yarn install --immutable - yarn run -T browser exec make ci - - echo " ############### Are there coverage files here?" + - echo " +++ Are there coverage files here" - echo $PWD - find . -name "coverage-*.json" plugins: @@ -105,7 +105,7 @@ steps: - yarn run -T core lint - yarn run -T core test - yarn turbo run --filter=core-integration-tests lint - - echo " ############### Are there coverage files here?" + - echo " +++ Are there coverage files here" - echo $PWD - find . -name "coverage-*.json" plugins: From 3cb18361d5f2c7112d07fab600704fd701497eee Mon Sep 17 00:00:00 2001 From: Michael Grosse Huelsewiesche Date: Wed, 4 Dec 2024 18:15:58 -0500 Subject: [PATCH 09/15] Testing... --- .buildkite/pipeline.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 9a4038b32..d0fee4ba8 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -105,9 +105,8 @@ steps: - yarn run -T core lint - yarn run -T core test - yarn turbo run --filter=core-integration-tests lint - - echo " +++ Are there coverage files here" - - echo $PWD - find . -name "coverage-*.json" + - echo $PWD plugins: - ssh://git@github.com/segmentio/cache-buildkite-plugin#v2.0.0: key: "v1.1-cache-dev-{{ checksum 'yarn.lock' }}" From ba54119a7053471ddfde0fceb712f96170a1efef Mon Sep 17 00:00:00 2001 From: Michael Grosse Huelsewiesche Date: Wed, 4 Dec 2024 19:46:40 -0500 Subject: [PATCH 10/15] Testing browser --- .buildkite/pipeline.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index d0fee4ba8..9f5710714 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -41,9 +41,8 @@ steps: - echo "--- Install dependencies" - yarn install --immutable - yarn run -T browser exec make ci - - echo " +++ Are there coverage files here" - - echo $PWD - find . -name "coverage-*.json" + - echo $PWD plugins: - ssh://git@github.com/segmentio/cache-buildkite-plugin#v2.0.0: key: "v1.1-cache-dev-{{ checksum 'yarn.lock' }}" From 46b24c78fbb1f208894d7b99e05af97316bfab6c Mon Sep 17 00:00:00 2001 From: Michael Grosse Huelsewiesche Date: Thu, 5 Dec 2024 12:20:24 -0500 Subject: [PATCH 11/15] Exempting browser load test from coverage --- .buildkite/pipeline.yml | 4 ---- .../browser/e2e-tests/performance/ajs-perf-browser.test.ts | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 9f5710714..2fe1f167c 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -41,8 +41,6 @@ steps: - echo "--- Install dependencies" - yarn install --immutable - yarn run -T browser exec make ci - - find . -name "coverage-*.json" - - echo $PWD plugins: - ssh://git@github.com/segmentio/cache-buildkite-plugin#v2.0.0: key: "v1.1-cache-dev-{{ checksum 'yarn.lock' }}" @@ -104,8 +102,6 @@ steps: - yarn run -T core lint - yarn run -T core test - yarn turbo run --filter=core-integration-tests lint - - find . -name "coverage-*.json" - - echo $PWD plugins: - ssh://git@github.com/segmentio/cache-buildkite-plugin#v2.0.0: key: "v1.1-cache-dev-{{ checksum 'yarn.lock' }}" diff --git a/packages/browser/e2e-tests/performance/ajs-perf-browser.test.ts b/packages/browser/e2e-tests/performance/ajs-perf-browser.test.ts index fe1fa4492..2f01eff8a 100644 --- a/packages/browser/e2e-tests/performance/ajs-perf-browser.test.ts +++ b/packages/browser/e2e-tests/performance/ajs-perf-browser.test.ts @@ -53,6 +53,7 @@ describe('Performance', () => { await analyticsStub.browserPage.close() }, 50000) + /* istanbul ignore next */ it('loads ajs in a browser', async () => { const analyticsStub = await tester( TEST_WRITEKEY, From 484de61ec2a89946231852e01b284997b3023a03 Mon Sep 17 00:00:00 2001 From: Michael Grosse Huelsewiesche Date: Thu, 5 Dec 2024 14:34:32 -0500 Subject: [PATCH 12/15] Trying different test set for browser coverage --- .buildkite/pipeline.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 2fe1f167c..60cd2316b 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -30,10 +30,6 @@ steps: - label: '[Browser] Lint + Test' key: browser-lint-test - env: - SEGMENT_CODECOV_FLAGS: 'browser' - SEGMENT_CODECOV_ARGS: '--dir=./packages/browser/coverage' - COVERAGE: true agents: queue: v1 commands: @@ -51,6 +47,10 @@ steps: key: qa agents: queue: v1 + env: + SEGMENT_CODECOV_FLAGS: 'browser' + SEGMENT_CODECOV_ARGS: '--dir=./packages/browser/coverage' + COVERAGE: true commands: - npm config set "//registry.npmjs.org/:_authToken" $${NPM_TOKEN} - echo "--- Install dependencies" From b9f97343ab80093d8de9a2ee610ba12e902cab76 Mon Sep 17 00:00:00 2001 From: Michael Grosse Huelsewiesche Date: Thu, 5 Dec 2024 14:54:57 -0500 Subject: [PATCH 13/15] Zeroing out coverage thresholds temporarily --- packages/browser/jest.config.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/browser/jest.config.js b/packages/browser/jest.config.js index 2e212a7fb..7dfb96f4d 100644 --- a/packages/browser/jest.config.js +++ b/packages/browser/jest.config.js @@ -6,10 +6,10 @@ module.exports = createJestTSConfig(__dirname, { testEnvironment: 'jsdom', coverageThreshold: { global: { - branches: 74, - functions: 80, - lines: 87, - statements: 82, + branches: 0, + functions: 0, + lines: 0, + statements: 0, }, }, }) From 32d3b8fa7023ac0bba99a6ae59bd094a42a2c0c9 Mon Sep 17 00:00:00 2001 From: Michael Grosse Huelsewiesche Date: Thu, 5 Dec 2024 14:57:09 -0500 Subject: [PATCH 14/15] Removing useless coverage ignore statement --- packages/browser/e2e-tests/performance/ajs-perf-browser.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/browser/e2e-tests/performance/ajs-perf-browser.test.ts b/packages/browser/e2e-tests/performance/ajs-perf-browser.test.ts index 2f01eff8a..fe1fa4492 100644 --- a/packages/browser/e2e-tests/performance/ajs-perf-browser.test.ts +++ b/packages/browser/e2e-tests/performance/ajs-perf-browser.test.ts @@ -53,7 +53,6 @@ describe('Performance', () => { await analyticsStub.browserPage.close() }, 50000) - /* istanbul ignore next */ it('loads ajs in a browser', async () => { const analyticsStub = await tester( TEST_WRITEKEY, From becfdc52464b97088894c9accb139662d7cb8662 Mon Sep 17 00:00:00 2001 From: Michael Grosse Huelsewiesche Date: Tue, 17 Dec 2024 17:16:53 -0500 Subject: [PATCH 15/15] Adding codecov comments --- codecov.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/codecov.yml b/codecov.yml index f5be7fd90..f494c1163 100644 --- a/codecov.yml +++ b/codecov.yml @@ -5,3 +5,5 @@ coverage: target: auto threshold: 0% base: auto +comment: + show_carryforward_flags: true