Skip to content

Support composed flaky, muted, and severity annotations across Java test adapters#1331

Merged
baev merged 1 commit into
mainfrom
fix-flaky-mute-severity
Jul 22, 2026
Merged

Support composed flaky, muted, and severity annotations across Java test adapters#1331
baev merged 1 commit into
mainfrom
fix-flaky-mute-severity

Conversation

@baev

@baev baev commented Jul 21, 2026

Copy link
Copy Markdown
Member

Context

Allure Java now recognizes @Flaky, @Muted, and @Severity when they are composed into custom annotations, including nested compositions. These annotations work at method and class level with JUnit Platform, JUnit 4, Spock 2, and TestNG. An explicitly declared @Severity continues to take precedence over a composed value.

@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.TYPE})
@Flaky
@Muted
@Severity(SeverityLevel.CRITICAL)
public @interface CriticalUnstable {
}

The custom annotation can then provide consistent reporting metadata across a test suite:

@CriticalUnstable
@Test
void retriesPaymentAfterTransientFailure() {
    // ...
}

@CriticalUnstable
class ExperimentalCheckoutTests {
    // ...
}

JUnit Platform and JUnit 4 also retain flaky and muted flags when failed tests add exception details, while JUnit 4 and Spock 2 now report severity consistently with the other adapters.

Checklist

@baev baev added the pr:improvement Change that improves some user experience but can't be considered as a new feature label Jul 21, 2026
@github-actions

Copy link
Copy Markdown

Allure Report Summary

Name Duration Stats New Flaky Retry Report
Allure Java – Pull request #1331 28m 59s Passed tests 2007   Skipped tests 2 34 0 0 View
Allure Java GitHub actions run (2026-07-21T16:44:19.188Z) 28m 59s Passed tests 2007   Skipped tests 2 34 0 0 View

@baev
baev merged commit 79e85c5 into main Jul 22, 2026
10 checks passed
@baev
baev deleted the fix-flaky-mute-severity branch July 22, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:improvement Change that improves some user experience but can't be considered as a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants