Skip to content

Stop sharding the gameplay tests twice on CI - #1034

Merged
4ian merged 3 commits into
mainfrom
claude/gameplay-tests-starters-6jb8r0
Aug 9, 2026
Merged

Stop sharding the gameplay tests twice on CI#1034
4ian merged 3 commits into
mainfrom
claude/gameplay-tests-starters-6jb8r0

Conversation

@4ian

@4ian 4ian commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

On main, the all-games job was testing 4 of the 45 games instead of all of them.

What was happening

run-gameplay-tests.js defaulted its shard to CIRCLE_NODE_INDEX/CIRCLE_NODE_TOTAL, which CircleCI sets on every container as soon as parallelism is above 1. The games were therefore cut down three times over:

Step Games
all games with gameplay tests 45
--list (sharded by the env vars) 12
circleci tests split splits that again 3
the run shards what is left once more 1

Reproduced locally by setting the same variables:

$ node scripts/run-gameplay-tests.js --list | wc -l
45
$ CIRCLE_NODE_TOTAL=4 CIRCLE_NODE_INDEX=0 node scripts/run-gameplay-tests.js --list | wc -l
12
$ CIRCLE_NODE_TOTAL=4 CIRCLE_NODE_INDEX=0 node scripts/run-gameplay-tests.js --projects-file=three-games.txt --list
examples/starting-clicker/starting-clicker.json      # 3 in, 1 out

The changed job was unaffected because its parallelism is 1, so the variables never kicked in — which is why only the all-games job looked wrong.

This also explains the No timing found for ... lines: circleci tests split --split-by=timings looks up each game in the timings recorded by store_test_results, and with only four games ever run there were no timings for the rest. It should settle on its own once every game runs again.

The fix

Sharding now only happens when --shard-index/--shard-total are passed explicitly. The CI splits with circleci tests split, which balances by recorded timings; the script runs what it is given.

After the change, with the same environment variables set:

Before After
--list on a container 12 45 (full list, for circleci tests split to divide)
a 3-game --projects-file 1 3
explicit --shard-total=4 --shard-index=0 12 12 (unchanged)

Not changed: the screenshots

Checked separately — the artifacts are correct, there is simply nothing to store. No test calls harness.takeScreenshot(...) (0 across all 45 games), and the harness only captures when asked, so a failing test produces no screenshot either. The storage path itself works: with a test that does take one, the artifacts come out as

examples__starting-quiz__starting-quiz/
  gdevelop-output.log
  results.json
  gameplay-test-screenshots/screenshot_probe-frame-4-after_the_first_question_appeared.jpg

Making failures self-documenting would mean capturing a screenshot automatically when a test fails, which belongs in the GDevelop harness rather than here.

🤖 Generated with Claude Code

https://claude.ai/code/session_01M2jc7PVAvmMmirAQude2v1


Generated by Claude Code

The runner defaulted its shard to CIRCLE_NODE_INDEX/CIRCLE_NODE_TOTAL, which
CircleCI sets on every container as soon as parallelism is above 1. The
all-games job therefore cut the run down twice: `--list` printed only this
container's quarter of the games, `circleci tests split` split that quarter
again, and the run sharded what was left once more. With 4 containers each
one ended up testing a single game, so 4 of the 45 games with gameplay tests
were tested on main instead of all of them.

Sharding now only happens when --shard-index/--shard-total are passed
explicitly. The CI splits with `circleci tests split`, which balances by the
timings recorded by store_test_results; this script runs what it is given.

That also explains the "No timing found" lines: with only four games ever
run, there were no timings for any of the others.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M2jc7PVAvmMmirAQude2v1
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Preview the game(s) changed or added in this Pull Request


This is an automatic message displaying links to the games in this PR - double check the JSON in case of doubt.

claude added 2 commits August 9, 2026 20:58
One test per game, for the ones whose result is worth looking at: the tank's
target after the shell exploded on it, the target that was shot at in the
first person shooter, the car past the finish line, the RTS selection walking
to where it was sent, the two 3D boards after a piece was dropped or a tile
placed, the RPG scene after the NPC was answered, the first person farming
inventory holding the harvested seed, and both platformers once their coins
are collected.

They are 9 to 17 KB each and the CI already stores them next to the results
of the game they belong to.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M2jc7PVAvmMmirAQude2v1
The message only said "the gameplay tests runner or the CI configuration
changed", leaving the reader to work out which of the six files it was, and
why a Pull Request that touches no game was testing all 45 of them. It now
names the file and says what it implies.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M2jc7PVAvmMmirAQude2v1
@4ian
4ian merged commit 3d43648 into main Aug 9, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants