-
Notifications
You must be signed in to change notification settings - Fork 233
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
Update version of TestNG to the latest #323
Comments
this is fixed in |
@ILikeToNguyen - fyi - I'm re-opening this for follow-up. It looks like the change breaks SeLion's soft assert and session sharing. If you run the default "client" test suite there will be failures. This needs more investigation. Hopefully, we can fix this and don't need to revert to the older version of TestNG. |
Reason why our existing code doesn't throw an AssertionException for our softasserts with a bump from TestNG 6.9.10: Before it only checked that a throwable was set which we did in SeLionSoftAssert.assertAll(). Since the code when in that if statement then, the test case was treated as a failure and testng framework threw that throwable exception. How? You will see here is where a test method is invoked here Testng doesnt read the status value and sets it to success and uses its own logic to determing if the test result failed by setting it to failed in a catch on line 661. Therefore the only way a test can fail is if it throws an exception. (I feel that this is incorrect behavior, I think it should read testResult's status value first before setting it to SUCCESS. I will put a PR into TestNG and see what they think, if they intended to give users the ability to set the test results via Reporter.getCurrentTestResult(). So we eventually get to handleInvocationResults which now has the status set incorrectly on m_status So the solution is that in assertAll, we can't just set Reporter's ITestResult to FAILED, we must throw that exception out and let the framework set the result to failed and catch the exception and set the m_throwable for us. |
Here is the Pull Request to TestNG to have it fixed at the source instead of trying to work around it. Throwing an exception instead of setting the testResults works in the simple case of SeLionSoftAsserts when we call assertAll() directly in the test. However, if we use SeLionAsserts.verify and rely on the listener to call assertAll() for the user, that doesnt work with us throwing an exception. Has to do with throwing the exception from a Listener in an afterInvocation. |
@ILikeToNguyen thanks for the update. looking forward to the TestNG version with this fix. :) |
I am seeing another issue with RuntimeReporter where same test is reported twice in final report. Seems to be happening due to this bug in testng. I tested locally on my fork with TestNG v6.10 and it seems to be working fine. I am not sure if I need to open another issue for RuntimeReporter since it is related to TestNG version upgrade? |
@vikram1711 Confirming your find -- the current 2.0.0-SNAPSHOT version of SeLion is using TestNG 6.9.10. I have not seen the same test reported twice in the final report. Is this the version combinations you were using where you observed the behavior? Furthermore, you saw it go away with SeLion 2.0.0-SNAPSHOT and TestNG 6.10? |
Ok, so I tried both Maven and TestNG eclipse plugin with v6.9.10. Maven run is working fine and I don't see any duplicates in report but when I am running the suite using eclipse plugin, I am seeing this issue. Issue can be reproduced- Issue can't be reproduced- |
@vikram1711 Thanks for the additional details! |
We are currently using 6.9.10 and the latest is 6.9.12. One fix this addresses is that SeLionAssert verify failures show as passed in the emailable-report instead of failed due to a break in 6.9.X at some point. Setting the test result in TestNG's Reporter class so that is shows it in the emailable report is fixed in 6.9.11
The text was updated successfully, but these errors were encountered: