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

Support JUnit TestNG engine #296

Merged
merged 6 commits into from
Jul 15, 2024
Merged

Support JUnit TestNG engine #296

merged 6 commits into from
Jul 15, 2024

Conversation

pshevche
Copy link
Member

Summary

SAP reports a number of issues when TestNG run with JUnit TestNG Engine are retried:

  1. Methods with dependencies are not retried.
  2. Lifecycle failure retries are reported as unsuccessful.
  3. All these failures result in a Build Scan not being published.

This PR addresses the first two and I manually verified that the fix also resolves Build Scan publication errors. The plan forward is to release a Develocity plugin RC with this fix and validate with the customer if all of the issues are resolved.

@pshevche pshevche requested a review from a team July 11, 2024 14:01
@pshevche pshevche self-assigned this Jul 11, 2024
.filter(test -> testFrameworkStrategy.isExpectedUnretriedTest(entry.getKey(), test))
.collect(Collectors.toSet())
));
expectedUnretriedTests.forEach((className, tests) -> previousRoundFailedTests.remove(className, tests::contains));
Copy link
Member Author

Choose a reason for hiding this comment

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

💬 Ideally, we would also report failed descriptors as successful, but at this point, we have no clue where in the hierarchy they belong or how to construct a valid descriptor.

With all of the issues with the TestNG reporting, it seems like putting lipstick on a pig. So, I suggest not to bother and just make sure that retries work correctly.

@pshevche pshevche force-pushed the pshevche/support-testng-engine branch 2 times, most recently from 8c6e2aa to 0e804e3 Compare July 11, 2024 14:07
@pshevche pshevche force-pushed the pshevche/support-testng-engine branch from 0e804e3 to 5f18200 Compare July 12, 2024 07:08
pshevche added 6 commits July 12, 2024 09:09
Signed-off-by: Pavlo Shevchenko <pshevchenko@gradle.com>
Signed-off-by: Pavlo Shevchenko <pshevchenko@gradle.com>
Signed-off-by: Pavlo Shevchenko <pshevchenko@gradle.com>
Signed-off-by: Pavlo Shevchenko <pshevchenko@gradle.com>
Signed-off-by: Pavlo Shevchenko <pshevchenko@gradle.com>
Signed-off-by: Pavlo Shevchenko <pshevchenko@gradle.com>
@pshevche pshevche force-pushed the pshevche/support-testng-engine branch from 5f18200 to f2ce44e Compare July 12, 2024 07:09
@@ -205,7 +244,7 @@ class TestNGFuncTest extends AbstractFrameworkFuncTest {

public class OrderedTests {
@Test(dependsOnMethods = {"childTest"})
public void grandchildTest() {}
public void grandChildTest() {}

Choose a reason for hiding this comment

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

Afaik grandchild is a single word, so the case could be made to leave the casing as-is

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree, it is hard to make assertions, though, because childTest matches both the childTest and the grandchildTest.

@pshevche pshevche merged commit 899dc9a into main Jul 15, 2024
6 checks passed
@pshevche pshevche deleted the pshevche/support-testng-engine branch July 15, 2024 14:20
@pshevche pshevche added this to the 1.5.10 milestone Jul 16, 2024
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.

2 participants