Skip to content

[allure-testng] Attachment on failed config is not added to the failed configuration method #776

Closed

Description

@baflQA

Describe the bug
There is a test with a configuration method (BeforeMethod) that fails with an exception.
There is an IConfigurationListener implementation provided, that creates an attachment on failed configuration.
An attachment is expected to be present in the report inside the failed configuration method container, but it is not.
An attachment can be found in the allure-results directory but seems not to be attached to any test container.

To Reproduce
Steps to reproduce the behaviour:

  1. Run https://github.com/baflQA/allure-java/blob/master/allure-testng/src/test/java/io/qameta/allure/testng/AllureTestNgTest.java#L710 test

Expected behaviour
An attachment added on failed configuration is added to the failed configuration method.

Additional context
Provided a fork to reproduce an issue
https://github.com/baflQA/allure-java

Activity

  1. baflQA commented on Jun 20, 2022

    @baflQA
    ContributorAuthor

    Hi @baev! Would You be able to have a look?

  2. baev commented on Jun 21, 2022

    @baev
    Member

    I'm not sure we will ever support such behaviour since Allure uses listeners itself to collect data from TestNG and we can't control the listeners order

  3. baev commented on Jun 21, 2022

    @baev
    Member

    in most cases as workaround you can use AllureLifecycle listeners instead of TestNG listeners

  4. baflQA commented on Jun 21, 2022

    @baflQA
    ContributorAuthor

    Ok, I will have a look.
    But my idea was that MAYBE all the logic of collecting the results of a before configuration methods should be handled inside onConfigurationSuccess/onConfigurationFailure methods of IConfigurationListener.

  5. added theissue type on Jul 10, 2026
  6. added a commit that references this issue on Sep 18, 2026
    59c1722
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions