Skip to content

Fix launch telemetry test failing under CI - #1570

Merged
sneub merged 1 commit into
mainfrom
fix/telemetry-test-under-ci
Aug 28, 2026
Merged

Fix launch telemetry test failing under CI#1570
sneub merged 1 commit into
mainfrom
fix/telemetry-test-under-ci

Conversation

@sneub

@sneub sneub commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Problem

ui/studio/context.test.tsx β€Ί sends launch telemetry by default fails on any CI runner.

ui/studio/context.tsx only sends studio_launched telemetry when !isCI. isCI from std-env is evaluated once at import time from the environment, so on a runner with CI=true the telemetry is (correctly) skipped and the test's expectation that check() was called fails. Locally the test passes because CI is unset. Nothing in this repo currently runs pnpm test on Actions, which is why it went unnoticed.

Fix

Test-only change:

  • Mock std-env in the test file and pin isCI to false by default via a vi.hoisted state object, reset in afterEach.
  • Add a test asserting launch telemetry is skipped when isCI is true.

No product code changes; no changeset needed.

Verification

  • CI=1 pnpm test β†’ 147 files passed, 3 skipped (MySQL suites without STUDIO_MYSQL_TEST_URL); previously 1 failed.
  • The same file also passes with CI unset.
  • pnpm typecheck and eslint clean.

`isCI` from std-env is evaluated once at import time, so the
"sends launch telemetry by default" test failed on any CI runner
where CI=true. Mock std-env in the test to pin `isCI`, and add a
case asserting telemetry is skipped when `isCI` is true.
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. πŸŽ‰

ℹ️ Recent review info
βš™οΈ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a5c65ea4-d3d4-459c-b26b-5ba0c510716c

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 550f51d and 8e983c8.

πŸ“’ Files selected for processing (1)
  • ui/studio/context.test.tsx

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


Summary by CodeRabbit

  • Tests
    • Added coverage to verify that launch telemetry is skipped in continuous integration environments.
    • Improved test isolation by resetting environment state between tests.

Walkthrough

The tests add a controllable mock for std-env.isCI. Cleanup resets the mocked CI state after each test. New coverage verifies that launch telemetry is not sent when the CI flag is enabled.

Merge Risk: βšͺ Minimal Β· up to 8e983

This is a localized test-only change that stabilizes CI coverage and adds validation for the intended CI behavior; no actionable merge-blocking risk remains after normal checks and review.

πŸš₯ Pre-merge checks | βœ… 5
βœ… Passed checks (5 passed)
Check name Status Explanation
Title check βœ… Passed The title clearly and concisely identifies the main change: fixing the launch telemetry test failure under CI.
Description check βœ… Passed The description directly explains the CI failure, the test-only fix, added coverage, and verification results.
Docstring Coverage βœ… Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check βœ… Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check βœ… Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

✨ Finishing Touches
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/telemetry-test-under-ci
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch fix/telemetry-test-under-ci

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Compute preview deployed.

Branch: fix/telemetry-test-under-ci
Service: fix-telemetry-test-under-ci
Preview: https://dr3hlssh5rr8l3xywjmtsmzs.cdg.prisma.build

@sneub
sneub merged commit c522665 into main Aug 28, 2026
3 checks passed
@sneub
sneub deleted the fix/telemetry-test-under-ci branch August 28, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant