Simplify the gameplay tests against the improved harness - #1032
Merged
Conversation
GDevelop master 4cc37b4 fixed several of the things the tests worked around, so fifteen games now use the harness directly: - setMousePosition projects through the 3D camera, so the four games that clicked or dragged through one drop their cursor-search helper. The twin-stick shooter aims diagonally again, the RTS uses a scene-coordinate selection box. - getObjectVariable replaces the hand-rolled variable readers of 7 games. - stepUntilObjectIsStable replaces the settle loops of the physics games. - getEventLog()'s sceneReset replaces "the player is back at its spawn" in the 5 tests that check a run ends. Store the screenshots a test takes in the CI artifacts, in a gameplay-test-screenshots folder next to the results of the game, and rewrite the paths inside the results file to point at them. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M2jc7PVAvmMmirAQude2v1
Contributor
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.
Follow-up to #1031, against GDevelop master
4cc37b4("Various improvements for gameplay tests"), which fixed several of the things the tests were working around. Fifteen games now use the harness directly instead.What each harness fix bought
setMousePositionprojects through the 3D camerastarting-3d-twin-stick-shooteraims diagonally again instead of only straight up and down, andstarting-3d-rts-unit-selectionis back to a plain scene-coordinate selection box.getObjectVariablesnapshot.variables.find(...)readers in 7 games. The enemy tests read health by instance id, so "destroyed" is just the variable being gone.stepUntilObjectIsStablegetEventLog()/sceneResetCI: screenshots stored next to the results
The screenshots a test takes with
harness.takeScreenshot(...)are now kept in the artifacts, in agameplay-test-screenshots/folder next to that game'sresults.json. The paths recorded inside the results file are rewritten to point at them (GDevelop records an absolute path in the game folder, where the files no longer are), so a downloaded results file still resolves its images. A retried run no longer nests the folder inside itself.Verification
All 30 tests of the 15 changed games pass locally against the current master build. Every test is unchanged in what it asserts, except the twin-stick aiming test, which got stronger (diagonal aim and a moving crosshair, as in its 2D counterpart).
Two things left alone, and why
lookTowardWithMouseDeltahas a hardcoded 3° tolerance. It now measures correctly (on the layer's camera — right eye height, whatever rotation the game drives), but reportsaimed: truewhile 1.3° off, which is a clean miss at the range ofstarting-first-person-shooter's target; calling it again steps zero frames.starting-first-person-shooterkeeps its own aiming loop. ExposingtoleranceDegreeswould make it usable for "aim well enough to hit".getRelativePosition('Player', target, { fromCamera })returnsyawDiff: -90.04while the player is demonstrably facing the target. The pitch from the same call is exact (-3.31°, matching what the test computed by hand), so this looks like a convention offset rather than a broken measurement.Both are written up in
GAMEPLAY_TESTS_FEEDBACK-starters.md, along with a correction: my earlier claim that a drag box is screen-space was wrong — the box is in scene coordinates, and the unit that went unselected did so because the cursor was being placed in the wrong spot.🤖 Generated with Claude Code
https://claude.ai/code/session_01M2jc7PVAvmMmirAQude2v1
Generated by Claude Code