Repository navigation
Build the split simulator and run headless tests in CI - #7780
Draft
Eric Anderson (humanapp) wants to merge 4 commits into
Draft
Eric Anderson (humanapp) wants to merge 4 commits into
Eric Anderson (humanapp) wants to merge 4 commits into
Conversation
copyArcadeSim.js copies the sim clone's core, visuals and visuals/components folders into node_modules/pxt-arcade-sim beside the root and public files, and removes the node_modules include entries from both tsconfig.json and tsconfig.core.json in the copy, so the vendored simulator builds its DOM-free core bundle and its browser bundle from the sibling clone's sources.
tests/sim holds six programs that pxt simtest runs on top of libs/blocksprj, each asserting its serial output: controller button events raised from the program, a sprite's position after a fixed span of virtual time, screen pixel readback across a palette change, music.playTone completing on the silent audio host, a settings round trip, and the text prompt falling back to the on-screen keyboard; the buildpush job runs the folder after pxt ci whenever the simulator checkout runs.
tests/sim gains four pxt simtest programs that drive themselves and assert through their own console output: the frame in which a sprite overlap fires, the stop position of a sprite against a tilemap wall with the hit-wall event, a countdown's end beside an update interval's tick count, and a sprite destroyed by its lifespan followed by the life-zero event, every value derived from the 20 ms frame loop and the game library's physics, with identical output across runs.
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.
Arcade target changes for the DOM-free simulator split.
Vendoring the split simulator
scripts/copyArcadeSim.jscopies the simulator'score/andvisuals/folders alongside its root and public files, and strips thenode_modulesinclude entries from bothtsconfig.core.jsonandtsconfig.json, so a local checkout builds the DOM-free and browser bundles from the sibling sim clone.Headless tests
tests/simholds ten programs thatpxt simtestruns on top oflibs/blocksprj, each asserting its own serial output: controller button events, a sprite's position and an overlap at a predicted frame, a stop against a tilemap wall, a countdown beside an update interval, a sprite's lifespan and the life-zero event, screen pixel readback across a palette change, a tone on the silent audio host, a settings round trip, and the text prompt falling back to the on-screen keyboard. The buildpush job runs the folder afterpxt ciwhenever the simulator checkout runs.Generated declarations
The
shims.d.tsfiles are regenerated, so I committed them.