-
Notifications
You must be signed in to change notification settings - Fork 238
Add DataProvider execution support to Allure TestNG setup section #1236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DataProvider execution support to Allure TestNG setup section #1236
Conversation
This commit implements IDataProviderListener in AllureTestNg to report DataProvider executions as fixtures in the Allure report. - Implemented beforeDataProviderExecution, afterDataProviderExecution, and onDataProviderFailure. - DataProvider executions now appear in the 'Set up' section. - Attachments added within DataProviders are now visible. - Failed DataProviders are correctly reported with BROKEN status. - Added tests to verify correct reporting of successful and failed DataProviders.
Previously, DataProvider fixtures were attached to the Class container, causing them to appear in the setup of all tests within that class. This commit creates a dedicated container for each DataProvider execution and links it only to the specific test method requesting the data. This ensures that DataProvider execution details (and failures) are correctly associated only with the relevant tests.
…ailures - Changed dataProviderContainerUuidStorage to use computeIfAbsent to reuse the existing container for a test method if it already exists (e.g. during retry). - Added currentExecutable.remove() in beforeDataProviderExecution to force generation of a new UUID for each execution attempt, ensuring retries are captured as distinct fixtures even if TestNG suppresses failure events or we missed cleanup. - Added FlakyDataProvider sample and test case to verify retry reporting.
Updated container count expectations in multipleSuites and parallelMethods tests to account for the new DataProvider execution containers introduced by the fix.
|
Hey @baev - be So kind to review this Pr when You have some time 🙏 |
|
Great job! Could you please add tests to check the following:
|
…Test Updated assertions to use more concise methods and removed unnecessary code. This enhances code clarity and maintainability.
256b59b to
e8068ef
Compare
I hope that this is done. |
baev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@baflQA great job 👍 |
|
Thanks. What are the next steps? I am looking forward to the next release including this feature 🤞 |
|
@skuznetsov-al will review the code and merge it if everything is on point, shouldn't take long |
|
Hey there! When can i expect the next allure-Java release? |
Context
TestNG DataProviders are a vital part of the test lifecycle, but their execution was previously invisible in Allure reports. This made it difficult to debug issues occurring during data generation or to see attachments (like API logs or database queries) added within a DataProvider method.
This PR implements IDataProviderListener in the AllureTestNg adapter to capture DataProvider executions as fixtures in the "Set up" section of the Allure report.
Key features:
Checklist