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

BILLING-2504: Allow buck to run tests on nested test classes #33

Open
wants to merge 1 commit into
base: v2022.05.05.01
Choose a base branch
from

Conversation

JoeAxeAddepar
Copy link

When running tests, buck looks for the @test annotation on one or more methods.

JUnit 5 provides the @nested annotation to group tests within a class. This is useful for testing methods of a class, allowing them to have dedicated setup, teardown and custom methods. Additionally JUnit groups the tests in the output.

When running a file with only @tests within @nested classes, buck will not run the test file. It will do this silently. This PR forces buck to also look into @nested classes for methods annotated with @test to determine whether the file is a test file or not.

Copy link

@RichardM-Addepar RichardM-Addepar left a comment

Choose a reason for hiding this comment

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

LGTM, clean solution :)

return mightBeJunit5TestClass(c);
}
}

Choose a reason for hiding this comment

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

This might be a good time to include @TestFactory too

Copy link
Author

Choose a reason for hiding this comment

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

I think tbh given the magnitude of editing buck, I'll leave that until it's required! (Unless it's required right now?) I'm a bit apprehensive about editing / testing this whole lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants