-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 support for grouping tests with @TestTemplate #1450
Comments
Would support for "container templates" as proposed in #871 meet your needs? |
Not exactly. Mine would look more like this:
for this case #871 would produce something like this:
and what I have now (as a clarification):
So, I only have a single test, with multiple extensions giving the input. That method would still make copy pasting the same test give the desired output. These are uniform classes, serving as components, that alter the behavior of the class that uses it. With providers, I was able to put together a small setup, where I can test them in bulk, with inputs coming from text files. |
I think we could determine whether or not to group the invocations based on the number of supporting providers which is known up front. We would group them iff there is more than one provider that supports the template method. |
I'd really like if there was a way for me to name the groups. Preferebly via a method and not an annotation. I would also add an another thing to consider while grouping: Weather or not the providers provide the exact same class (not if they are instance of the required class). |
Sure, we could let them provide a name. I don‘t understand what you mean regarding the same class. Could you please provide some more details? |
On a second thought. I was actually thinking something stupid. The ability to just merge groups if desired is more proper approach to what I actually wanted. |
I was thinking something stupid. |
@Frontrider, what do you mean by "merge"? |
I think that's a pretty good idea. Are you suggesting we do that by default or make it an opt-in feature? Also, we'd need to consider how we build technical names, (default and custom) display names, and UIDs for those nodes, ensuring that filtering works as well. For a default display name, I think we could simply use the result of invoking For the technical name, I guess it could be simply an index of sorts. |
Agreed.
This request is more general than parameterized tests and should work for all |
As a second tough it's probably better to split the tests by extension as the default behavior, and by "merge", I mean to manually declare extensions to show up under the same label. That is an option which should be there, for the cases where we want to have them under the same label.
Yeah, that is something that I need, do I can integrate documentation a little better. |
This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. Thank you for your contribution. |
This issue has been automatically closed due to inactivity. If you have a good use case for this feature, please feel free to reopen the issue. |
Overview
I have a
@TestTemplate
method, which tests a group of classes that are different implementations of the sameinterface
. The test method is extended with multipleTestTemplateInvocationContextProvider
-s, each providing the different implementation, with their own test cases.I'd like to have a way give them a parent dynamically, so the different classes (
TestTemplateInvocationContextProvider
s) can show up in their own lists, without writing new test cases, for every single one of them.My goal is to make the test results easier to handle, by grouping them together, so they are not in the same list. (especially since they can have a lot of cases)
Proposal
Make
TestTemplateInvocationContextProvider
have a method, (getGroup
, orgetParent
are my suggestions) return a String which is the name used as thedisplay name
of the parent of every test provided by it. The parent class value for this test can either be set to nothing, the actual parent class, or the extension's class.Returning null, results in the current behavior.
The text was updated successfully, but these errors were encountered: