Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/docker/linux-ci.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN apt-get update \
ca-certificates curl git sudo tar xz-utils build-essential \
ninja-build pkg-config python3 \
gcc-16 g++-16 libwebkitgtk-6.0-dev lcov libjson-xs-perl \
xvfb xauth \
xvfb xauth time \
&& rm -rf /var/lib/apt/lists/*

# The workspace is mounted from the host runner and owned by another user: let git (and the tests that call it) read it.
Expand Down
210 changes: 177 additions & 33 deletions .github/workflows/BuildAndTest.yml

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ Exception: a purely C++ change that reuses an existing encoding, introduces no n
- Every bug fix needs a failing regression test at the lowest useful level. Bridge changes also need the browser integration test.
- Tests must not require user input, a fixed pre-existing browser session, or public network access after dependencies are configured.

Before declaring work complete, run the CEF-off build and CTest suite. Run the CEF/Xvfb test when changing the bridge, browser lifecycle, module serving, Jasmine assets, or CEF frontend. These PRs must also dispatch `BuildAndTest.yml` on the PR head branch before merging (`gh workflow run BuildAndTest.yml --ref <pr-branch>`), then wait for both GCC and Clang CEF jobs to pass. Manual dispatch runs the extended CEF/sanitizer checks without repeating the desktop matrix by default. To also run the complete desktop CTest suite three times, resetting its fixtures on each pass, dispatch with `-f repeat_desktop_tests=true`. It is the required per-PR CEF validation for these changes; the weekly run is a backstop, not a substitute. Update README/status documentation when commands, public behavior, or limitations change. The `NewcomerDocsMatchExamples` CTest case fails when the README quick-start commands or snippets drift from the examples, CMake targets, or CI commands, and `AddSubdirectoryConsumer` builds a minimal parent project linking `WebFront::WebFront`.
Tests are organized in three tiers selected by CTest labels (`fast`, standard, `portability`; see `docs/TEST_TIERS.md`). `ctest -L fast` is the quick check while working; a local run before declaring work complete runs everything. CI runs the fast tier first on each desktop job, the standard tier (everything but `portability`) on every pull request, and the advanced tier (three repetitions of the complete desktop suite, the `portability` job, sanitizers, fuzzers and the GCC/Clang CEF test) weekly and on every pull request into `master`, where those checks are required for the merge once marked required in the branch protection rules. A new test with no label belongs to the standard tier; label a test `portability` only if it verifies the library from another project or toolchain.

Before declaring work complete, run the CEF-off build and CTest suite. Run the CEF/Xvfb test when changing the bridge, browser lifecycle, module serving, Jasmine assets, or CEF frontend. These PRs, when they target `develop`, must also dispatch `BuildAndTest.yml` on the PR head branch before merging (`gh workflow run BuildAndTest.yml --ref <pr-branch>`), then wait for both GCC and Clang CEF jobs to pass; a PR into `master` runs this advanced tier on its own. Manual dispatch runs the extended CEF/sanitizer checks without repeating the desktop matrix by default. To also run the complete desktop CTest suite three times, resetting its fixtures on each pass, dispatch with `-f repeat_desktop_tests=true`. It is the required per-PR CEF validation for these changes; the weekly run is a backstop, not a substitute. Update README/status documentation when commands, public behavior, or limitations change. The `NewcomerDocsMatchExamples` CTest case fails when the README quick-start commands or snippets drift from the examples, CMake targets, or CI commands, and `AddSubdirectoryConsumer` builds a minimal parent project linking `WebFront::WebFront`.

## Git and workspace safety

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,9 @@ Configuring with tests enabled downloads, and verifies against their SHA-512, th

CTest runs up to four tasks at a time; browser ports remain locked and embedded builds run serially.
See [test timings and parallelism](docs/TEST_PERFORMANCE.md) for measurements and constraints.
`ctest -L fast` runs the unit tests in about a second; [test tiers](docs/TEST_TIERS.md) describes what CI runs on each pull request, weekly and before a merge into `master`.

CI runs one combined C++ / native-browser job per desktop platform on each code change. The Linux job also collects and prints GCC line coverage (no external upload). Linux Clang, sanitizers, fuzzing and CEF compatibility run weekly and on demand. Manual dispatch with `repeat_desktop_tests=true` also repeats each desktop CTest case three times for stability checks. Workflow concurrency cancels superseded runs; dependency and compiler caches avoid repeated work. Platform badges above identify the configured matrix; the CI badge reports its aggregate status. Execution times depend on cache state and runner availability.
CI runs one combined C++ / native-browser job per desktop platform on each code change. The Linux job also collects and prints GCC line coverage (no external upload). Linux Clang, sanitizers, fuzzing and CEF compatibility run weekly, on demand and on pull requests into `master`. Manual dispatch with `repeat_desktop_tests=true` also repeats each desktop CTest case three times for stability checks. Workflow concurrency cancels superseded runs; dependency and compiler caches avoid repeated work. Platform badges above identify the configured matrix; the CI badge reports its aggregate status. Execution times depend on cache state and runner availability.

## Contracts and limitations

Expand Down
6 changes: 5 additions & 1 deletion cmake/Frontends.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,11 @@ endfunction()
# Separate discovery from registration so configure-only tests can supply a deterministic result.
function(webfront_find_xvfb out)
find_program(XVFB_RUN_EXECUTABLE xvfb-run)
set(${out} "${XVFB_RUN_EXECUTABLE}" PARENT_SCOPE)
if(XVFB_RUN_EXECUTABLE)
set(${out} "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../test/tools/WithDisplay.sh" PARENT_SCOPE)
else()
set(${out} "${XVFB_RUN_EXECUTABLE}" PARENT_SCOPE)
endif()
endfunction()

function(webfront_set_browser_test_properties name assets_directory timeout)
Expand Down
12 changes: 12 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

## Unreleased

- Tests are organized in tiers by CTest label: `fast` (unit tests, about one second), the standard tier and
`portability` (the consumer project). CI runs the fast tier first, excludes `portability` from pull requests into
`develop`, and runs the advanced tier (three suite repetitions, a portability matrix, sanitizers, fuzzers, CEF) weekly
and on pull requests into `master`. `RunTestSuite.cmake` accepts `LABEL_EXCLUDE`. See [TEST_TIERS](TEST_TIERS.md) (#388).

- Compatible `wf` regression commands share browser sessions, with fresh command realms and individual CTest reports
(#388). The suite runner reuses one Xvfb display on Linux, supports bounded `PARALLEL`, and records detailed phase/spec
timings. Independent driver groups use OS-assigned ports; `WebFrontConfig::port = "0"` and `app.port()` expose this
with TCPStdnet. Native `WebView2Options::visible` / `WKWebViewOptions::visible` default to true and allow quiet tests.
Windows/macOS CI no longer wait for the Linux image, extended jobs use sccache, fuzzers have bounded concurrency,
and lcov verifies its fast JSON backend. See [TEST_PERFORMANCE](TEST_PERFORMANCE.md).

- Accepted stdnet connections enable `TCP_NODELAY`, including after WebSocket upgrade (#379).
This removes the Nagle/delayed-ACK interaction that could delay a callback's return
after it sent a browser message. A real-socket regression checks the option directly;
Expand Down
6 changes: 6 additions & 0 deletions docs/DEVELOPER_ENVIRONMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -676,3 +676,9 @@ The packaged-script permission rejection is also exercised end to end.

The standard CEF-off suite also checks project transactions, path rejection, Life rules and boundaries, MIME types,
bootstrap freshness, package resolution, gzip generation, interruption and offline cache reuse.

## Repository test sessions

The non-interactive test driver can run compatible commands in a shared browser session with fresh command frames and
individual JSON reports. The production `wf` command API is unchanged. See [TEST_PERFORMANCE](TEST_PERFORMANCE.md) for
`--suite`, isolated CTest filters, complete fixture repetition, quiet windows, profiling and concurrency constraints.
9 changes: 9 additions & 0 deletions docs/PROJECT_STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ WebFront is a minimal header-only C++23 core plus a standalone developer environ

The sections below are dated records, newest first where the topic is current; earlier entries keep the names and numbers of their time.

## Test performance (#388, 2026-10-26)

Compatible driver commands share sessions while keeping individual CTest assertions, fresh realms and project/profile
isolation. Native failure, watchdog and lifecycle tests remain separate processes. The suite runner supports configurable
bounded parallelism and one dedicated Linux Xvfb display. The esbuild helper in developer specs uses its own Worker to
avoid the off-screen WebKit scheduler cost observed in profiling. Native Windows/macOS options can retain real engines
with hidden windows. Ports assigned by the OS are forwarded to navigation and the content policy.
See [TEST_PERFORMANCE](TEST_PERFORMANCE.md) for commands, measurement limits, fixture locks and qualification evidence.

## Accepted TCP connections (#379, 2026-10-26)

The stdnet provider enables `TCP_NODELAY` before handing accepted sockets to HTTP;
Expand Down
Loading
Loading