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 AppConfigurationContext and AuthContext #7186

Merged
merged 6 commits into from
Sep 6, 2023

Conversation

KarunAtreya
Copy link
Contributor

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 AppConfigurationContext and ArchiverContext

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 1, 2023
@KarunAtreya KarunAtreya marked this pull request as ready for review September 1, 2023 11:29
@KarunAtreya KarunAtreya force-pushed the refactor_giventhen_steps branch from c00a80f to 0f42e78 Compare September 4, 2023 03:40
@KarunAtreya KarunAtreya changed the title [tests-only][full-ci] removing the setresponse in given/then step in AppConfigurationContext and ArchiverContext [tests-only][full-ci] removing the setresponse in given/then step in AppConfigurationContext and AuthContext Sep 4, 2023
@SagarGi SagarGi self-requested a review September 4, 2023 10:24
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 👍

@SagarGi SagarGi requested a review from phil-davis September 5, 2023 03:49
@@ -884,11 +887,12 @@ public function administratorRequestsURLWithUsingBasicAuth(string $url, string $
*/
public function userRequestsURLWithUsingBasicTokenAuth(string $user, string $url, string $method):void {
Copy link
Member

Choose a reason for hiding this comment

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

NOTE: This function is used in the Given steps below which should be prevented. But do it in the next iteration. See the second point todo list (#7082). First, fix all setResponse usage and then check the reuse of step-def functions in other steps and refactor it.

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

@KarunAtreya KarunAtreya force-pushed the refactor_giventhen_steps branch 2 times, most recently from 1ab7697 to f0608fb Compare September 5, 2023 10:46
@KarunAtreya KarunAtreya force-pushed the refactor_giventhen_steps branch from f0608fb to 14c5f61 Compare September 6, 2023 07:00
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

@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 6, 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

@SwikritiT SwikritiT merged commit eed0de1 into master Sep 6, 2023
@delete-merged-branch delete-merged-branch bot deleted the refactor_giventhen_steps branch September 6, 2023 07:51
ownclouders pushed a commit that referenced this pull request Sep 6, 2023
…AppConfigurationContext and AuthContext (#7186)

* removing setting response in the given steps

* use response interface

* use the returned response

* check success response

* changed to inline variable

* changed variable response_xml to responseXml
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