Skip to content

Commit

Permalink
mockgcp tests: ignore content-length header
Browse files Browse the repository at this point in the history
  • Loading branch information
justinsb committed Feb 22, 2025
1 parent 3ea3939 commit a61ff17
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 4 additions & 0 deletions mockgcp/mockgcptests/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ func TestScripts(t *testing.T) {
// gcloud includes a UUID in the user-agent, along with a lot of other client info (e.g. kernel version, python version)
// Just remove it from the golden output.
httpEvent.Request.RemoveHeader("user-agent")

// Remove the Content-Length header, as it changes with dynamic values
httpEvent.Request.RemoveHeader("Content-Length")
httpEvent.Response.RemoveHeader("Content-Length")
}

folderID := ""
Expand Down
7 changes: 0 additions & 7 deletions mockgcp/mockiam/testdata/role/crud/_http.log
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ POST https://iam.googleapis.com/v1/permissions:queryTestablePermissions?alt=json
Accept: application/json
Authorization: (removed)
Connection: keep-alive
Content-Length: 101
Content-Type: application/json

{
Expand All @@ -28,7 +27,6 @@ POST https://iam.googleapis.com/v1/projects/${projectId}/roles?alt=json
Accept: application/json
Authorization: (removed)
Connection: keep-alive
Content-Length: 165
Content-Type: application/json

{
Expand Down Expand Up @@ -70,7 +68,6 @@ GET https://iam.googleapis.com/v1/projects/${projectId}/roles/test_${uniqueId}?a
Accept: application/json
Authorization: (removed)
Connection: keep-alive
Content-Length: 0

200 OK
Content-Type: application/json; charset=UTF-8
Expand Down Expand Up @@ -99,7 +96,6 @@ GET https://iam.googleapis.com/v1/projects/${projectId}/roles/test_${uniqueId}?a
Accept: application/json
Authorization: (removed)
Connection: keep-alive
Content-Length: 0

200 OK
Content-Type: application/json; charset=UTF-8
Expand Down Expand Up @@ -128,7 +124,6 @@ POST https://iam.googleapis.com/v1/permissions:queryTestablePermissions?alt=json
Accept: application/json
Authorization: (removed)
Connection: keep-alive
Content-Length: 101
Content-Type: application/json

{
Expand All @@ -154,7 +149,6 @@ PATCH https://iam.googleapis.com/v1/projects/${projectId}/roles/test_${uniqueId}
Accept: application/json
Authorization: (removed)
Connection: keep-alive
Content-Length: 134
Content-Type: application/json

{
Expand Down Expand Up @@ -195,7 +189,6 @@ DELETE https://iam.googleapis.com/v1/projects/${projectId}/roles/test_${uniqueId
Accept: application/json
Authorization: (removed)
Connection: keep-alive
Content-Length: 0

200 OK
Content-Type: application/json; charset=UTF-8
Expand Down

0 comments on commit a61ff17

Please sign in to comment.