question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Junit 5] Steps are missing in report in case if test failed in @BeforeAll()

See original GitHub issue

I’m submitting a …

  • bug report

What is the current behavior?

Report is empty If test fails in method under @BeforeAll() annotation. allure-results folder contain data, but this data is not displayed in final html report. See screenshots below as example.

What is the expected behavior?

Methods annotated with @BeforeAll() annotation should be processed and displayed in report the same as methods annotated with @BeforeEach() annotation.

Please tell us about your environment:

Allure version 2.13.2
Test framework junit5@5.6.2
Allure integration allure-junit5@2.13.2

Other information

@BeforeAll() Screenshot from 2020-05-20 12-27-39

@BeforeEach()

Screenshot from 2020-05-20 12-32-53

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:10
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
Legionivocommented, Aug 26, 2020

@Legionivo did you find any workaround for this issue?

Hello, nope, I didn’t, because I did not try to search workaround.

1reaction
martinsefcikcommented, Jul 19, 2022

It looks like it is happening because of missing child (container -> result) reference in test container json file.

I was able to get it working correctly by modifying io.qameta.allure.junitplatform.AllureJunitPlatform#stopTestContainer method. I commented the following if there:

//        if (testIdentifier.isTest()) {
            getTest(testIdentifier).ifPresent(children::add);
//        }

I’m not sure yet if this change will break something else or not, but existing junits in allure-junit-platform module are passing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JUnit 5 does not execute method annotated with BeforeEach
In my case the problem was that the @Test annotation was taken from wrong import. Originally it was imported from org.junit.Test .
Read more >
JUnit 5 User Guide
Beginning with Java 16, @BeforeAll and @AfterAll methods can be declared as static in a @Nested test class with either test instance lifecycle ......
Read more >
Migrating from JUnit 4 to JUnit 5 | The IntelliJ IDEA Blog
Manual Migration for More Complex Cases ... If the tests in the project are fairly straightforward ones, this automatic migration should take care ......
Read more >
Getting @BeforeAll and @AfterAll behaviour with Cucumber ...
No standard solution in Cucumber JVM ... The execution is controlled mostly by the step implementations. There is a fixed set of supported...
Read more >
Maven Surefire Plugin – Using JUnit 5 Platform
This is the only step that is required to get started - you can now create tests in your test source directory (e.g.,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found