-
Notifications
You must be signed in to change notification settings - Fork 20
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
Unable to Run Test Suite Class Not Enclosed #54
Comments
Hi,
thank you for reporting this issue.
I'm on vacation and can't check it out right now but maybe someone else has
an idea what's going on in the meantime?
…On Tue, Sep 20, 2022, 00:35 D3Castro ***@***.***> wrote:
I'm attempting to run test suites using sbt test, however, I am unable to
resolve a runtime exception from the dispatcher. I've created the below
repository to replicate the issue.
https://github.com/D3Castro/Junit5ModuleTestSuite
[error] WARNING: TestExecutionListener
[net.aichler.jupiter.internal.event.Dispatcher] threw exception for method:
executionFinished(TestIdentifier [uniqueId =
[engine:junit-platform-suite]/[suite:com.test.TestSuite]/[engine:junit-jupiter]/[class:com.test.junit.SimpleClassTest],
parentId =
[engine:junit-platform-suite]/[suite:com.test.TestSuite]/[engine:junit-jupiter],
displayName = 'SimpleClassTest', legacyReportingName =
'com.test.junit.SimpleClassTest', source = ClassSource [className =
'com.test.junit.SimpleClassTest', filePosition = null], tags = [], type =
CONTAINER], TestExecutionResult [status = SUCCESSFUL, throwable = null])
[error] java.lang.RuntimeException: Test class
com.test.junit.SimpleClassTest is not enclosed by com.test.TestSuite
[error] at
net.aichler.jupiter.internal.event.TaskName.nestedSuiteId(TaskName.java:135)
[error] at
net.aichler.jupiter.internal.event.TaskName.of(TaskName.java:110)
[error] at
net.aichler.jupiter.internal.event.Dispatcher.lambda$executionFinished$2(Dispatcher.java:99)
[error] at
java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1705)
[error] at
net.aichler.jupiter.internal.event.Dispatcher.executionFinished(Dispatcher.java:95)
[error] at
org.junit.platform.launcher.core.CompositeTestExecutionListener.lambda$executionFinished$10(CompositeTestExecutionListener.java:69)
—
Reply to this email directly, view it on GitHub
<#54>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFBC4NIGTLUYSCGTHELHCLV7DTB5ANCNFSM6AAAAAAQQQTXYU>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Is there anything related to the setup which may be causing this that I could investigate? |
I think the issue is caused by using To be sure I have to investigate a bit more and try to isolate it in a test case to see how we can fix it. But this might take a while I'm afraid. Best bet for a short term solution would be to not use |
Any chances for |
The original problem is - like @maichler explained – that TaskName cannot handle the name. Credit for the idea behind the fix goes to @maichler, too. As the JUnit 5 suite support is added via an own engine, we can just extend the check in TaskName for the nested tests to additionally check if the test engine is the JUnit5-Engine. Just to be on the safe side, I added nested tests inside the suite definition and the test ran by the suite definition to make sure I didn't break it. Nezisi/sbt-jupiter-interface@bump-sbt-1_8...Nezisi:sbt-jupiter-interface:fix-junit5-suite-support The PR is based up on the SBT 1.9 pull request, I'll wait with the PR until it's merged. |
Here's #87, which takes the above branch and applies it on top of main now that I've bumped sbt version etc. |
* Reproduce #54 * Dispatcher: Use NestedSuiteSelector / NestedTestSelector (SBT 1.3) * Configuration: test identifier: filter out identifiers not containing source - e.g. the platform (skipped by path.stream().skip(1) - e.g. for JUnit 5 suites the engine used to start the test in the test suite * TaskName: remove JUnit 5 suite name if present, add tests * Adjust the expected value --------- Co-authored-by: H. Habighorst <[email protected]>
I'm attempting to run test suites using
sbt test
, however, I am unable to resolve a runtime exception from the dispatcher. I've created the below repository to replicate the issue.https://github.com/D3Castro/Junit5ModuleTestSuite
The text was updated successfully, but these errors were encountered: