Skip to content
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

Streamline invocation numbers in failed xml file #3181

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

krmahadevan
Copy link
Member

@krmahadevan krmahadevan commented Sep 30, 2024

Closes #3180

Fixes #3180 .

Did you remember to?

  • Add test case(s)
  • Update CHANGES.txt
  • Auto applied styling via ./gradlew autostyleApply

We encourage pull requests that:

  • Add new features to TestNG (or)
  • Fix bugs in TestNG

If your pull request involves fixing SonarQube issues then we would suggest that you please discuss this with the
TestNG-dev before you spend time working on it.

Note: For more information on contribution guidelines please make sure you refer our Contributing section for detailed set of steps.

Summary by CodeRabbit

  • New Features

    • Introduced a new RetryAnalyzer class for enhanced retry mechanisms in tests.
    • Added a comprehensive test suite in SampleTestContainer to demonstrate retry and data-driven testing scenarios.
  • Bug Fixes

    • Resolved issues with TestNG's data provider functionality and invocation counts.
    • Improved error handling and reporting for test results.
    • Fixed execution stalls when using the global thread pool.
  • Enhancements

    • Updated the assertEquals method for better failure messages.
    • Enhanced the report generation process for failed tests.
    • Improved handling of test method invocations and results.
  • Documentation

    • Updated documentation regarding PGP artifact signing keys and other relevant changes.

Copy link

coderabbitai bot commented Sep 30, 2024

Walkthrough

The pull request introduces version 7.11.0 of the software, focusing on bug fixes and minor enhancements. Key changes include improvements to TestNG's data provider functionality, updates to assertion methods for better error reporting, and refinements in test execution logic. Additionally, new classes and test cases are added to enhance testing capabilities, particularly around retries and invocation counts. The changes maintain backward compatibility while improving overall reliability and accuracy.

Changes

Files Change Summary
testng-asserts/src/test/java/org/testng/AssertTest.java Updated tests for deep equality assertions on sets, changing from HashSet to LinkedHashSet.
testng-core/src/main/java/org/testng/internal/invokers/TestInvoker.java Enhanced test method invocation logic, including exception handling and retry tracking.
testng-core/src/main/java/org/testng/reporters/FailedReporter.java Improved report generation for failed tests, adding caching and refining the XML output structure.
testng-core/src/test/java/test/invocationcount/FailedInvocationCountTest.java Added tests for invocation count behavior with data providers and retries.
testng-core/src/test/java/test/invocationcount/issue3180/RetryAnalyzer.java Introduced a new retry mechanism for handling test failures with a configurable retry limit.
testng-core/src/test/java/test/invocationcount/issue3180/SampleTestContainer.java Created a suite of tests demonstrating various retry and data-driven scenarios.

Assessment against linked issues

Objective Addressed Explanation
Ensure correct 'invocation-numbers' in testng-failed.xml (Issue #3180)
Address issue with data provider and success percentage causing tests to always pass (Issue #3180)

Possibly related issues

Possibly related PRs

Poem

🐰 In the garden where tests do play,
Bugs are fixed and brightened the day.
With retries and counts, we leap and bound,
In the realm of code, new joys are found!
Hopping through changes, oh what a sight,
TestNG's magic shines ever so bright! ✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

🧹 Outside diff range and nitpick comments (6)
testng-core/src/test/java/test/invocationcount/issue3180/RetryAnalyzer.java (1)

11-13: Improve or remove the comment above the retry method.

The comment "Retry method" above the retry method doesn't provide any additional information beyond what the method name already conveys. Consider either removing this comment or expanding it to provide more meaningful information about the method's behavior or usage.

If you decide to keep a comment, consider something more informative, like:

/**
 * Determines whether a failed test should be retried.
 * @param result The result of the test execution.
 * @return true if the test should be retried, false otherwise.
 */

This improved comment provides more context about the method's purpose and parameters.

testng-asserts/src/test/java/org/testng/AssertTest.java (2)

585-591: LGTM! Consider adding a comment explaining the use of LinkedHashSet.

The change from HashSet to LinkedHashSet is a good improvement as it ensures consistent ordering during deep equality checks. This addresses the issue described in GITHUB-3140.

Consider adding a brief comment explaining why LinkedHashSet is used instead of HashSet. This would help future maintainers understand the reasoning behind this specific implementation. For example:

// Using LinkedHashSet to ensure consistent ordering for deep equality checks
var expectedSet = new LinkedHashSet<>();

596-602: LGTM! Consider adding a comment for consistency with the previous test.

The change to use LinkedHashSet is consistent with the previous test method and correctly implements the failure case for deep equality checks.

For consistency with the previous test method, consider adding a brief comment explaining the use of LinkedHashSet. This would maintain a uniform style across related test cases. For example:

// Using LinkedHashSet to ensure consistent ordering for deep equality checks
var expectedSet = new LinkedHashSet<>();
CHANGES.txt (1)

Line range hint 9-2802: Review of historical changes

After scanning through the changelog, here are some significant historical changes and patterns that might still be relevant:

  1. Continuous improvement in parallel execution and thread management (e.g., GITHUB-1835, GITHUB-772, GITHUB-1173).
  2. Ongoing enhancements to reporting capabilities (e.g., GITHUB-1402, GITHUB-1213, GITHUB-1231).
  3. Regular updates to support newer Java versions and deprecate older features (e.g., GITHUB-2637, GITHUB-1456).
  4. Frequent improvements in handling data providers and factory methods (e.g., GITHUB-1241, GITHUB-1770, GITHUB-2669).
  5. Continuous refinement of group and method dependencies (e.g., GITHUB-1658, GITHUB-893, GITHUB-165).

These historical changes show a pattern of continuous improvement and adaptation to new Java features and testing paradigms. They also highlight areas that have required ongoing attention, such as concurrency, reporting, and complex test configurations.

Based on these historical changes, here are some architectural considerations for future development:

  1. Concurrency and Parallelism: Given the frequent updates in this area, it might be beneficial to review and possibly refactor the core concurrency model to make it more robust and easier to maintain.

  2. Reporting Framework: Consider developing a more modular and extensible reporting system to accommodate the frequent additions and changes to reporting features.

  3. Dependency Management: The ongoing refinements to group and method dependencies suggest that this area might benefit from a more flexible and powerful dependency resolution system.

  4. Java Version Support: Maintain a clear strategy for supporting new Java versions while gracefully deprecating support for older versions.

  5. Data Provider and Factory Method Handling: These features seem to be common pain points. Consider a comprehensive review and possible redesign of these systems to make them more robust and flexible.

By addressing these areas, TestNG could potentially reduce the frequency of related issues and provide a more stable and powerful testing framework for its users.

testng-core/src/test/java/test/invocationcount/FailedInvocationCountTest.java (1)

121-122: Clarify boolean variable naming for better readability

The boolean variables noXml and xmlSeen may cause confusion due to similar naming and opposite meanings. Consider renaming them to more descriptive names like xmlExpectedFalse and xmlExpectedTrue or combining them into a single variable for clarity.

Apply this diff to rename the variables:

- boolean noXml = false;
- boolean xmlSeen = true;
+ boolean xmlExpected = false;
+ boolean xmlExpected = true;

And update their usage accordingly in the test data:

 {SampleTestContainer.TestContainsFlakyDataDrivenTest.class, noXml, nothing},
 {SampleTestContainer.TestContainsPercentageDrivenTest.class, noXml, nothing},
 {SampleTestContainer.TestWithNormalFailingTest.class, xmlSeen, nothing},

Becomes:

 {SampleTestContainer.TestContainsFlakyDataDrivenTest.class, xmlExpectedFalse, nothing},
 {SampleTestContainer.TestContainsPercentageDrivenTest.class, xmlExpectedFalse, nothing},
 {SampleTestContainer.TestWithNormalFailingTest.class, xmlExpectedTrue, nothing},
testng-core/src/main/java/org/testng/reporters/FailedReporter.java (1)

88-91: Avoid Duplicate File Writes

At lines 89-90, the code writes failedSuite.toXml() to two directories:

Utils.writeUtf8File(outputDir, TESTNG_FAILED_XML, failedSuite.toXml());
Utils.writeUtf8File(suite.getOutputDirectory(), TESTNG_FAILED_XML, failedSuite.toXml());

Unless both writes are necessary, consider removing one to prevent redundant operations.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between f78cdbd and 8a568d4.

📒 Files selected for processing (7)
  • CHANGES.txt (1 hunks)
  • testng-asserts/src/test/java/org/testng/AssertTest.java (1 hunks)
  • testng-core/src/main/java/org/testng/internal/invokers/TestInvoker.java (1 hunks)
  • testng-core/src/main/java/org/testng/reporters/FailedReporter.java (7 hunks)
  • testng-core/src/test/java/test/invocationcount/FailedInvocationCountTest.java (3 hunks)
  • testng-core/src/test/java/test/invocationcount/issue3180/RetryAnalyzer.java (1 hunks)
  • testng-core/src/test/java/test/invocationcount/issue3180/SampleTestContainer.java (1 hunks)
🔇 Additional comments (8)
testng-core/src/test/java/test/invocationcount/issue3180/RetryAnalyzer.java (1)

1-5: LGTM: Package declaration and imports are correct.

The package declaration and imports are appropriate for the implementation of the RetryAnalyzer.

testng-asserts/src/test/java/org/testng/AssertTest.java (1)

585-602: Summary: Improved deep equality checks for sets

The changes in both testAssertEqualsDeepSet and testAssertEqualsDeepSetFail methods address the issue described in GITHUB-3140 by using LinkedHashSet instead of HashSet. This ensures consistent ordering during deep equality checks, improving the reliability of these tests.

These changes effectively solve the problem while maintaining the overall structure and purpose of the tests. The use of LinkedHashSet is an appropriate solution for ensuring consistent behavior in deep equality assertions involving sets.

CHANGES.txt (2)

Line range hint 1-2802: Conclusion of CHANGES.txt review

After reviewing the CHANGES.txt file, it's evident that TestNG is a mature and actively maintained project with a strong focus on continuous improvement. The changelog demonstrates:

  1. Regular releases with bug fixes and feature enhancements
  2. Responsiveness to user-reported issues (via GitHub)
  3. Ongoing efforts to improve core functionality such as parallel execution, reporting, and test configuration
  4. Adaptation to new Java versions and deprecation of older features
  5. Attention to performance and reliability

The project seems to be in a healthy state, with a good balance between fixing bugs, adding new features, and refining existing functionality. The frequent mentions of GitHub issues indicate an active community and good engagement with users.

However, there are a few areas that might benefit from additional attention:

  1. Some long-standing issues (like certain aspects of parallel execution and data provider handling) seem to require frequent tweaks. These might benefit from a more comprehensive review or refactoring.
  2. The frequency of changes related to reporting suggests that this area might need a more extensible architecture to accommodate future enhancements more easily.
  3. As the project continues to evolve, maintaining backward compatibility while introducing new features appears to be an ongoing challenge that requires careful management.

Overall, the CHANGES.txt file paints a picture of a robust, actively developed testing framework that is responsive to user needs and evolving alongside the Java ecosystem. Future development efforts might focus on addressing recurring themes in the changelog to create a more stable and maintainable codebase.


Line range hint 2-7: Review of changes in version 7.11.0

The changes in version 7.11.0 appear to be primarily bug fixes and minor enhancements. Here's a summary of the key points:

  1. Fixed an issue with 'invocation-numbers' calculation in testng-failed.xml (GITHUB-3180).
  2. Resolved a problem where specifying dataProvider and successPercentage caused tests to always pass (GITHUB-3170).
  3. Fixed an execution stall when using "use-global-thread-pool" (GITHUB-3028).
  4. Updated JCommander to version 1.83 (GITHUB-3122).
  5. Improved failure messages for array comparisons in assertEquals (GITHUB-3135).
  6. Fixed a deep comparison issue with Sets in assertEqualsDeep (GITHUB-3140).

These changes seem to address important issues and improve the overall functionality and reliability of TestNG. However, there are a few points that might benefit from further clarification or attention:

  1. For GITHUB-3180, it would be helpful to have more details on how the 'invocation-numbers' calculation was fixed and what the expected behavior is now.
  2. The fix for GITHUB-3170 (dataProvider and successPercentage interaction) might need additional testing to ensure it doesn't introduce any new edge cases.
  3. The execution stall fix (GITHUB-3028) could potentially impact performance in certain scenarios. It might be worth monitoring and gathering feedback from users on this change.

To verify the impact of these changes, especially the fix for the execution stall, we could run a performance test. Here's a script to check for any significant changes in execution time:

This script will help identify any potential performance regressions or improvements resulting from the changes in version 7.11.0.

testng-core/src/test/java/test/invocationcount/issue3180/SampleTestContainer.java (1)

1-106: LGTM!

The newly added test classes are well-structured and effectively cover various scenarios involving retries and data providers. This comprehensive test suite aligns with the PR objectives to address the calculation of 'invocation-numbers' in the testng-failed.xml file when using retries and data providers. The implementation is correct and follows TestNG best practices.

testng-core/src/main/java/org/testng/reporters/FailedReporter.java (2)

95-97: Ensure Thread Safety with 'keyCache' Access

The keyCache map is a shared resource accessed concurrently (lines 95-97). While ConcurrentHashMap is thread-safe for individual operations, compound operations may still lead to race conditions. Ensure that all usages of keyCache, especially computeIfAbsent in the isFlakyTest method, are safe in the context of concurrent execution.


142-146: Verify Logic for Identifying Flaky Tests

The logic at lines 144-145 skips tests that are repetitive or data-driven and have already passed (isFlakyTest). Ensure that this correctly identifies flaky tests and doesn't inadvertently skip tests that should be rerun.

testng-core/src/main/java/org/testng/internal/invokers/TestInvoker.java (1)

767-769: LGTM: Correctly handle failed invocation numbers when retries are disabled

The added condition ensures that failed invocation numbers are only recorded when the method will not be retried. This change aligns with the PR objective to streamline invocation numbers in the testng-failed.xml file and addresses the issue where incorrect invocation-numbers were reported for methods using retries and data providers.

Copy link
Member

@juherr juherr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm when the open points will be closed

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (4)
testng-core/src/test/java/test/invocationcount/FailedInvocationCountTest.java (3)

119-147: LGTM: Comprehensive data provider for invocation count scenarios.

The getTestData data provider covers a wide range of scenarios, including flaky tests and various invocation count cases, which aligns well with the PR objectives. This will help ensure that the fix for issue #3180 is robust.

Consider adding a brief comment for each test case to explain its purpose, which would improve readability and maintainability. For example:

// Test case 1: Flaky test that eventually passes
{SampleTestContainer.TestContainsFlakyDataDrivenTest.class, noXml, nothing},
// Test case 2: Repetitive test with success percentage
{SampleTestContainer.TestContainsPercentageDrivenTest.class, noXml, nothing},
// ... (comments for other test cases)

149-181: LGTM: Well-implemented test method for invocation count with retries and data providers.

This method effectively tests the invocation count behavior with retries and data providers, addressing the core of issue #3180. The implementation is thorough, checking both the existence of the XML file and its content.

Consider extracting the XML parsing and validation logic into a separate private method to improve readability and reusability. For example:

private void validateXmlContent(Path xml, String[] invocationCountValue) throws Exception {
    String xmlContent = Files.readString(xml);
    Document document = document(xmlContent);
    XPathFactory xPathFactory = XPathFactory.newInstance();
    XPath xPath = xPathFactory.newXPath();
    XPathExpression xPathExpression = xPath.compile("//methods/include");

    NodeList nodeList = (NodeList) xPathExpression.evaluate(document, XPathConstants.NODESET);
    assertThat(nodeList.getLength()).isEqualTo(invocationCountValue.length);
    SoftAssertions softly = new SoftAssertions();
    for (int i = 0; i < nodeList.getLength(); i++) {
        // ... (existing validation logic)
    }
    softly.assertAll();
}

Then, you can call this method from ensureInvocationCountHonoursRetriesWhenUsingDataProviders:

if (isXmlGenerated) {
    validateXmlContent(xml, invocationCountValue);
}

This would make the main test method more concise and easier to read.


Line range hint 1-258: Overall, excellent implementation addressing issue #3180.

The changes in this file effectively address the problem of invocation count calculation when using retries and data providers. The new test methods and data providers cover a comprehensive range of scenarios, including flaky tests and multiple test tags, which should thoroughly validate the fix for issue #3180.

Key strengths of this implementation:

  1. Comprehensive test scenarios covering various edge cases.
  2. Clear separation of concerns between data providers and test methods.
  3. Effective use of TestNG's XML suite capabilities for testing multiple test tags.

While there are opportunities for refactoring to reduce code duplication (as mentioned in previous comments), the current implementation is functional, clear, and achieves the objectives of the PR.

As the test suite grows, consider implementing a more modular approach to test case generation and validation. This could involve creating separate classes for test data generation, XML validation, and test execution, which would improve maintainability and scalability of the test suite in the long run.

testng-core/src/main/java/org/testng/internal/invokers/TestInvoker.java (1)

Line range hint 1022-1108: Improved parameter handling and error management in MethodInvocationAgent

The changes in the MethodInvocationAgent class, particularly in the invoke method, enhance the handling of parameters and error cases. This improvement contributes to more accurate reporting of invocation numbers and aligns with the PR objectives.

Key improvements:

  1. Use of ParameterHandler for creating parameters, which centralizes parameter handling logic.
  2. Explicit handling of errors during parameter creation, including proper status setting and notification.
  3. Clear separation of parallel and sequential test execution paths.

These changes should help address the issues with 'invocation-numbers' in the testng-failed.xml file, especially for methods using data providers and retries.

Consider adding a comment explaining the significance of the bubbleUpFailures flag, as it affects how certain failures are propagated:

 boolean bubbleUpFailures =
     m_configuration.isPropagateDataProviderFailureAsTestFailure()
         || bag.isBubbleUpFailures();
+// Determine if data provider failures should be treated as test failures
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 8a568d4 and 27ed972.

📒 Files selected for processing (7)
  • CHANGES.txt (1 hunks)
  • testng-asserts/src/test/java/org/testng/AssertTest.java (1 hunks)
  • testng-core/src/main/java/org/testng/internal/invokers/TestInvoker.java (1 hunks)
  • testng-core/src/main/java/org/testng/reporters/FailedReporter.java (4 hunks)
  • testng-core/src/test/java/test/invocationcount/FailedInvocationCountTest.java (3 hunks)
  • testng-core/src/test/java/test/invocationcount/issue3180/RetryAnalyzer.java (1 hunks)
  • testng-core/src/test/java/test/invocationcount/issue3180/SampleTestContainer.java (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • CHANGES.txt
  • testng-asserts/src/test/java/org/testng/AssertTest.java
  • testng-core/src/main/java/org/testng/reporters/FailedReporter.java
  • testng-core/src/test/java/test/invocationcount/issue3180/RetryAnalyzer.java
  • testng-core/src/test/java/test/invocationcount/issue3180/SampleTestContainer.java
🧰 Additional context used
📓 Learnings (1)
testng-core/src/test/java/test/invocationcount/FailedInvocationCountTest.java (1)
Learnt from: krmahadevan
PR: testng-team/testng#3181
File: testng-core/src/test/java/test/invocationcount/FailedInvocationCountTest.java:169-174
Timestamp: 2024-09-30T05:22:19.902Z
Learning: When using `SoftAssertions` in tests, apply soft assertions within loops, but use standard assertions outside of loops.
🔇 Additional comments (4)
testng-core/src/test/java/test/invocationcount/FailedInvocationCountTest.java (2)

5-15: LGTM: New imports are appropriate for the added functionality.

The added imports for XML processing, file handling, and assertions are necessary and relevant to the new methods implementing the fix for issue #3180.

Also applies to: 24-30, 35-35


254-258: LGTM: Simple XML parsing method.

The document method effectively parses an XML string into a Document object, which is suitable for the test code context.

As per the previous discussion, it was decided that the current implementation is acceptable for test code. However, it's worth noting that in a production environment, we would typically want to implement security measures against XML External Entity (XXE) attacks. If this code ever moves to a non-test context, please remember to update the XML parsing logic accordingly.

testng-core/src/main/java/org/testng/internal/invokers/TestInvoker.java (2)

Line range hint 1-1108: Summary of changes addressing PR objectives

The changes in this file effectively address the reported issues with 'invocation-numbers' in the testng-failed.xml file, specifically for methods using data providers and retries. The key improvements are:

  1. In the invokeMethod method, failed invocation numbers are only added when the method will not be retried, ensuring accurate reflection of 'invocation-numbers' in the testng-failed.xml file.
  2. The MethodInvocationAgent class has been enhanced to improve parameter handling and error management, which contributes to more accurate reporting of invocation numbers.

These changes align well with the PR objectives and should resolve the issues described in the linked issue #3180.

To ensure the changes work as expected, consider adding or updating unit tests that specifically target the scenario described in the issue, using data providers and retries to verify the correct 'invocation-numbers' are generated in the testng-failed.xml file.


767-769: Improvement in handling failed invocations for data-driven tests

This change addresses the issue with 'invocation-numbers' in the testng-failed.xml file. By only adding the failed invocation number when the method will not be retried, it ensures that the testng-failed.xml file accurately reflects the correct 'invocation-numbers' for methods that utilize data providers and retries.

To ensure this change doesn't introduce any regressions, please run the following verification:

@krmahadevan krmahadevan merged commit a126c4a into testng-team:master Oct 1, 2024
9 of 10 checks passed
@krmahadevan krmahadevan deleted the fix_3180 branch October 1, 2024 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TestNG testng-failed.xml 'invocation-numbers' values are not calculated correctly with retry and dataproviders
2 participants