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

An exception detected by VertxTestContext is not being informed to Junit5's ExtensionContext object in an beforeAll method #86

Open
cvgaviao opened this issue Sep 19, 2020 · 1 comment

Comments

@cvgaviao
Copy link

cvgaviao commented Sep 19, 2020

Describe the feature

Junit5 allows multiple extensions to work together inside one test class. Those extensions can share data and errors through the ExtensionContext object.

Any extension can use the method extensionContext.getExecutionException().isPresent() to detect when an error have occurred in any of other used extensions and took a properly path. In my case, to prevent the running of an unnecessary code.
The problem I'm facing is when executing a vert.x future inside a beforeAll() method and the test class is using a @TestInstance(Lifecycle.PER_CLASS).
An exception thrown by the future is not being rethrown by the VertxExtension in this case, it is only rethrowing an exception in the joinActiveTestContexts method (not reached in beforeAll methods).

Contribution

I'm willing in providing a PR for this, but I want to be sure if this is desired by the people that are responsible for vertx-junit5 before putting my hands on it.

@cvgaviao cvgaviao changed the title An exception detected by VertxTestContext is not being informed to Junit5's ExtensionContext object An exception detected by VertxTestContext is not being informed to Junit5's ExtensionContext object in an beforeAll method Sep 20, 2020
@jponge
Copy link
Member

jponge commented Sep 21, 2020

Thanks for the report.

Would you have a reproducer to highlight the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants