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

Prevent removal of ErrorSpecNode by Maven #1447

Merged
merged 4 commits into from
Mar 14, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Override JUnit's TestDescriptor.mayRegisterTests for ErrorSpecNode
Fixes #1444.
  • Loading branch information
kriegaex committed Mar 14, 2022
commit 8c3e8b4c2c3e45940ec7c0fb9d921edd516102e6
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ public void removeFromHierarchy() {
// For example, gradle will report that no test were found, and not report the actual error.
}

@Override
public boolean mayRegisterTests() {
// Maven Surefire removes nodes if org.junit.platform.launcher.TestPlan.containsTests is false.
// The easiest way to avoid this, is to return true here. This seems to work and not to bother Gradle either.
return true;
}

@Override
public SpockExecutionContext prepare(SpockExecutionContext context) throws Exception {
return ExceptionUtil.sneakyThrow(error);
Expand Down