Skip to content

Run the unit tests as four shards in CI and the fast tier once per pull request (#543) - #555

Merged
ambroise-leclerc merged 1 commit into
developfrom
543-unit-tests-once
Nov 11, 2026
Merged

ambroise-leclerc merged 1 commit into
developfrom
543-unit-tests-once

Conversation

@ambroise-leclerc

Copy link
Copy Markdown
Collaborator

Closes #543.

What changes

  • -DWEBFRONT_TEST_UNIT_SHARDS=<n> registers n CTest cases UnitTests-<i>, each a Catch2 shard (--order decl --shard-count n --shard-index i) that reports every scenario in unit-results-<i>.xml. The default, 0, keeps one CTest case per scenario for ctest -R.
  • The desktop jobs pass 4 shards. On a pull request the suite step leaves the fast label out, since the fast step has just run it; the three passes of the complete tier still run it each time.
  • RunTestSuite.cmake already hands LABEL_EXCLUDE to ctest -LE as a regular expression: the CI passes ^(portability|fast)$, and TestSuiteRepetition covers it.
  • test/unit/ScenarioIsolation.cpp: a Catch2 listener restores the enabled log severities before each scenario. Running the scenarios in one process showed that "The handshake's secret never reaches the diagnostics" leaves the debug level on, which makes the next application send log lines to its browser and fails DeferredCallTests.cpp:207 and BroadcastTests.cpp:84.

Evidence (Windows, MSVC, WebView2, Release)

  • The four shards report 508 scenarios, the 508 that tests --list-tests lists, none twice.
  • Before the listener, the failing pair fails every time with a fixed seed; with it, the pair, four formerly failing seeds and the declaration order pass.
  • Fast tier: 18 CTest cases instead of 524, 28 s of wall time, bounded by one shard of 21 s that holds two scenarios of about 10 s each.
  • Suite without fast and portability: 164 cases in 136 s, against 689 cases in 200 s for the whole suite. One case failed in that pass, AutomationMcpWindow, with rename: Access is denied: the defect Retry the renames of the developer store on Windows and steady three intermittent tests (#542) #549 fixes, which this branch does not contain.

Not verified

  • Linux and macOS, and the coverage comparison (CompareCoverage.py) on the Linux job: left to this pull request's CI.
  • The profile written by ProfileTests.py now covers the suite step only; the fast step writes fast-results.xml beside it.

…ll request (#543)

WEBFRONT_TEST_UNIT_SHARDS registers that many CTest cases, each a Catch2 shard in declaration order with a JUnit report of every scenario; the default keeps one case per scenario. The desktop jobs pass 4 and leave the fast tier out of the single pass that follows the fast step. Scenarios sharing a process exposed a leaked log level: a listener restores the severities before each scenario.
@coderabbitai

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 20c0b61f-6389-4137-99f8-9eee6bd443b7
Commits

Reviewing files that changed from the base of the PR and between fb9deb0 and 92c963f.

Files selected for processing: 6

  • .github/workflows/BuildAndTest.yml
  • docs/CHANGELOG.md
  • docs/TEST_TIERS.md
  • test/cmake/CheckTestSuiteRepetition.cmake
  • test/unit/CMakeLists.txt
  • test/unit/ScenarioIsolation.cpp
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@ambroise-leclerc
ambroise-leclerc merged commit 334a465 into develop Nov 11, 2026
17 of 18 checks passed
@ambroise-leclerc
ambroise-leclerc deleted the 543-unit-tests-once branch November 11, 2026 21:59
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.

Exécuter les tests unitaires une seule fois et en quelques processus en CI

2 participants