Repository navigation
Fixes #38648: feed browser-test coverage to the nightly SonarCloud scan; follow-ups from #38673 - #38649
Conversation
The UI SonarCloud scan runs only nightly and read only Jest's lcov, so code covered only by the Vitest browser suite showed as uncovered. The nightly job now installs Chromium, runs the full browser suite with coverage after Jest, and lists src/test/browser/coverage/lcov.info next to the Jest report in sonar.typescript.lcov.reportPaths (with src/test/browser added to sonar.tests). A failing test suite still fails the job and notifies Slack, but the scan steps run whenever the job was not cancelled, so the report written on failure is still scanned. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
UI browser testsRan: all test files (.github/workflows/ui-browser-tests.yml affects every browser test) Result: ✅ 1072 passed · 154 skipped |
…ent; no impact on PRs Follow-ups from the review of #38673: - A failed scheduled full run posts to Slack: GitHub only emails whoever last edited the schedule, and that run is where a selection miss shows. - The map lookup queries schedule, workflow_dispatch and merge_group runs separately, so PR runs cannot push a good map off the list. - Pull requests no longer record or upload impact, or carry the map. - A new decision record supersedes the 2026-11-23 one, whose title said the opposite of what we now do, and notes the two map-freshness gaps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…; record the coverage rule - test:cov-summary wrote only json-summary, so every nightly scan logged "No LCOV files were found" and saved no UI coverage. The nightly now asks Jest for lcov as well. - The scan runs only after a successful dependency install and with both the Jest and browser lcov present; otherwise a partial scan would publish a false coverage drop on main. - ADR:2026-11-25-ui-sonar-coverage-is-jest-plus-the-browser-suite-from-one-nightly-run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rage # Conflicts: # .github/workflows/ui-browser-tests.yml
… comment publisher PR jobs post no comments (ADR:2026-11-10-pr-jobs-never-receive-credentials): results belong in annotations, logs, artifacts and job summaries. The workflow_run publisher posted markdown built by PR code with a write token. Delete ui-browser-tests-comment.yml and the comment artifacts; both report steps write to $GITHUB_STEP_SUMMARY. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Code Review ✅ Approved 🟡 Medium risk 3 closed / 3 findingsThe UI workflow now uses selected browser tests before main and nightly full runs, so a missed test could let a regression merge before detection. Feeds Vitest browser-test coverage into the nightly UI SonarCloud scan alongside Jest lcov, moves browser-run reporting to the job summary, and adds Slack alerts for failed scheduled browser runs. Resolved the 0%-coverage publish on setup failure, the unrecorded coverage rule, and the silent pass when an lcov is missing. ✅ 3 closed✅ Bug: Scan now publishes a 0%-coverage analysis when setup fails
✅ Quality: UI Sonar coverage rule and its failure policy are not recorded
✅ Edge Case: Missing lcov skips the scan but the job still passes, with no Slack alert
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Fixes #38648
Describe your changes:
The UI SonarCloud scan read only the Jest lcov. Code covered only by the Vitest browser suite therefore showed as uncovered. This PR adds the browser-test coverage to the scan:
.github/workflows/ui-sonarcloud-nightly.yml: after the Jest coverage step, the job installs Chromium and runsyarn test:ui:coverage, the full browser suite of about 1,070 tests. It reuses the job's own Node, ANTLR and yarn install../.github/actions/ui-browser-setupwould have installed those a second time, so it isn't used. Chromium is installed without--with-deps, which matchesui-browser-setup. The job timeout goes from 90 to 180 minutes.reportOnFailure: true, so the lcov is written anyway. The sonar-scanner install and scan steps now useif: ${{ !cancelled() }}, so that lcov still gets scanned. Before this change, the retry scan step already ran after a Jest failure because of its!cancelled()condition, but the sonar-scanner install had been skipped. Jest failures and browser failures now both lead to a working scan.sonar-project.properties:sonar.typescript.lcov.reportPathsnow lists bothsrc/test/unit/coverage/lcov.infoandsrc/test/browser/coverage/lcov.info, andsonar.testsincludessrc/test/browser.sonar.exclusionsalready coverssrc/test/**andsrc/**/*.test.tsx, so*.browser.test.tsxfiles are not counted as sources.vitest.browser.config.tsandsrc/test/browser/README.mdnow say that the nightly Sonar scan reads this report.The UI has no PR or merge-queue Sonar scan. The nightly run is the only one, so it is the full-suite baseline and the "PR runs a subset" concern does not apply. This is the OSS half of open-metadata/openmetadata-collate#8350.
Type of change:
Tests
python3 -c "import yaml; yaml.safe_load(...)"on the workflow: parses.actionlint .github/workflows/ui-sonarcloud-nightly.yml: no errors. It reports fiveSC2086info notes, and the same five appear on themainversion of the file, on lines this PR does not change.yarn test:ui:coverage src/pages/BotsPageV1/BotsPageV1.browser.test.tsx: 1 file and 3 tests passed in 29s. It wrotesrc/test/browser/coverage/lcov.info(288 KB). ItsSF:paths are relative to the UI directory (for exampleSF:src/queryClient.ts), which is how Sonar resolves them, and no test files are listed.workflow_dispatchrun, will exercise them.Jest coverage was never reaching Sonar
test:cov-summarywrites onlyjson-summary, sosrc/test/unit/coverage/lcov.infonever existed. The last nightly scan loggedNo LCOV files were foundandNo coverage information will be saved, which means SonarCloud has had no UI coverage at all. The nightly now runsyarn test:cov-summary --coverageReporters lcov. I checked locally that Jest writes both reports and that the lcov uses UI-relative paths.The scan now runs only after a successful
yarn installand with both lcov files present (aCheck coverage reportsstep), so a crashed suite skips one night's scan instead of publishing a false coverage drop onmain. The rule is recorded inADR:2026-11-25-ui-sonar-coverage-is-jest-plus-the-browser-suite-from-one-nightly-run.Browser-test report: job summary only
Following ADR:2026-11-10-pr-jobs-never-receive-credentials ("results appear in annotations, logs, artifacts, and job summaries rather than PR comments"), this removes the PR comment:
ui-browser-tests-comment.yml(theworkflow_runpublisher that posted PR-built markdown with a write token) is deleted.browser-tests-commentartifacts are gone. The report ("what ran and why", the result, the changed code no test executes) and the "Ran: none" note go to$GITHUB_STEP_SUMMARYonly.browser-tests-report.mjsdrops the comment marker; its tests pass (12/12).Follow-ups from Harsh's review of #38673
This PR also carries the points from #38673 (review), which merged before they were addressed:
notifyjob posts to #pw-health (C0C008ZAK0V) when a scheduledUI Browser Testsrun fails. It usesCOLLATE_BOT_SLACK_TOKEN, the token the daily Playwright report already posts there with. The job runs only onschedule, socheck_pr_workflow_security.pystill passes.scheduleandworkflow_dispatchonmain, andmerge_group), then takes the newest run that has the artifact. PR runs can no longer push a good map off a 100-run list while main's full run is red.browser-impact-*, or carryimpact-map.jsoninbrowser-selection.ADR:2026-11-25-browser-tests-are-selected-before-main-and-run-in-full-on-mainsupersedesADR:2026-11-23-browser-tests-run-by-impact-on-pull-requests-and-in-full-in-the-merge-queue. The old record is restored to its v1 text and marked superseded. The new one records the two gaps in map freshness: concurrent queue entries overwriting each other's update, and a queue entry that passes but leaves the queue still publishing its map. The next full run fixes both, and neither can hide a test.Verified: the workflow parses as YAML,
check_pr_workflow_security.pypasses, and the per-event lookup returns run IDs newest first against the live API.🤖 Generated with Claude Code