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

[tests-only] removing the setresponse in given/when/then step in ocs and webdavlocking context #7347

Merged
merged 5 commits into from
Oct 2, 2023

Conversation

KarunAtreya
Copy link
Contributor

@KarunAtreya KarunAtreya commented Sep 25, 2023

Description

We have used setResponse() and $this->response in the Given/Then steps and some helper functions (maybe to reuse existing available methods). But storing responses from Given/Then steps and helper functions is not a good idea because it can lead to a false positive assertion in the Then steps.
So, check the use of setResponse() and $this->response in

  • Given steps
  • Then steps (Then steps can use $this->response but must prevent saving to it)
  • Helper functions

So this pr make the above changes in OCSContext and WebDavLockingContext

Related Issue

#7082

Motivation and Context

  • To remove setResponse() and $this->response in the Given/Then steps and some helper functions
  • To avoid false positive assertions

How Has This Been Tested?

  • test environment:
  • locally
  • CI

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@KarunAtreya KarunAtreya self-assigned this Sep 25, 2023
@KarunAtreya KarunAtreya force-pushed the refactor_ocsContext_webdavlockingContext branch 3 times, most recently from b10824d to 8d2ddbf Compare September 26, 2023 11:23
@KarunAtreya KarunAtreya force-pushed the refactor_ocsContext_webdavlockingContext branch 2 times, most recently from 567ae26 to 4809191 Compare September 27, 2023 03:45
@KarunAtreya KarunAtreya marked this pull request as ready for review September 27, 2023 04:28
@KarunAtreya KarunAtreya force-pushed the refactor_ocsContext_webdavlockingContext branch from 645a0f2 to f5b0928 Compare October 2, 2023 03:27
@KarunAtreya KarunAtreya force-pushed the refactor_ocsContext_webdavlockingContext branch from f5b0928 to 8efeab3 Compare October 2, 2023 06:07
@KarunAtreya KarunAtreya changed the title [tests-only][full-ci] removing the setresponse in given/when/then step in ocs and webdavlocking context [tests-only] removing the setresponse in given/when/then step in ocs and webdavlocking context Oct 2, 2023
@KarunAtreya KarunAtreya force-pushed the refactor_ocsContext_webdavlockingContext branch from 8efeab3 to 037ed09 Compare October 2, 2023 10:41
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 2, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Member

@saw-jan saw-jan left a comment

Choose a reason for hiding this comment

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

👍 ✨

Copy link
Member

@SagarGi SagarGi left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@saw-jan saw-jan merged commit 87f1235 into master Oct 2, 2023
2 checks passed
@delete-merged-branch delete-merged-branch bot deleted the refactor_ocsContext_webdavlockingContext branch October 2, 2023 11:15
ownclouders pushed a commit that referenced this pull request Oct 2, 2023
…and webdavlocking context (#7347)

* refactor given and when steps in ocs and webdav locking context

* use the returned response

* use of returned response from helper function

* made changes to the affected test steps

* deleted vardump line
ownclouders pushed a commit that referenced this pull request Oct 3, 2023
…and webdavlocking context (#7347)

* refactor given and when steps in ocs and webdav locking context

* use the returned response

* use of returned response from helper function

* made changes to the affected test steps

* deleted vardump line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants