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

allure-testng: add property to disable configuration failures logging #920

Merged
merged 12 commits into from
Jun 28, 2023

Conversation

iFatRain
Copy link
Contributor

@iFatRain iFatRain commented May 25, 2023

Context

This will give users the choice of not logging @Before/@after methods that experience errors (fail/broken) as standalone methods in the report, as is the default behavior.

This PR enables configuration capabilities for the feature added in (#274). That feature has been requested to be modified or removed on a few occasions (#356 which this addresses and also in #316). With this change, you are still able to see the failure reason and stacktrace in the Skipped test's before stages and main fail cause if that information is needed, while keeping TestNG's behavior consistent with a failed configuration not resulting in a failed test case (Since no test ran).

By using allure.properties and setting 'allure.testng.log.configuration.failures=false' the default process of creating the 'fake test' for the SetUp/TearDown will be bypassed, resulting only in the original test showing as skipped.
This should allow for the report to more accurately reflect only test cases pass/fail/broken/skip, and not report on configuration issues, which can be very important in certain situations.

Checklist

@CLAassistant
Copy link

CLAassistant commented May 25, 2023

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the theme:testng TestNG related issue label May 25, 2023
@iFatRain iFatRain marked this pull request as draft May 26, 2023 14:01
@iFatRain iFatRain marked this pull request as ready for review May 26, 2023 14:01
@baev baev added the type:improvement Change that improves some user experience but can't be considered as a new feature label Jun 2, 2023
Copy link
Member

@baev baev left a comment

Choose a reason for hiding this comment

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

Great job!

Please add a test that will check that only one skipped result is provided in case there is a configuration failure, and the new setting is set.

@iFatRain
Copy link
Contributor Author

iFatRain commented Jun 2, 2023

Great job!

Please add a test that will check that only one skipped result is provided in case there is a configuration failure, and the new setting is set.

New unit test added that asserts when setting is used, only the main test shows as skipped, and not the configuration

@iFatRain iFatRain closed this Jun 2, 2023
@iFatRain iFatRain reopened this Jun 2, 2023
@iFatRain
Copy link
Contributor Author

iFatRain commented Jun 2, 2023

Didn't mean to close the PR, mouse being funny clicked the wrong button near the [Comment]

@iFatRain iFatRain requested a review from baev June 2, 2023 15:16
@iFatRain
Copy link
Contributor Author

@baev The PR is now ready for review and should be ready to merge afterwards. Just awaiting your followup :)

@iFatRain
Copy link
Contributor Author

@baev Requested changes have been implemented, requesting another review. I took liberty to also fix another similar test to conform with the requested changes.

@iFatRain iFatRain requested a review from baev June 21, 2023 16:11
Copy link
Member

@baev baev left a comment

Choose a reason for hiding this comment

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

👍 great work. One more comment

@baev
Copy link
Member

baev commented Jun 27, 2023

please, fix the build

@iFatRain
Copy link
Contributor Author

@baev Okay, for real this time, I think it should be fully ready to go. All wording was changed from log -> hide, and the default value is now False to match the other config property. Added @SuppressWarnings("PMD.NcssCount") so it should build now. Thanks for all the back and fourth

I am about to go on an (mostly) offline vacation but will check back just in case anything else is needed. Looking forward to the release this gets added into :)

@baev baev changed the title Enable Configurable Logging for Pre/Post Test Methods (fixes #356\) allure-testng: add property to disable configuration failures logging Jun 28, 2023
@baev baev merged commit 3e3f173 into allure-framework:master Jun 28, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme:testng TestNG related issue type:improvement Change that improves some user experience but can't be considered as a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants