-
Notifications
You must be signed in to change notification settings - Fork 102
Add support for recording requests in integration acceptance tests #2720
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
Merged
Merged
Changes from all commits
Commits
Show all changes
68 commits
Select commit
Hold shift + click to select a range
bf2fc1f
acc: Refactor starting test server in a separate file
shreyas-goenka 4f781ab
-
shreyas-goenka 2f5aca3
-
shreyas-goenka 0892552
-
shreyas-goenka 0e7806b
-
shreyas-goenka 465d74d
-
shreyas-goenka 714226c
-
shreyas-goenka 875ac17
-
shreyas-goenka 530f572
Merge remote-tracking branch 'origin' into proxy-integration
shreyas-goenka b8b22d4
fix lint
shreyas-goenka 9dec739
mvp
shreyas-goenka 34e5159
got this to a working state after refactor; TODO: cleanup and more te…
shreyas-goenka a030b3b
lint
shreyas-goenka fe141a5
-
shreyas-goenka cb0fde7
fix integration test users
shreyas-goenka 12ed683
-
shreyas-goenka b4fb7db
Merge remote-tracking branch 'origin' into proxy-integration
shreyas-goenka d1c13dd
cleanup
shreyas-goenka 7ddb576
add crud test
shreyas-goenka a2eb106
split tests and add workspace-io test
shreyas-goenka b32da96
add volume io testcase
shreyas-goenka 9b36628
-
shreyas-goenka 18f08e8
fix test on windows
shreyas-goenka c5deda8
-
shreyas-goenka cd8ebc6
fix windows base64
shreyas-goenka ef2ec73
fix windows newline in raw body
shreyas-goenka 6e5fa12
lint
shreyas-goenka ee83d69
fix windows newline in raw body again
shreyas-goenka c95c2b8
pass process env to child process
shreyas-goenka ab5a324
-
shreyas-goenka 94aaa4a
-
shreyas-goenka bdddde6
-
shreyas-goenka 609fb7e
cleanup
shreyas-goenka b9f52cb
-
shreyas-goenka f2faf04
cleanup
shreyas-goenka c4e5aa8
final cleanup
shreyas-goenka 3ca94bc
Merge remote-tracking branch 'origin' into proxy-integration
shreyas-goenka c72a6d7
always record requests in proxy
shreyas-goenka 55767f1
common code for current-user in PrepareServerAndClient
shreyas-goenka 573e82c
-
shreyas-goenka 4861e27
merge
shreyas-goenka 0830321
merge
shreyas-goenka 4bd1083
have start functions return host and token directly
shreyas-goenka e94556d
undo local server changse
shreyas-goenka e61ecc6
reduce diff
shreyas-goenka bc39366
-
shreyas-goenka 38e8901
-
shreyas-goenka 8e37d99
separate package for the proxy server
shreyas-goenka b86da3c
-
shreyas-goenka ac6ab14
-
shreyas-goenka a2639f0
-
shreyas-goenka 147077f
Merge remote-tracking branch 'origin' into proxy-integration
shreyas-goenka ca98d88
-
shreyas-goenka 0f5a61c
-
shreyas-goenka f326379
-
shreyas-goenka a748038
-
shreyas-goenka 6932a81
-
shreyas-goenka a52d28e
-
shreyas-goenka 74cc3a7
-
shreyas-goenka 958da1f
-
shreyas-goenka 51a7e26
-
shreyas-goenka 5a38af7
-
shreyas-goenka 9111f6f
-
shreyas-goenka 027d512
-
shreyas-goenka f9ecc83
use http server
shreyas-goenka bcfa2d2
-
shreyas-goenka 9a5e10e
address comments
shreyas-goenka 084a5c3
print requests inline
shreyas-goenka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"method": "GET", | ||
"path": "/api/2.0/preview/scim/v2/Me" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
>>> [CLI] current-user me | ||
"[USERNAME]" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Proxy server successfully records a requests and returns a response. | ||
trace $CLI current-user me | jq .name.givenName |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"method": "GET", | ||
"path": "/api/2.2/jobs/get" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
>>> [CLI] jobs get 1234 | ||
Error: Job 1234 does not exist. | ||
|
||
Exit code: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Proxy server should successfully return non 200 responses. | ||
errcode trace $CLI jobs get 1234 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
|
||
=== Create a pipeline | ||
|
||
>>> print_requests | ||
{ | ||
"method": "POST", | ||
"path": "/api/2.0/pipelines", | ||
"body": { | ||
"allow_duplicate_names": true, | ||
"libraries": [ | ||
{ | ||
"file": { | ||
"path": "/whatever.py" | ||
} | ||
} | ||
], | ||
"name": "test-pipeline-1" | ||
} | ||
} | ||
|
||
=== Get the pipeline | ||
>>> [CLI] pipelines get [UUID] | ||
"test-pipeline-1" | ||
|
||
>>> print_requests | ||
{ | ||
"method": "GET", | ||
"path": "/api/2.0/pipelines/[UUID]" | ||
} | ||
|
||
=== Update the pipeline | ||
>>> [CLI] pipelines update [UUID] --json @pipeline2.json | ||
|
||
>>> print_requests | ||
{ | ||
"method": "PUT", | ||
"path": "/api/2.0/pipelines/[UUID]", | ||
"body": { | ||
"allow_duplicate_names": true, | ||
"libraries": [ | ||
{ | ||
"file": { | ||
"path": "/whatever.py" | ||
} | ||
} | ||
], | ||
"name": "test-pipeline-2" | ||
} | ||
} | ||
|
||
=== Verify the update | ||
>>> [CLI] pipelines get [UUID] | ||
"test-pipeline-2" | ||
|
||
>>> print_requests | ||
{ | ||
"method": "GET", | ||
"path": "/api/2.0/pipelines/[UUID]" | ||
} | ||
|
||
=== Delete the pipeline | ||
>>> [CLI] pipelines delete [UUID] | ||
|
||
>>> print_requests | ||
{ | ||
"method": "DELETE", | ||
"path": "/api/2.0/pipelines/[UUID]" | ||
} | ||
|
||
=== Verify the deletion | ||
>>> [CLI] pipelines get [UUID] | ||
Error: The specified pipeline [UUID] was not found. | ||
|
||
Exit code: 1 | ||
|
||
>>> print_requests | ||
{ | ||
"method": "GET", | ||
"path": "/api/2.0/pipelines/[UUID]" | ||
} |
11 changes: 11 additions & 0 deletions
11
acceptance/selftest/record_cloud/pipeline-crud/pipeline1.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "test-pipeline-1", | ||
"allow_duplicate_names": true, | ||
"libraries": [ | ||
{ | ||
"file": { | ||
"path": "/whatever.py" | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried out [[Repls]], but they did not seem to work. I could not reproduce this locally on Windows, and it only seems to happen in the Windows CI runner.
I've already spent 1-2 hours trying to fix / patch this, so the easiest thing to do at this point is to ignore the lint rule.
I'm not sure we want to normalize in the raw_body since it is a part of the HTTP payload.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure this is needed, I don't see acceptance/selftest/record_cloud/volume-io/hello.txt having no trailing newline? (github highlights such files).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file definitely does not have a trailing newline (at least in my local checkout). I'm not sure why it's not being highlighted. Let's see if the latest integration tests pass, in which case maybe github is not rendering it properly.