Skip to content

Commit 096984d

Browse files
[TT-14358] Fix mock response fixtures in 5.8.0 branch (#6967)
### **User description** <!-- Provide a general summary of your changes in the Title above --> ## Description <!-- Describe your changes in detail --> ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> https://tyktech.atlassian.net/browse/TT-14358 ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## How This Has Been Tested <!-- Please describe in detail how you tested your changes --> <!-- Include details of your testing environment, and the tests --> <!-- you ran to see how your change affects other areas of the code, etc. --> <!-- This information is helpful for reviewers and QA. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] 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) - [ ] Refactoring or add test (improvements in base code or adds test coverage to functionality) ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply --> <!-- If there are no documentation updates required, mark the item as checked. --> <!-- Raise up any additional concerns not covered by the checklist. --> - [ ] I ensured that the documentation is up to date - [ ] I explained why this PR updates go.mod in detail with reasoning why it's required - [ ] I would like a code coverage CI quality gate exception and have explained why ___ ### **PR Type** - Bug fix ___ ### **Description** - Removed legacy conflict markers in fixture file. - Replaced <nil> mock response entries with structured YAML arrays. - Updated multiple test fixture segments for proper API response simulation. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>mock_response.yml</strong><dd><code>Update and standardize mock response fixtures.</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> apidef/oas/testdata/fixtures/mock_response.yml <li>Cleared Git merge conflict markers.<br> <li> Replaced <nil> with valid YAML mock response arrays.<br> <li> Standardized fixture definitions for various test cases. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6967/files#diff-c7c72a9398d68abedf9238cc2a9606521069e13034f921e7a979d859e0559c8d">+1/-46</a>&nbsp; &nbsp; </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details> --------- Co-authored-by: Andrei <[email protected]>
1 parent ae62db8 commit 096984d

File tree

2 files changed

+10
-48
lines changed

2 files changed

+10
-48
lines changed

.taskfiles/lint.yml

+9-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ version: "3"
44
vars:
55
root:
66
sh: git rev-parse --show-toplevel
7+
branch_name:
8+
sh: |
9+
if [ -z "$BRANCH_NAME" ]; then
10+
git rev-parse --abbrev-ref HEAD
11+
else
12+
echo $BRANCH_NAME
13+
fi
714
815
tasks:
916
run:
@@ -12,7 +19,7 @@ tasks:
1219
- task: fmt
1320
- task: vet
1421
- task: check
15-
- golangci-lint run --new-from-rev=origin/master --issues-exit-code=1 --fix ./...
22+
- golangci-lint run --new-from-rev=origin/{{ .branch_name }} --issues-exit-code=1 --fix ./...
1623

1724
fmt:
1825
desc: "Run typical code cleanup steps"
@@ -79,4 +86,4 @@ tasks:
7986
desc: "Lint x-tyk-gateway schema"
8087
dir: '{{.root}}'
8188
cmds:
82-
- go test -count 1 -run=TestXTykGateway_Lint ./apidef/oas/
89+
- go test -count 1 -run=TestXTykGateway_Lint ./apidef/oas/

apidef/oas/testdata/fixtures/mock_response.yml

+1-46
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,8 @@ tests:
3333
versions:
3434
"":
3535
extended_paths:
36-
<<<<<<< HEAD
3736
mock_response: <nil>
3837
white_list: <nil>
39-
=======
40-
mock_response:
41-
- disabled: false
42-
path: "/test"
43-
method: "GET"
44-
ignore_case: false
45-
code: 200
46-
headers:
47-
Content-Type: "application/json"
48-
body: '{"message": "success"}'
49-
>>>>>>> 8d005fd5f... [TT-7306] [fix] Migrate Mock Response from Classic API Definition to OAS API Definition (#6914)
5038
- desc: "multiple methods on same path"
5139
source: oas
5240
input:
@@ -100,29 +88,8 @@ tests:
10088
versions:
10189
"":
10290
extended_paths:
103-
<<<<<<< HEAD
10491
mock_response: <nil>
10592
white_list: <nil>
106-
=======
107-
mock_response:
108-
- disabled: false
109-
path: "/test"
110-
method: "GET"
111-
ignore_case: false
112-
code: 200
113-
headers:
114-
Content-Type: "application/json"
115-
body: '{"status": "ok"}'
116-
- disabled: false
117-
path: "/test"
118-
method: "POST"
119-
ignore_case: false
120-
code: 201
121-
headers:
122-
Content-Type: "application/json"
123-
Location: "/test/123"
124-
body: '{"id": "123"}'
125-
>>>>>>> 8d005fd5f... [TT-7306] [fix] Migrate Mock Response from Classic API Definition to OAS API Definition (#6914)
12693
- desc: "disabled mock response"
12794
source: oas
12895
input:
@@ -155,20 +122,8 @@ tests:
155122
versions:
156123
"":
157124
extended_paths:
158-
<<<<<<< HEAD
159125
mock_response: <nil>
160126
white_list: <nil>
161-
=======
162-
mock_response:
163-
- disabled: true
164-
path: "/test"
165-
method: "GET"
166-
ignore_case: false
167-
code: 404
168-
headers:
169-
Content-Type: "application/json"
170-
body: '{"error": "not found"}'
171-
>>>>>>> 8d005fd5f... [TT-7306] [fix] Migrate Mock Response from Classic API Definition to OAS API Definition (#6914)
172127
- desc: "basic mock response - classic"
173128
source: "classic"
174129
input:
@@ -430,4 +385,4 @@ tests:
430385
- name: Content-Type
431386
value: application/json
432387
ignoreAuthentication:
433-
enabled: true
388+
enabled: true

0 commit comments

Comments
 (0)