arquillian-core icon indicating copy to clipboard operation
arquillian-core copied to clipboard

TestResult instance is not properly produced using Junit5 inside the container

Open TheOnlyAl opened this issue 1 year ago • 7 comments

Issue Overview

I believe there is a problem when running Junit5 tests in the container because the TestResult instance is not set before the After phase is executed. In my opionion this leads for example to the following issue: https://github.com/arquillian/arquillian-extension-transaction/issues/31

Junit4 seems to corretly inject the result. Propably by using UpdateTestResultBeforeAfter.java

Expected Behaviour

The TestResult should be set before the After phase is executed for Junit5 tests.

Current Behaviour

The TestResult is not set.

Steps To Reproduce

I created a small project (arquillian-junit5-container-testresultfix) which uses an custom Extension to check if the TestResult is set and also provides an Extension which provides a workaround for the problem.

To check if the result is not set, you could:

  1. Check out the project
  2. Run the Tests

The tests will all succeed as long the the result is not set. When this is fixed at least the UnfixedTestResultIT.java should fail

Additional Information

I did a lot of debugging for this problem since it basically makes most of my tests using transactions fail. It is quite hard to really understand where the problem is. It could be a missing interceptor, missing observer, or something else.

Since there is also seems currently no other easys way for extensions to get the Result of a test after its run but before the After phase is called, i am not sure how else extensions should work.

Checked for: Arquillian 1.8.0.Final

Please just tell me if you need any more information. I am happy to try to help as much as possible.

TheOnlyAl avatar Feb 20 '24 11:02 TheOnlyAl