Skip to content

Ariadne tests: skip backend-driven cases without FTXUI, ignore NO_COLOR - #971

Merged
transfix merged 2 commits into
masterfrom
fix/ariadne-host-test-ftxui-skip
Nov 2, 2026
Merged

transfix merged 2 commits into
masterfrom
fix/ariadne-host-test-ftxui-skip

Conversation

@transfix

@transfix transfix commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

In a build without FTXUI, ariadne_host_test failed 11 of its 53 cases and took about 400 s. With this change those cases skip, and the suite finishes in about 3 s.

Cause

Without FTXUI, FtxuiBackend compiles to an inert stub (available() == false) that draws and feeds nothing. Eleven cases go through it:

  • Some press a widget (press_button, press_only_button, Tab and Return fed to the backend).
  • The others mount a module with be.render_to_string(...).

With the stub, the click never happens and the module is never mounted. AriadneQuit.TheQuitEventCloses fails at once (should_close() stays false). The other ten wait out drain_until, about 39 s each.

ariadne_ftxui_test already guards this case with REQUIRE_FTXUI(), and ariadne_stream_view_test and ariadne_requires_test skip on FtxuiBackend::available() too. ariadne_host_test only had REQUIRE_YAML().

This came up on a native Windows build whose prefixes had no ftxui. CI installs ftxui 7.0.3+cvc.1, so CI was green throughout.

Change

ariadne_host_test.cpp gets the same REQUIRE_FTXUI() macro as ariadne_ftxui_test. It is called after REQUIRE_YAML() in the eleven cases:

  • AriadneQuit.TheQuitEventCloses
  • AriadneRunProgram.AnActionsFailureNamesItsProgram
  • AriadneFunctions.* (3)
  • AriadneModuleTick.{RunsAtTheMountWithItsFunctions, AFailureNamesTheMount, StopsWhenAReconcileDropsTheMount, ARepeatedMountTicksPerInstance}
  • AriadneResidents.AKilledModuleTickIsRestarted
  • AriadneResourceIntrinsics.AnActionSeesItsLimits

The other 42 cases don't depend on the backend drawing anything, and they still run without FTXUI.

Testing (native Windows, static Release, MSVC 14.44, tests ON)

  • Without FTXUI: 42 pass and 11 skip, in 2.9 s. Before this change, 42 passed and 11 failed in about 400 s.
  • With FTXUI (cvcpkg install ftxui --link shared): 53/53 pass. In the same build, ariadne_ftxui_test passes 77/77, ariadne_requires_test 17/17 and ariadne_stream_view_test 7/7.

Second commit: ariadne_stream_view_test no longer inherits NO_COLOR

AriadneStreamView.TheTerminalWidgetDrawsLiveFramesAndAPlaceholder tells a red frame from a blue one by the colours render_to_string(..., ansi=true) prints. FTXUI reads NO_COLOR once, on first use (ftxui-screen checks it next to COLORTERM and TERM), and then prints every cell in the default colours. With NO_COLOR set in the environment, both frames printed the same and the case failed.

The test file now drops NO_COLOR in a static initializer, before any case runs. It uses _putenv_s on Windows and unsetenv elsewhere, as ariadne_loader_test and ariadne_runtime_test already do. A scoped guard would come too late, because FTXUI has cached the colour depth by then. The backend still honours NO_COLOR in real use.

Tested with FTXUI: the suite passes 7/7 with NO_COLOR=1 and with it unset, three repeats each (--gtest_repeat=3). The case also passes alone in its own process with NO_COLOR=1.

Without FTXUI, FtxuiBackend is an inert stub (available() == false): it draws
nothing and feeds nothing. Eleven cases press a widget through it (press_button,
press_only_button, Tab/Return) or mount a module by rendering, so in a build
without FTXUI they never see the click or the mount. TheQuitEventCloses fails
at once; the other ten wait out drain_until (~39 s each). A local native
Windows build without ftxui in its prefixes failed all eleven and took ~400 s.

Add REQUIRE_FTXUI(), as ariadne_ftxui_test has, and call it after
REQUIRE_YAML() in those eleven. The other 42 cases don't depend on the
backend's drawing and still run. CI installs ftxui, so it runs all 53 as
before.
TheTerminalWidgetDrawsLiveFramesAndAPlaceholder tells a red frame from a
blue one by the colours render_to_string(..., ansi=true) prints. FTXUI reads
NO_COLOR once, on first use, and then prints every cell in the default
colours, so with NO_COLOR set in the environment both frames print the same
and the case fails. Drop NO_COLOR in a static initializer, before any case
runs. A scoped guard would come too late once FTXUI has cached the depth.
@transfix transfix changed the title ariadne_host_test: skip the backend-driven cases without FTXUI Ariadne tests: skip backend-driven cases without FTXUI, ignore NO_COLOR Nov 2, 2026
@transfix
transfix merged commit b087999 into master Nov 2, 2026
27 of 28 checks passed
@transfix
transfix deleted the fix/ariadne-host-test-ftxui-skip branch November 2, 2026 08:00
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