-
Notifications
You must be signed in to change notification settings - Fork 65
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.NUnit improvements #460
Merged
Merged
Conversation
This file contains 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
github-actions
bot
added
theme:build
theme:workflow
theme:nunit
and removed
type:improvement
labels
Mar 27, 2024
delatrie
force-pushed
the
nunit-fixes-2403
branch
2 times, most recently
from
March 27, 2024 23:08
6f53c62
to
6cbced8
Compare
delatrie
added
task:improvement
Change that improves some user experience but can't be considered a new feature
type:improvement
and removed
task:improvement
Change that improves some user experience but can't be considered a new feature
labels
Mar 27, 2024
delatrie
force-pushed
the
commons-fixes-2403
branch
from
March 28, 2024 10:50
efc568a
to
61705d9
Compare
delatrie
force-pushed
the
nunit-fixes-2403
branch
from
March 28, 2024 10:53
816b808
to
ec453c3
Compare
delatrie
force-pushed
the
commons-fixes-2403
branch
from
March 28, 2024 13:20
61705d9
to
0a561ad
Compare
delatrie
force-pushed
the
nunit-fixes-2403
branch
from
March 28, 2024 13:20
ec453c3
to
05946f5
Compare
- New algorithm to distinguish between failed/broken tests. Now, a test is failed if NUnit shows at least one failed assertion and no assertion errors. The 'brokenTestData' config property is removed. - Remove empty status details for passed tests (#363)
Additional changes: - Remove redundant config from Allure.NUnit project - Fix conflicting IgnoreTestWithTestCaseData test names in Allure.NUnit.Examples
- missing container if [AllureAfter] is applied to some, but not all OneTimeTearDown methods of a class - Fix IndexOutOfRangeException if [AllureAfter] is applied to a method with arguments
Every ignored test container contains no fixtures.
Backward compatibility is implemented via OldNamespaceCompatibility
- AllureNUnitHelper: - WrapInStep - SaveOneTimeResultToContext - AddOneTimeSetupResult - StepsHelper
delatrie
force-pushed
the
nunit-fixes-2403
branch
from
March 28, 2024 13:24
05946f5
to
cab2b44
Compare
epszaw
approved these changes
Mar 28, 2024
3 tasks
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
This PR improves the user experience with Allure NUnit.
Change of the namespace
The main namespace of the package now is
Allure.NUnit
. Users should adapt their code accordingly:NUnit.Allure.Core.AllureNUnitAttribute
->Allure.NUnit.AllureNUnitAttribute
NUnit.Allure.Attachments
->Allure.NUnit.Attachments
NUnit.Allure.Attributes.*
->Allure.NUnit.Attributes.*
The old
NUnit.Allure
namespace is still in place, but accessing it will trigger a deprecation warning.Improved error statuses reporting
Fixture and step errors
From a user's perspective, nothing has changed. The decision is not made by the code in Allure.Net.Commons, but the result is the same: exceptions of types
AssertionException
andNUnitException
make the step/fixturefailed
while exceptions of other types -broken
.Test errors
NUnit considers a test failed in the following cases:
NUnit doesn't give us an instance of the exception — only the list of assertion results and a final error message.
Previous implementation
An Allure test result is considered broken if the corresponding NUnit test error message contains at least one entry from the
brokenTestData
configuration property (typically, full names of exception types that should make tests broken). Otherwise, the test result is considered failed.That requires users to put all possible exception types in the config. Otherwise, test defects are reported as product ones.
New implementation
An Allure test result that corresponds to a failed NUnit test is considered broken in any of the following cases:
AssertionStatus.Error
) - that corresponds to an unhandled exception.Additionally, inconclusive tests and tests with warnings are reported as broken (that stayed the same).
The
brokenTestData
configuration property is ignored from now on.Api deprecation and removals
The following API is deprecated now:
The public API that had been previously deprecated was removed.
bool wrapIntoStep
parameter (had no effect).The following API that was meant to be internal is now hidden:
Other changes
[AllureAfter]
is applied to some but not all[OneTimeTearDown]
methods of a test fixture.[AllureAfter]
is applied to a method with arguments (fixes NUnit: IndexOutOfRangeException if AllureAfter is applied on a method with paramters #419).[AllureDisplayIgnoredAttribute]
is applied.allureConfig.json
was removed from Allure.NUnit source code.Allure.NUnit.Examples
was renamed so as not to collide with its non-ignored counterpart.