-
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
Open
baflQA
wants to merge
7
commits into
allure-framework:main
Choose a base branch
from
baflQA:feature/dataprovider-setup
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+579
−11
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Contributor
Author
|
Hey @baev - be So kind to review this Pr when You have some time 🙏 |
Member
|
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
Contributor
Author
I hope that this is done. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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