forked from bevyengine/bevy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make
contributors
example deterministic in CI (bevyengine#15901)
# Objective - Make the example deterministic when run with CI, so that the [screenshot comparison](https://thebevyflock.github.io/bevy-example-runner/) is stable - Preserve the "truly random on each run" behavior so that every page load in the example showcase shows a different contributor first ## Solution - Fall back to the static default contributor list in CI - Store contributors in a `Vec` so that we can show repeats of the fallback contributor list, giving the appearance of lots of overlapping contributors in CI - Use a shared seeded RNG throughout the app - Give contributor birds a `z` value so that their depth is stable - Remove the shuffle, which was redundant because contributors are first collected into a hashmap - `chain` the systems so that the physics is deterministic from run to run ## Testing ```bash echo '(setup: (fixed_frame_time: Some(0.05)), events: [(100, Screenshot), (500, AppExit)])' > config.ron CI_TESTING_CONFIG=config.ron cargo run --example contributors --features=bevy_ci_testing mv screenshot-100.png screenshot-100-a.png CI_TESTING_CONFIG=config.ron cargo run --example contributors --features=bevy_ci_testing diff screenshot-100.png screenshot-100-a.png ``` ## Alternatives I'd also be fine with removing this example from the list of examples that gets screenshot-tested in CI. Coverage from other 2d examples is probably adequate. --------- Co-authored-by: Alice Cecile <[email protected]>
- Loading branch information
1 parent
15440c1
commit 424e563
Showing
1 changed file
with
52 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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