Repository navigation
Steady the window test on slow builders and drop the version from the code - #15
Conversation
The package build runs the tests under software rendering on shared machines, where a frame can take longer than the test waited. The camera fit is now polled until the view has drawn, and a journey is checked by what is certain (it started, it is aimed, it arrives) rather than by sampling a piece in mid-air. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Added a second commit bumping the version to 0.1.1, so this can be tagged as the release the package builds from: the v0.1.0 tarball carries the timing-dependent tests and can't pass |
[Low impact] The PR appears safe to merge; the existing camera-test gap remains non-blocking. Findings
SummaryThe PR makes the window tests less dependent on rendering speed and removes the hardcoded version.
Reviews (2) · Last reviewed commit: "Take the version from the release, never..." · Reviewed by Greptile |
| // The view answers from the last frame it drew, and a slow renderer takes its time over one. | ||
| QString stray; | ||
| auto framed=[&] { | ||
| stray.clear(); | ||
| for (float x : {-4.55f,4.55f}) for (float z : {-4.55f,4.55f}) { | ||
| QVector3D point; | ||
| if (!QMetaObject::invokeMethod(view,"mapFrom3DScene",Q_RETURN_ARG(QVector3D,point),Q_ARG(QVector3D,QVector3D(x,0,z)))) return false; | ||
| if (point.x()<0 || point.x()>board->width() || point.y()<0 || point.y()>board->height()) | ||
| stray=QString("set %1 at %2x%3: corner %4,%5 lands at %6,%7").arg(set).arg(size.width()).arg(size.height()) | ||
| .arg(x).arg(z).arg(point.x()).arg(point.y()); | ||
| } | ||
| return stray.isEmpty(); | ||
| }; | ||
| QTRY_VERIFY2_WITH_TIMEOUT(framed(),qPrintable(stray),10000); |
There was a problem hiding this comment.
After setPieceSet(), framed() runs immediately and can accept the previous set's already-valid projection. The loop can then advance without drawing the selected set, including set 2's different camera. This leaves a gap where a change that crops the board could pass the test. Wait for a new frame after each set change, then poll the corners.
A tag's tarball unpacks as checkmate-<version>, and a checkout asks git, as Hype and Plain do. Cutting a release is now only a tag. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Two things the next release needs.
The window test on slow builders
The 0.1.0 package build failed its
check()on both omarchy-pkgs builders, in two places of the window test, both from timing rather than behavior:The camera fit is now polled until the corners are in view. Journeys are checked by what is certain (the animation started, it is aimed along the move, the piece arrives) rather than sampled mid-flight. Four tight timeouts are now 8 s.
No version in the code
The version comes from the release, as in Hype and Plain: a tag's tarball unpacks as
checkmate-<version>, and a checkout asksgit describe.--versionand the application version both use it, and a new test runs--versionwith no display. Cutting a release is now only a tag.(The earlier "Call it 0.1.1" commit on this branch is superseded by this; nothing hardcodes a version now.)
Verification
bin/testpasses, both tests.checkmate-9.9.9configures with version9.9.9; this checkout reports0.1.0-2-g….🤖 Generated with Claude Code