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] - bevy_reflect: Add compile fail tests for bevy_reflect #7041

Closed

Conversation

MrGVSV
Copy link
Member

@MrGVSV MrGVSV commented Dec 27, 2022

Objective

There isn't really a way to test that code using bevy_reflect compiles or doesn't compile for certain scenarios. This would be especially useful for macro-centric PRs like #6511 and #6042.

Solution

Using bevy_ecs_compile_fail_tests as reference, added the bevy_reflect_compile_fail_tests crate.

Currently, this crate contains a very simple test case. This is so that we can get the basic foundation of this crate agreed upon and merged so that more tests can be added by other PRs.

Open Questions

  • Should this be added to CI? (Answer: Yes)

Changelog

  • Added the bevy_reflect_compile_fail_tests crate for testing compilation errors

@MrGVSV MrGVSV added A-Reflection Runtime information about types C-Testing A change that impacts how we test Bevy or how users test their apps labels Dec 27, 2022
@nicopap nicopap added the X-Controversial There is active debate or serious implications around merging this PR label Dec 27, 2022
@alice-i-cecile
Copy link
Member

This definitely needs to be added to CI. I also don't think this is controversial. @nicopap what was your reasoning? :)

@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 Dec 27, 2022
@MrGVSV MrGVSV force-pushed the reflect-compile-fail-foundations branch from 87908b2 to 2d8f6f9 Compare December 27, 2022 21:00
@MrGVSV
Copy link
Member Author

MrGVSV commented Dec 27, 2022

Let me know if I made those CI changes incorrectly or not. I basically just copied the ECS compile fail stuff

.gitignore Outdated Show resolved Hide resolved
@alice-i-cecile
Copy link
Member

CI changes look correct to me, but @mockersf may have complaints.

@alice-i-cecile alice-i-cecile removed 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 Dec 27, 2022
tools/ci/src/main.rs Outdated Show resolved Hide resolved
tools/ci/src/main.rs Outdated Show resolved Hide resolved
@mockersf
Copy link
Member

I chose to keep it nested like this to keep the crates dir clean

I would prefer to have this one at the same level than the ecs compile fail tests

@james7132
Copy link
Member

I would prefer to have this one at the same level than the ecs compile fail tests

I'd advocate for a dedicated directory for these kinds of tests and others, like larger integration and E2E tests, which we may need in the further future as the number of engine features and their interactions start cross-pollinating.

@MrGVSV
Copy link
Member Author

MrGVSV commented Dec 27, 2022

I would prefer to have this one at the same level than the ecs compile fail tests

I'd advocate for a dedicated directory for these kinds of tests and others, like larger integration and E2E tests, which we may need in the further future as the number of engine features and their interactions start cross-pollinating.

Should I move both into a single directory in this PR then? And if so, is it one crate or just one directory containing multiple crates?

@james7132
Copy link
Member

james7132 commented Dec 27, 2022

Should I move both into a single directory in this PR then? And if so, is it one crate or just one directory containing multiple crates?

Up to you. I think it adds a lot of noise and should probably be done in it's own PR. The top level tests directory is basically unused right now. It could go there, but it we could also use another directory if someone else has a stronger opinion about this.

@alice-i-cecile
Copy link
Member

I'd prefer it live in tests, but moved in a seperate PR.

@MrGVSV MrGVSV force-pushed the reflect-compile-fail-foundations branch from 2d8f6f9 to 4404c68 Compare December 28, 2022 05:03
@MrGVSV MrGVSV requested review from james7132 and mockersf December 28, 2022 05:04
@MrGVSV
Copy link
Member Author

MrGVSV commented Dec 28, 2022

Moved the crate into crates/ from where I originally had it in crates/bevy_reflect.

@nicopap
Copy link
Contributor

nicopap commented Dec 28, 2022

@alice-i-cecile The change updating top level files, I thought this necessarily fell into "heightened standard of approval" as per the CONTRIBUTING.md my bad if I misinterpreted it.

@alice-i-cecile
Copy link
Member

Ah understandable. In this case @cart has already endorsed the idea of compile fail tests in general and for bevy_reflect in particular, and this is the consistent way to implement these.

@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 X-Controversial There is active debate or serious implications around merging this PR labels Dec 28, 2022
@MrGVSV MrGVSV force-pushed the reflect-compile-fail-foundations branch from 4404c68 to 32cecbd Compare December 28, 2022 17:55
.gitignore Outdated Show resolved Hide resolved
@alice-i-cecile
Copy link
Member

Ping @MrGVSV on the gitgnore question: it's easy to miss in the resolved comment thread.

@MrGVSV MrGVSV force-pushed the reflect-compile-fail-foundations branch from 32cecbd to 5c9efbe Compare December 29, 2022 04:56
@cart
Copy link
Member

cart commented Jan 2, 2023

bors r+

bors bot pushed a commit that referenced this pull request Jan 2, 2023
# Objective

There isn't really a way to test that code using bevy_reflect compiles or doesn't compile for certain scenarios. This would be especially useful for macro-centric PRs like #6511 and #6042.

## Solution

Using `bevy_ecs_compile_fail_tests` as reference, added the `bevy_reflect_compile_fail_tests` crate.

Currently, this crate contains a very simple test case. This is so that we can get the basic foundation of this crate agreed upon and merged so that more tests can be added by other PRs.

### Open Questions

- [x] Should this be added to CI? (Answer: Yes)

---

## Changelog

- Added the `bevy_reflect_compile_fail_tests` crate for testing compilation errors
@bors bors bot changed the title bevy_reflect: Add compile fail tests for bevy_reflect [Merged by Bors] - bevy_reflect: Add compile fail tests for bevy_reflect Jan 2, 2023
@bors bors bot closed this Jan 2, 2023
alradish pushed a commit to alradish/bevy that referenced this pull request Jan 22, 2023
# Objective

There isn't really a way to test that code using bevy_reflect compiles or doesn't compile for certain scenarios. This would be especially useful for macro-centric PRs like bevyengine#6511 and bevyengine#6042.

## Solution

Using `bevy_ecs_compile_fail_tests` as reference, added the `bevy_reflect_compile_fail_tests` crate.

Currently, this crate contains a very simple test case. This is so that we can get the basic foundation of this crate agreed upon and merged so that more tests can be added by other PRs.

### Open Questions

- [x] Should this be added to CI? (Answer: Yes)

---

## Changelog

- Added the `bevy_reflect_compile_fail_tests` crate for testing compilation errors
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
# Objective

There isn't really a way to test that code using bevy_reflect compiles or doesn't compile for certain scenarios. This would be especially useful for macro-centric PRs like bevyengine#6511 and bevyengine#6042.

## Solution

Using `bevy_ecs_compile_fail_tests` as reference, added the `bevy_reflect_compile_fail_tests` crate.

Currently, this crate contains a very simple test case. This is so that we can get the basic foundation of this crate agreed upon and merged so that more tests can be added by other PRs.

### Open Questions

- [x] Should this be added to CI? (Answer: Yes)

---

## Changelog

- Added the `bevy_reflect_compile_fail_tests` crate for testing compilation errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Reflection Runtime information about types C-Testing A change that impacts how we test Bevy or how users test their apps S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants