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][full-ci] removing the setresponse in given/then step in CheckSumContext and FavoritesContext #7202

Merged
merged 5 commits into from
Sep 11, 2023

Conversation

KarunAtreya
Copy link
Contributor

@KarunAtreya KarunAtreya commented Sep 4, 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 CheckSumContext.php and FavoritesContext

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 4, 2023
@KarunAtreya KarunAtreya changed the title [tests-only][full-ci] removing the setresponse in given/then step in CheckSumContext.php [tests-only][full-ci] removing the setresponse in given/then step in CheckSumContext Sep 4, 2023
@KarunAtreya KarunAtreya changed the title [tests-only][full-ci] removing the setresponse in given/then step in CheckSumContext [tests-only][full-ci] removing the setresponse in given/then step in CheckSumContext and FavoritesContext Sep 5, 2023
@KarunAtreya KarunAtreya force-pushed the refactor_settingreponse branch from 0d5a721 to 56774ce Compare September 5, 2023 06:05
@KarunAtreya KarunAtreya force-pushed the refactor_settingreponse branch from b175a18 to 3ed9431 Compare September 6, 2023 10:08
@KarunAtreya KarunAtreya marked this pull request as ready for review September 6, 2023 10:08
@KarunAtreya KarunAtreya force-pushed the refactor_settingreponse branch from 3ed9431 to 436b61e Compare September 6, 2023 11:34
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 👍

@KarunAtreya KarunAtreya force-pushed the refactor_settingreponse branch 3 times, most recently from a790aa2 to e14c749 Compare September 8, 2023 08:58
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.

LGTM 👍

@saw-jan saw-jan requested a review from SwikritiT September 11, 2023 06:54
@KarunAtreya KarunAtreya force-pushed the refactor_settingreponse branch from e14c749 to 99e02fa Compare September 11, 2023 10:22
@sonarqubecloud
Copy link

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

@saw-jan saw-jan merged commit 8d1b2e3 into master Sep 11, 2023
2 checks passed
@delete-merged-branch delete-merged-branch bot deleted the refactor_settingreponse branch September 11, 2023 11:57
ownclouders pushed a commit that referenced this pull request Sep 11, 2023
…CheckSumContext and FavoritesContext (#7202)

* making helper function, checking and setting response in given step and when steo respectively

* returning response and using in given/then steps as required in favoritesContext

* set the returned response on SpaceContext

* changed to inline variable in some lines as required

* to check for the specific https response code
ownclouders pushed a commit that referenced this pull request Sep 12, 2023
…CheckSumContext and FavoritesContext (#7202)

* making helper function, checking and setting response in given step and when steo respectively

* returning response and using in given/then steps as required in favoritesContext

* set the returned response on SpaceContext

* changed to inline variable in some lines as required

* to check for the specific https response code
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.

5 participants