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 FileVersionsContext #7111

Merged
merged 6 commits into from
Sep 11, 2023

Conversation

KarunAtreya
Copy link
Contributor

@KarunAtreya KarunAtreya commented Aug 24, 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

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 Aug 24, 2023
@KarunAtreya KarunAtreya force-pushed the refactor_setresponse_ingiventhen_steps branch 3 times, most recently from 78ca322 to 642e0e5 Compare August 25, 2023 11:00
@KarunAtreya KarunAtreya changed the title [tests-only][full-ci] removing the setresponse while user creation in given step [tests-only][full-ci] removing the setresponse in given/then step in coreApiWbDavPreviews suite Aug 25, 2023
@KarunAtreya KarunAtreya changed the title [tests-only][full-ci] removing the setresponse in given/then step in coreApiWbDavPreviews suite [tests-only][full-ci] removing the setresponse in given/then step in coreApiWebDavPreviews suite Aug 25, 2023
@KarunAtreya KarunAtreya force-pushed the refactor_setresponse_ingiventhen_steps branch 2 times, most recently from 44e2143 to 896c984 Compare August 28, 2023 05:20
@KarunAtreya KarunAtreya marked this pull request as ready for review August 28, 2023 06:09
@KarunAtreya KarunAtreya force-pushed the refactor_setresponse_ingiventhen_steps branch 2 times, most recently from ee3ea66 to eb0bd13 Compare September 1, 2023 05:47
@SagarGi SagarGi requested a review from SwikritiT September 4, 2023 03:51
@KarunAtreya KarunAtreya changed the title [tests-only][full-ci] removing the setresponse in given/then step in coreApiWebDavPreviews suite [tests-only][full-ci] removing the setresponse in given/then step in FileVersionsContext Sep 6, 2023
Copy link
Contributor

@SwikritiT SwikritiT 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
Copy link
Contributor Author

made some more changes to remove when step used by then step. so can you review again the last two commits @saw-jan @SwikritiT @SagarGi

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.

Refactor LGTM 👍

Copy link
Contributor

@SwikritiT SwikritiT left a comment

Choose a reason for hiding this comment

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

Changes look good to me
The branch seems to be little bit behind master please rebase and push
https://github.com/owncloud/ocis/tree/refactor_setresponse_ingiventhen_steps

@KarunAtreya KarunAtreya force-pushed the refactor_setresponse_ingiventhen_steps branch 2 times, most recently from 6f87e92 to 47068b3 Compare September 8, 2023 06:16
@KarunAtreya KarunAtreya force-pushed the refactor_setresponse_ingiventhen_steps branch 3 times, most recently from 5b2f2bf to 53a6b96 Compare September 11, 2023 05:52
@KarunAtreya KarunAtreya force-pushed the refactor_setresponse_ingiventhen_steps branch from 53a6b96 to def8f07 Compare September 11, 2023 10:23
@KarunAtreya KarunAtreya force-pushed the refactor_setresponse_ingiventhen_steps branch from def8f07 to b042575 Compare September 11, 2023 11:04
@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 dbb666b into master Sep 11, 2023
@delete-merged-branch delete-merged-branch bot deleted the refactor_setresponse_ingiventhen_steps branch September 11, 2023 11:44
ownclouders pushed a commit that referenced this pull request Sep 11, 2023
…FileVersionsContext (#7111)

* migrating set response from helper function to when step in preview feature

* separate single when/then steps by converting to helper function

* use of httpstatuscode check function in given step and rebased

* change function name

* remove use of setresponse in then step

* set the returned response
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.

4 participants