Skip to content

Improve tests using broad queries (Query<Entity>, Query<()>, etc)#21685

Merged
alice-i-cecile merged 4 commits into
bevyengine:mainfrom
Trashtalk217:test-robustness
Oct 29, 2025
Merged

Improve tests using broad queries (Query<Entity>, Query<()>, etc)#21685
alice-i-cecile merged 4 commits into
bevyengine:mainfrom
Trashtalk217:test-robustness

Conversation

@Trashtalk217

Copy link
Copy Markdown
Contributor

Objective

Tests should be more resilient to entities added on World creation. This is necessary for resources-as-components to work without relying on DefaultQueryFilters.

Solution

I've added an empty entity during World::bootstrap() and ran the test suite (and CI). I've gone and fixed every test, except for the ones where it's not possible / doesn't make sense. Both iter_entities and iter_entities_mut and their tests have been removed as they were deprecated in 0.17.

@Trashtalk217 Trashtalk217 added A-ECS Entities, components, systems, and events C-Testing A change that impacts how we test Bevy or how users test their apps D-Trivial Nice and easy! A great choice to get started with Bevy labels Oct 29, 2025
@Trashtalk217 Trashtalk217 added the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label Oct 29, 2025
@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 29, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Oct 29, 2025
Merged via the queue into bevyengine:main with commit b1df264 Oct 29, 2025
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ECS Entities, components, systems, and events C-Testing A change that impacts how we test Bevy or how users test their apps D-Trivial Nice and easy! A great choice to get started with Bevy S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants