Repository navigation
[Tests-Only] Do not overwrite user information when testing duplicate user creation - #37917
Merged
Merged
Conversation
phil-davis
force-pushed
the
do-not-overwrite-original-user-in-tests
branch
from
September 18, 2020 06:20
6bbbd4e to
ccaa115
Compare
Codecov Report
@@ Coverage Diff @@
## master #37917 +/- ##
=========================================
Coverage 64.75% 64.75%
Complexity 19408 19408
=========================================
Files 1285 1285
Lines 75830 75830
Branches 1336 1336
=========================================
Hits 49101 49101
Misses 26335 26335
Partials 394 394
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
delete-merged-branch
Bot
deleted the
do-not-overwrite-original-user-in-tests
branch
September 18, 2020 06:21
This was referenced Sep 18, 2020
This file contains hidden or 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
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.
Description
Some test scenarios purposely try to create a user twice, to check that the 2nd user create request fails. They do this with different case of
userid(username), because you should not be able to create bothbrand-new-userandBRAND-NEW-USERThe test code remembers the users that have been created, so it can delete those users in the
afterScenariocleanup of the test. But some test steps are remembering "again" the 2nd version of theuseridand overwriting the first value. That means that, for example, the actual user on the system-under-test isbrand-new-userbut theafterScenariotries to deleteBRAND-NEW-USER. Actually that will work fine on a system-under-test that has a "correct" Provisioning API "delete" method. But on a system-under-test that is in development, a small problem in the Provisioning API can cause "bonus" test failures that impact on later scenarios.In
afterScenariowe should try as best we can to use the "lowest-risk" API calls to do the cleanup actions that reset the system back to a known state.In this PR the code is more careful that if the user create was not successful then to not overwrite any memory it already has about the existence of that user. That will ensure that deleting users in the
afterScenariois done using the exact sameuseridthat was used to create the user.This should help with owncloud/ocis#587 - preventing the "duplicate user creation" tests from messing up later test scenarios.
How Has This Been Tested?
CI
Types of changes
Checklist: