Title: 🐞: [JUnit 5] Incorrect suite status in Allure report when @BeforeAll fails on first run but passes on retry · Issue #1155 · allure-framework/allure-java · GitHub
Open Graph Title: 🐞: [JUnit 5] Incorrect suite status in Allure report when @BeforeAll fails on first run but passes on retry · Issue #1155 · allure-framework/allure-java
X Title: 🐞: [JUnit 5] Incorrect suite status in Allure report when @BeforeAll fails on first run but passes on retry · Issue #1155 · allure-framework/allure-java
Description: What happened? We are using JUnit 5 with Gradle and the test-retry-gradle-plugin plugin to rerun failed tests. We encountered an issue with Allure reports where a test class is still marked as "failed" even though all tests passed on ret...
Open Graph Description: What happened? We are using JUnit 5 with Gradle and the test-retry-gradle-plugin plugin to rerun failed tests. We encountered an issue with Allure reports where a test class is still marked as "fai...
X Description: What happened? We are using JUnit 5 with Gradle and the test-retry-gradle-plugin plugin to rerun failed tests. We encountered an issue with Allure reports where a test class is still marked as &quo...
Opengraph URL: https://github.com/allure-framework/allure-java/issues/1155
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"🐞: [JUnit 5] Incorrect suite status in Allure report when @BeforeAll fails on first run but passes on retry","articleBody":"### What happened?\n\nWe are using JUnit 5 with Gradle and the [test-retry-gradle-plugin](https://github.com/gradle/test-retry-gradle-plugin) plugin to rerun failed tests. We encountered an issue with Allure reports where a test class is still marked as \"failed\" even though all tests passed on retry.\n\n**Problem**\nIf @BeforeAll fails in the first run, no tests inside the class are executed.\nOn retry, @BeforeAll succeeds, and all tests pass.\n\nIn the Allure report:\n- All individual tests are marked as passed ✅.\n- But the entire test class is still marked as failed ❌.\n\u003cimg width=\"1395\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/e7fa1921-8dad-4377-b796-51be594aea79\" /\u003e\n\n\n\n:confused: This creates confusion in reports and CI pipelines, because the actual final result is 100% passed.\n\n✅ Desired Behavior\nIf @BeforeAll fails during the first attempt but succeeds on retry, it should not appear in the Allure report.\n\nIf @BeforeAll fails during all retry attempts, the current behavior is correct — the test class should be marked as failed.\n\n**The easiest way to reproduce:**\n\n1. Create a test class like this:\n\n```\n@TestInstance(TestInstance.Lifecycle.PER_CLASS)\nclass RetryBeforeAllTest {\n\n @BeforeAll\n void beforeAll() {\n throw new RuntimeException(\"Simulated failure in @BeforeAll\");\n }\n\n @Test\n void test1() {\n Assertions.assertTrue(true);\n }\n\n @Test\n void test2() {\n Assertions.assertTrue(true);\n }\n\n @Test\n void test3() {\n Assertions.assertTrue(true);\n }\n\n}\n```\n\n2. Run the test suite once — it will fail due to @BeforeAll.\n3. Then comment out the exception in @BeforeAll, and run the test suite again.\n4. Generate Allure report (execute allureServe for example)\n\n### What Allure Integration are you using?\n\nallure-junit5\n\n### What version of Allure Integration you are using?\n\n2.29.1\n\n### What version of Allure Report you are using?\n\n2.29.1\n\n### Code of Conduct\n\n- [x] I agree to follow this project's Code of Conduct","author":{"url":"https://github.com/yevhenii-odd","@type":"Person","name":"yevhenii-odd"},"datePublished":"2025-04-08T09:58:47.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1155/allure-java/issues/1155"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:42f74f79-bd92-1ea4-30bb-92fb60538e9d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AABE:38A719:48246A:612FBA:696E97AF |
| html-safe-nonce | 523918e4a34e61ebc56b96229986110ce50e08b966b946639747b5eda4b289d1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQUJFOjM4QTcxOTo0ODI0NkE6NjEyRkJBOjY5NkU5N0FGIiwidmlzaXRvcl9pZCI6IjQ1NzIyNjQ4NTE4NDg0NjgzOTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | cce9b15433890fb679c3f22ec96095a130baea993ec5d95973b1164a75b567f4 |
| hovercard-subject-tag | issue:2979259016 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/allure-framework/allure-java/1155/issue_layout |
| twitter:image | https://opengraph.githubassets.com/30ec38c4988c8b2da8ffeb0a68cd9fcb649fcb6da24043b0416fc89c0f359655/allure-framework/allure-java/issues/1155 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/30ec38c4988c8b2da8ffeb0a68cd9fcb649fcb6da24043b0416fc89c0f359655/allure-framework/allure-java/issues/1155 |
| og:image:alt | What happened? We are using JUnit 5 with Gradle and the test-retry-gradle-plugin plugin to rerun failed tests. We encountered an issue with Allure reports where a test class is still marked as "fai... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | yevhenii-odd |
| hostname | github.com |
| expected-hostname | github.com |
| None | fdad15fd2ad43212aa8b8be5f2c2725550f8374ceeeb154a999ad9145b43f3f7 |
| turbo-cache-control | no-preview |
| go-import | github.com/allure-framework/allure-java git https://github.com/allure-framework/allure-java.git |
| octolytics-dimension-user_id | 5879127 |
| octolytics-dimension-user_login | allure-framework |
| octolytics-dimension-repository_id | 80822758 |
| octolytics-dimension-repository_nwo | allure-framework/allure-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 80822758 |
| octolytics-dimension-repository_network_root_nwo | allure-framework/allure-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 27b23bc056eb973d350fc95afc848757edb9e7a9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width