-
Notifications
You must be signed in to change notification settings - Fork 531
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
[SUREFIRE-1727] junitplatform: handle all containers #257
Conversation
Interesting small change set for that generalization. Did you check that reports still work with "all containers", especially those, that are not class/method based? |
It's more of a work in progress. |
yes surefire will upgrade the ReportEntry with the container name(s) but i hope it is not mandatory in this PR. |
Which containers are not class/method based? Do we have those in our integration tests? |
The |
@@ -410,11 +410,19 @@ public void allDiscoveredTestsAreInvokedForNullArgument() | |||
InOrder inOrder = inOrder( runListener ); | |||
|
|||
ArgumentCaptor<SimpleReportEntry> report = ArgumentCaptor.forClass( SimpleReportEntry.class ); | |||
inOrder.verify( runListener ) | |||
inOrder.verify( runListener, times( 2 ) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the second call of testSetStarting
?
I just want to understand it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The engine container.
In theory one testplan can contain both the normal Jupiter engine and also the "Vintage" engine (which will execute Junit4 tests). Also more engines can be written by users.
|
||
SimpleReportEntry engine = report.getAllValues().get( 0 ); | ||
Assertions.assertThat( engine.getSourceName() ) | ||
.isEqualTo( "JUnit Jupiter" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to this we should chceck the XML reports.
This may appear in the report and that's wrong because it is an engine and not a class.
We have another issue for the Cucumber where the ReportEntry has to be updated.
But still not sure if this is needed to transfer engine name in this issue we have here.
All subclasses of
Ah, yes that makes sense. I somehow interpreted it as sourcefile |
@t-8ch |
@Tibor17 The problem is that currently there is no entity in surefire to report the error on. So the idea was to first expose all containers to surefire and then allow the reporting of errors on them. |
I fear that even if we find a specific workaround for this one case by for example reporting it onto the class instead of the factory method this will break down as soon as more exotic test hierarchies are used. (Also I will have to read the ticket you linked) |
Now i know what you mean but this is the same in JUnit4. |
Ah, ok. This make sense. I'll try this tomorrow. |
@t-8ch |
Maybe keep this PR for the future motivation in SUREFIRE-1724 and open a new one for SUREFIRE-1727. oki? |
Junit 5 can nest test containers arbitrarily deep. They also do not have to relate to classes or methods.
@Tibor17 I just overrode the PR with a new patch. WDYT? |
no problem. |
@t-8ch |
It looks mostly the same, only that for my issue the source of the container is a MethodSource while there it is a ClassSource.
This would not work for my case, as it is neither a class nor a test. |
@t-8ch Additionally, I tried to avoid |
"Mostly the same" was from the "RunListener" perspective. Both are failed containers. |
@t-8ch |
I will take another look at it. |
Closed in favor of #267 . |
Junit 5 can nest test containers arbitrarily deep.
They also do not have to relate to classes or methods.