feat: Enhanced test runner UI with progress bar, per-suite results, and bundled image assets#380
Conversation
|
Hey, thanks for this! @chrisdp has some feedback he'll hopefully get around to sharing next week. But this is a much needed improvement, looking forward to landing it! |
i would love to contribute further if needed! |
That would be great! if I remember correctly, I think one of his big concerns was that there are performance implications of regularly replacing the entire .text of the ScrollableText node. As the test suite grows, that'll slow down over time, and can have performance impacts on the test suites themselves. I think one of his suggestions was to instead create unique labels for each line, and offset them using absolute positioning. This way the impact of adding new statuses is only as costly as creating 1 new label node per message. Might be worth experimenting with that? I'll connect with him next week to get more specific details. |
|
Got some more clarity on the approach from Chris. here are the main points: Label recycling for scrolling Loading spinner Progress bar granularity Suite progress display |
oaky perfect, i was trying to avoid the animation node but it will make it look super cool! I will try to make above possible. |
… refactor Builds on PR rokucommunity#380 with four review follow-ups and an enterprise-grade refactor of TestRunner. UI improvements - Loading spinner now actually rotates (BusySpinner with control="start") and resets cleanly to scale=[0,0] before revealing the result Poster, so the success/failure image always lands upright at the same canvas size. - Progress bar advances per test (not per suite) via a new TestRunnerUIReporter wired into the framework's reporter chain, with a cross-thread bridge for node/async test suites that fire callbacks on the child node's reporter list rather than ours. - Status header shows the current suite name plus a live "started/total · ✓ passed · ✗ failed" counter, updated on every onTestBegin/onTestComplete. - Results panel rebuilt as a designer-style row layout: thin colored accent bar on the left (green pass / red fail), suite name as the dominant content, and a focus-driven failure-count disclosure on the right that reveals "1 failed" / "all 212 failed" only when the row is focused. Replaces the old O(N) string-realloc ScrollableText. Architecture - New TestRunnerUIReporter class extends BaseTestReporter, owns all UI state (totals, scene-node refs, progress writes). Replaces a 35-line inline anonymous reporter literal embedded in run(). - TestRunner.run() decomposed from a ~225-line monolith into a 38-line orchestration plus 14 single-purpose private helpers (precomputeTotalTests, executeSuite, buildSuite, resolveUINodes, appendSuiteResultLine, finalizeRun, renderSuccessFinalState, renderFailureFinalState, swapResultImage, notifyReporters, dispatchOnEnd, publishRooibosResult, maybeRunCoverage, printFinalStatus). - Cross-thread bridge in runNodeTest collapsed from a 14-line per-event switch to a single uiReporter.applyNodeProgressEvent(field) call. - New RooibosResultRow + RooibosScrollableResults components: row uses absolutely-positioned children (bar / name / count) so alignment is mathematically guaranteed regardless of font proportions; colors hoisted to a single m.colors table; render rules expressed as pure helpers. - RooibosScrollableResults switched from LabelList to MarkupList with itemComponentName="RooibosResultRow"; appendLine takes structured { name, passed, failedCount, totalCount }, dropping all dead text/color/string-arg paths. - Plugin scene template (FileFactory.ts) branches on the suite parameter: node-test components get a minimal XML (just rooibosTestResult field + Rooibos_CreateTestNode function, no UI children) — fixes a duplicate scene-graph ID bug (multiple resultImage nodes) that previously corrupted SceneGraph state and crashed the runtime at end of run. Bug fixed in passing - Original final-state rendering used the last loop-iteration's testSuite variable, silently rendering nothing when the last class lookup failed. New code tracks the last successful suite explicitly. Assets - loading.png, success.png, failure.png resized to 75×75 — appropriate for the spinner slot, no on-device scaling.
|
@TwitchBronBron al the changes are in place. Please feel free to leave your input when you get some time to review.
|
These were placeholders for an earlier custom scrollbar idea that the final RooibosScrollableResults component (extending MarkupList) doesn't need. No code references either file.
0be34be to
04abada
Compare
Summary
Replaces the default minimal test runner UI with an enhanced visual experience featuring real-time progress tracking, per-suite pass/fail results, and customizable branding.
What changed
Test Runner UI (
FileFactory.ts)#1a1a2e) replacing the plain grayimages/rooibos/your-company-logo.pngwith their ownresultImageUri,summaryText,progressWidthTest Runner Logic (
TestRunner.bs)Running (3/15): SuiteNamewith live progress barOK SuiteName (5/5)orX SuiteName (3/5)as each suite completesPassed: 12 | Failed: 3 | 15 suites in 4.2stestNodeContainer) to prevent scene re-rendersImage Asset Pipeline (
FileFactory.ts+plugin.ts)copyImageAssets()method copies bundled images to staging directory as binary filesafterProgramTranspilehook (when staging directory exists)pkg:/images/rooibos/...) — no network requests at runtimeBundled Assets
your-company-logo.pngloading.pngsuccess.pngfailure.pngscrollbar-track.9.pngscrollbar-thumb.9.pngScreenshots
Testing
npm run test:nocover— 121 passing, 1 pending (no regressions)npm run build— clean buildnpm run build-test-project— transpiles and packages successfullyFailedAssertion+SuiteTimeoutstests)