Fix launch telemetry test failing under CI - #1570
Conversation
`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.
|
No actionable comments were generated in the recent review. π βΉοΈ Recent review infoβοΈ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: π Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. Summary by CodeRabbit
WalkthroughThe tests add a controllable mock for Merge Risk: βͺ Minimal Β· up to 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)
Full details: Docstring CoverageExplanation 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)
β¨ Simplify code
Comment |
|
Compute preview deployed. Branch: |
Problem
ui/studio/context.test.tsx βΊ sends launch telemetry by defaultfails on any CI runner.ui/studio/context.tsxonly sendsstudio_launchedtelemetry when!isCI.isCIfromstd-envis evaluated once at import time from the environment, so on a runner withCI=truethe telemetry is (correctly) skipped and the test's expectation thatcheck()was called fails. Locally the test passes becauseCIis unset. Nothing in this repo currently runspnpm teston Actions, which is why it went unnoticed.Fix
Test-only change:
std-envin the test file and pinisCItofalseby default via avi.hoistedstate object, reset inafterEach.isCIistrue.No product code changes; no changeset needed.
Verification
CI=1 pnpm testβ 147 files passed, 3 skipped (MySQL suites withoutSTUDIO_MYSQL_TEST_URL); previously 1 failed.CIunset.pnpm typecheckand eslint clean.