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

Add a warning when running itest through the editor. #412

Merged

Conversation

mhoff12358
Copy link
Contributor

They need to be run through an exported binary, so print a readable warning and don't try to run the tests if someone (like me) does try.

@GodotRust
Copy link

API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-412

@mhoff12358
Copy link
Contributor Author

@Bromeon This seems to fail CI because the CI is running it through the editor, just in a different way. Dang.

@Bromeon
Copy link
Member

Bromeon commented Sep 17, 2023

I think has_feature("editor") is the wrong check; it checks whether the Godot binary is an editor build. See also Godot docs, although they're not very expressive here.

I'm not sure if this is even possible -- but since you experience a crash when launching from editor but not when from command line, there must be some sort of observable behavior that differs. I just don't know whether there's an API...

@Bromeon Bromeon added quality-of-life No new functionality, but improves ergonomics/internals c: tooling CI, automation, tools labels Sep 17, 2023
@Bromeon
Copy link
Member

Bromeon commented Sep 30, 2023

@mhoff12358 Any updates on this one?

@StatisMike
Copy link
Contributor

I wonder if reverse approach can be sensible:

I presume we are talking about running tests with check.sh as credible way. Maybe we could pass an environment variable in the command line there, which could be checked by TestRunner. If the environment variable is set to correct value, tests would go as expected. If not - then issue the error.

@Bromeon Bromeon force-pushed the mhoff12358/editor_itest_warning branch from 82926ba to 1be971e Compare November 19, 2023 14:58
@Bromeon
Copy link
Member

Bromeon commented Nov 19, 2023

I found a better option: check whether editor is running (dynamically, not via feature) and if we are in headless mode.

Changed the commit accordingly. Thanks for this addition and the input!

@Bromeon Bromeon added this pull request to the merge queue Nov 19, 2023
Merged via the queue into godot-rust:master with commit 3e28201 Nov 19, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: tooling CI, automation, tools quality-of-life No new functionality, but improves ergonomics/internals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants