Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Add ambiguity detection tests #6053

Closed
wants to merge 14 commits into from

Conversation

JoJoJet
Copy link
Member

@JoJoJet JoJoJet commented Sep 21, 2022

Objective

Solution

  • Refactor ambiguity detection internals to make it testable. As a bonus, this should make it easier to extend in the future.

Notes

@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events C-Code-Quality A section of code that is hard to understand or change labels Sep 21, 2022
@alice-i-cecile alice-i-cecile added this to the Bevy 0.9 milestone Sep 21, 2022
@alice-i-cecile
Copy link
Member

Looks good to me so far. Let me know when you're ready for review.

@JoJoJet JoJoJet marked this pull request as ready for review September 21, 2022 23:13
Copy link
Contributor

@BorisBoutillier BorisBoutillier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have mainly reviewed the tests, to see if I could understand them ( and thus the ambiguity cases).


let mut test_stage = SystemStage::parallel();
test_stage
.add_system(empty_system)
Copy link
Contributor

@BorisBoutillier BorisBoutillier Sep 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first, while trying to understand each test and its expected output, I wondered why this system (empty_system) was added for this test.
(and I cloned your repository to run the test with report_ambiguities, to be sure I was not misunderstanding something with the expected value of 3).
So, personally, I would not have added empty_system here, or added a comment to say it should not conflict.
But is also fine as is, of course.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't write these tests, I just made them compile haha. I'm not entirely sure what the motivation was for adding the empty system, but it may have been to make sure it doesn't flag a false positive somehow. This would probably make more sense as its own test, though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that was the intent. It should be split out into it's own test though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I don't think it even needs its own test. This case is already covered in read_only, so I'll just remove the empty system from read_world.

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Sep 22, 2022
@alice-i-cecile
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Sep 22, 2022
# Objective

- Add unit tests for ambiguity detection reporting.
- Incremental implementation of #4299.

## Solution

- Refactor ambiguity detection internals to make it testable. As a bonus, this should make it easier to extend in the future.

## Notes

* This code was copy-pasted from #4299 and modified. Credit goes to @alice-i-cecile and @afonsolage, though I'm not sure who wrote what at this point.
@bors
Copy link
Contributor

bors bot commented Sep 22, 2022

Build failed:

@mockersf
Copy link
Member

blocked on #6063

@alice-i-cecile
Copy link
Member

bors retry

bors bot pushed a commit that referenced this pull request Sep 22, 2022
# Objective

- Add unit tests for ambiguity detection reporting.
- Incremental implementation of #4299.

## Solution

- Refactor ambiguity detection internals to make it testable. As a bonus, this should make it easier to extend in the future.

## Notes

* This code was copy-pasted from #4299 and modified. Credit goes to @alice-i-cecile and @afonsolage, though I'm not sure who wrote what at this point.
@bors
Copy link
Contributor

bors bot commented Sep 22, 2022

@bors bors bot changed the title Add ambiguity detection tests [Merged by Bors] - Add ambiguity detection tests Sep 22, 2022
@bors bors bot closed this Sep 22, 2022
@JoJoJet JoJoJet deleted the ambiguity-struct branch September 22, 2022 20:33
james7132 pushed a commit to james7132/bevy that referenced this pull request Oct 19, 2022
# Objective

- Add unit tests for ambiguity detection reporting.
- Incremental implementation of bevyengine#4299.

## Solution

- Refactor ambiguity detection internals to make it testable. As a bonus, this should make it easier to extend in the future.

## Notes

* This code was copy-pasted from bevyengine#4299 and modified. Credit goes to @alice-i-cecile and @afonsolage, though I'm not sure who wrote what at this point.
james7132 pushed a commit to james7132/bevy that referenced this pull request Oct 28, 2022
# Objective

- Add unit tests for ambiguity detection reporting.
- Incremental implementation of bevyengine#4299.

## Solution

- Refactor ambiguity detection internals to make it testable. As a bonus, this should make it easier to extend in the future.

## Notes

* This code was copy-pasted from bevyengine#4299 and modified. Credit goes to @alice-i-cecile and @afonsolage, though I'm not sure who wrote what at this point.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
# Objective

- Add unit tests for ambiguity detection reporting.
- Incremental implementation of bevyengine#4299.

## Solution

- Refactor ambiguity detection internals to make it testable. As a bonus, this should make it easier to extend in the future.

## Notes

* This code was copy-pasted from bevyengine#4299 and modified. Credit goes to @alice-i-cecile and @afonsolage, though I'm not sure who wrote what at this point.
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-Code-Quality A section of code that is hard to understand or change 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.

5 participants