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

Introduce zero invocations in test templates and parameterized tests #3890

Merged
merged 6 commits into from
Oct 15, 2024

Conversation

nskvortsov
Copy link
Contributor

@nskvortsov nskvortsov commented Jul 17, 2024

Add a flag to ParameterizedTest to control arguments requirement. This allows users to explicitly opt out from validation of arguments set count and silently skip a test if no arguments are provided

In general, support TestTemplateInvocationContextProvider returning zero invocation contexts. Such providers must override new interface method to indicate that the framework should expect "no context returned"

Resolves #1477

Overview

Implemented the team decision described in this comment


I hereby agree to the terms of the JUnit Contributor License Agreement.


Definition of Done

@pain64
Copy link

pain64 commented Jul 24, 2024

Need this feature a lot! Is there a forecast for when it will be ready?

Copy link
Member

@marcphilipp marcphilipp left a comment

Choose a reason for hiding this comment

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

Looks very promising! 👍

nskvortsov added a commit to nskvortsov/junit5 that referenced this pull request Oct 2, 2024
Updated `since` tag values, improved naming.
nskvortsov added a commit to nskvortsov/junit5 that referenced this pull request Oct 2, 2024
Updated `since` tag values, improved naming.
nskvortsov added a commit to nskvortsov/junit5 that referenced this pull request Oct 13, 2024
Make error messaging even more precise. Print out the provider class
that did not return any template invocation contexts.
@nskvortsov
Copy link
Contributor Author

Let me know if you are ok with the latest change, I will do the rebase.

@marcphilipp marcphilipp self-assigned this Oct 15, 2024
@marcphilipp
Copy link
Member

Let me know if you are ok with the latest change, I will do the rebase.

Thanks for making the changes. I'll take it from here!

nskvortsov and others added 6 commits October 15, 2024 10:44
Add a flag to ParameterizedTest to control arguments requirement. This
allows users to explicitly opt out from validation of arguments set
count and silently skip a test if no arguments are provided

In general, support TestTemplateInvocationContextProvider returning zero
invocation contexts. Such providers must override new interface method
to indicate that the framework should expect "no context returned"

Resolves junit-team#1477
@marcphilipp marcphilipp merged commit ddcf99b into junit-team:main Oct 15, 2024
15 checks passed
@marcphilipp
Copy link
Member

@nskvortsov Thank you! 👍

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.

Introduce support for zero invocations in test templates and parameterized tests
4 participants