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

#[itest(skip)] + #[itest(focus)] #146

Merged
merged 6 commits into from
Mar 6, 2023
Merged

#[itest(skip)] + #[itest(focus)] #146

merged 6 commits into from
Mar 6, 2023

Conversation

Bromeon
Copy link
Member

@Bromeon Bromeon commented Mar 5, 2023

Follow-up to #142.

Two new test features:

  • #[itest(skip)] ignores the current test, and shows the number of skipped tests in a statistic at the end of the run.
    • This is better than empty tests with // TODO or commented-out tests, as it reminds you of the technical debt and gives an impression of its extents.
  • If at least one test is annotated with #[itest(focus)], then only "focused" tests are run.
    • Extremely helpful during debugging sessions, or when one is working on a very particular feature.
    • If Godot is invoked with -- --disallow-focus, focus runs will always fail (for CI, to avoid accidental disabling of tests).

This is not yet implemented for GDScript. Might be worth it, or might not.

Apart from that, this PR massively simplifies the internal APIs to parse #[attribute(key, key2="value")] attributes.

@Bromeon Bromeon added quality-of-life No new functionality, but improves ergonomics/internals c: tooling CI, automation, tools labels Mar 5, 2023
bors bot added a commit that referenced this pull request Mar 5, 2023
@bors
Copy link
Contributor

bors bot commented Mar 5, 2023

try

Build succeeded:

@Bromeon Bromeon force-pushed the feature/test-focus-skip branch 5 times, most recently from ba0ecdc to e27175c Compare March 6, 2023 19:49
Prevents accidental disabling of tests in CI (during development).
@Bromeon Bromeon force-pushed the feature/test-focus-skip branch 3 times, most recently from 31fc7b8 to 1a4a47a Compare March 6, 2023 20:14
@Bromeon
Copy link
Member Author

Bromeon commented Mar 6, 2023

Added support for itest to be invoked with the Godot command-line argument -- --disallow-focus.

If provided, focus runs will always fail. This is used in CI, so we prevent that accidental #[test(focus)] result in green GitHub Action runs, while disabling all integration tests 🙂

It's only used in the memcheck CIs though, so that minimal-ci still passes during PR updates.

bors r+

@bors
Copy link
Contributor

bors bot commented Mar 6, 2023

Build succeeded:

@bors bors bot merged commit 7d42ebb into master Mar 6, 2023
@bors bors bot deleted the feature/test-focus-skip branch March 6, 2023 20:31
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.

1 participant