From feaae0f2d6dcb8a62aadc8cc3e970ee437c7c629 Mon Sep 17 00:00:00 2001 From: Ammar Date: Mon, 20 Oct 2025 11:52:59 -0500 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=A4=96=20Add=20Codecov=20integration?= =?UTF-8?q?=20to=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add coverage generation to unit tests job with bun test --coverage - Add coverage generation to integration tests job with jest --coverage - Upload coverage reports to Codecov with appropriate flags (unit-tests, integration-tests) - Set fail_ci_if_error: false to not block PRs on Codecov upload failures Generated with `cmux` --- .github/workflows/ci.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a46064577..0a15f28b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,8 +66,16 @@ jobs: - uses: ./.github/actions/setup-cmux - - name: Run tests - run: make test-unit + - name: Run tests with coverage + run: bun test --coverage src + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage/lcov.info + flags: unit-tests + fail_ci_if_error: false integration-test: name: Integration Tests @@ -80,12 +88,20 @@ jobs: - uses: ./.github/actions/setup-cmux - - name: Run integration tests - run: make test-integration + - name: Run integration tests with coverage + run: TEST_INTEGRATION=1 bun x jest --coverage tests env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage/lcov.info + flags: integration-tests + fail_ci_if_error: false + storybook-test: name: Storybook Interaction Tests runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} From 6b2f1ba2b6541cb0d7f6dee5f23c0da81f6e6b69 Mon Sep 17 00:00:00 2001 From: Ammar Date: Mon, 20 Oct 2025 11:54:29 -0500 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=A4=96=20Rename=20Test=20job=20to=20U?= =?UTF-8?q?nit=20Tests=20for=20clarity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Generated with `cmux` --- .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 0a15f28b3..e4d689cfe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,7 +56,7 @@ jobs: run: make -j3 static-check test: - name: Test + name: Unit Tests runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} steps: - name: Checkout code From 4211cea8978b54c7562c574423b724f9ffaa9d44 Mon Sep 17 00:00:00 2001 From: Ammar Date: Mon, 20 Oct 2025 11:59:22 -0500 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=A4=96=20Add=20codecov.yml=20configur?= =?UTF-8?q?ation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Disable PR comments (comment: false) - Make all status checks informational (won't block PRs) - Track unit-tests and integration-tests flags separately - Ignore test files and build artifacts from coverage _Generated with `cmux`_ --- codecov.yml | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 codecov.yml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..3a07c8ae6 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,45 @@ +# Codecov Configuration +# https://docs.codecov.com/docs/codecovyml-reference + +# Disable PR comments - just show status checks +comment: false + +coverage: + # Coverage precision (decimal places) + precision: 2 + round: down + range: 70..100 + + status: + # Project coverage status - informational only + project: + default: + target: auto # Compare to base commit + threshold: 5% # Allow 5% drop without changing status + informational: true # Won't block PRs + + # Patch coverage status - informational only + patch: + default: + target: auto # Compare to base commit + threshold: 5% # Allow 5% drop without changing status + informational: true # Won't block PRs + +# Flag configuration to track unit vs integration test coverage +flags: + unit-tests: + paths: + - src/** + carryforward: false + integration-tests: + paths: + - tests/** + carryforward: false + +# Ignore common non-source paths +ignore: + - "**/*.test.ts" + - "**/*.test.tsx" + - "**/dist/**" + - "**/node_modules/**" + - "**/coverage/**" From 10cecdf4de68e3ed20ad272f2b4b5941586395c1 Mon Sep 17 00:00:00 2001 From: Ammar Date: Mon, 20 Oct 2025 12:01:27 -0500 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=A4=96=20Fix=20bun=20test=20coverage?= =?UTF-8?q?=20reporter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add --coverage-reporter=lcov flag to ensure bun generates lcov.info file. Without this flag, bun defaults to 'text' reporter which only prints to stdout and doesn't generate the coverage file needed for Codecov upload. Addresses Codex review feedback. _Generated with `cmux`_ --- .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 e4d689cfe..fe8fe0685 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: - uses: ./.github/actions/setup-cmux - name: Run tests with coverage - run: bun test --coverage src + run: bun test --coverage --coverage-reporter=lcov src - name: Upload coverage to Codecov uses: codecov/codecov-action@v5