Repository navigation
Ariadne tests: skip backend-driven cases without FTXUI, ignore NO_COLOR - #971
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In a build without FTXUI,
ariadne_host_testfailed 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,
FtxuiBackendcompiles to an inert stub (available() == false) that draws and feeds nothing. Eleven cases go through it:press_button,press_only_button,TabandReturnfed to the backend).be.render_to_string(...).With the stub, the click never happens and the module is never mounted.
AriadneQuit.TheQuitEventClosesfails at once (should_close()stays false). The other ten wait outdrain_until, about 39 s each.ariadne_ftxui_testalready guards this case withREQUIRE_FTXUI(), andariadne_stream_view_testandariadne_requires_testskip onFtxuiBackend::available()too.ariadne_host_testonly hadREQUIRE_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.cppgets the sameREQUIRE_FTXUI()macro asariadne_ftxui_test. It is called afterREQUIRE_YAML()in the eleven cases:AriadneQuit.TheQuitEventClosesAriadneRunProgram.AnActionsFailureNamesItsProgramAriadneFunctions.*(3)AriadneModuleTick.{RunsAtTheMountWithItsFunctions, AFailureNamesTheMount, StopsWhenAReconcileDropsTheMount, ARepeatedMountTicksPerInstance}AriadneResidents.AKilledModuleTickIsRestartedAriadneResourceIntrinsics.AnActionSeesItsLimitsThe 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)
cvcpkg install ftxui --link shared): 53/53 pass. In the same build,ariadne_ftxui_testpasses 77/77,ariadne_requires_test17/17 andariadne_stream_view_test7/7.Second commit:
ariadne_stream_view_testno longer inheritsNO_COLORAriadneStreamView.TheTerminalWidgetDrawsLiveFramesAndAPlaceholdertells a red frame from a blue one by the coloursrender_to_string(..., ansi=true)prints. FTXUI readsNO_COLORonce, on first use (ftxui-screenchecks it next toCOLORTERMandTERM), and then prints every cell in the default colours. WithNO_COLORset in the environment, both frames printed the same and the case failed.The test file now drops
NO_COLORin a static initializer, before any case runs. It uses_putenv_son Windows andunsetenvelsewhere, asariadne_loader_testandariadne_runtime_testalready do. A scoped guard would come too late, because FTXUI has cached the colour depth by then. The backend still honoursNO_COLORin real use.Tested with FTXUI: the suite passes 7/7 with
NO_COLOR=1and with it unset, three repeats each (--gtest_repeat=3). The case also passes alone in its own process withNO_COLOR=1.