Skip to content

Commit

Permalink
Merge pull request #1807 from gemmahou/fix-scenarios-test
Browse files Browse the repository at this point in the history
tests: Update llm_immutable_field test http log and exported object
  • Loading branch information
google-oss-prow[bot] committed May 22, 2024
2 parents 281e477 + b3a5694 commit 86a55f9
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 34 deletions.
1 change: 1 addition & 0 deletions tests/e2e/httplog.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ func (x *Normalizer) Render(events test.LogEntries) string {
// Remove headers that just aren't very relevant to testing
events.RemoveHTTPResponseHeader("Date")
events.RemoveHTTPResponseHeader("Alt-Svc")
events.RemoveHTTPResponseHeader("Server-Timing")

got := events.FormatHTTP()
normalizers := []func(string) string{}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Step1: Create a logginglogmetric resource, operation succeeds

Step2: Update spec.metricDescriptor.labels.valueType field for the resource, operation fails. We'll see no PUT request
in _http01 and resource has UpdateFailed message in _object01.
Original file line number Diff line number Diff line change
@@ -1,7 +1,46 @@
GET https://logging.googleapis.com/v2/projects/${projectId}/metrics/logginglogmetric-${uniqueId}?alt=json&prettyPrint=false
User-Agent: google-api-go-client/0.5
X-Goog-Api-Client: gl-go/1.22.3 gdcl/0.177.0

404 Not Found
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
"error": {
"code": 404,
"details": [
{
"@type": "type.googleapis.com/google.rpc.DebugInfo",
"detail": "[ORIGINAL ERROR] generic::not_found: Metric logginglogmetric-${uniqueId} does not exist. [google.rpc.error_details_ext] { message: \"Metric logginglogmetric-${uniqueId} does not exist.\" }"
}
],
"errors": [
{
"debugInfo": "detail: \"[ORIGINAL ERROR] generic::not_found: Metric logginglogmetric-${uniqueId} does not exist. [google.rpc.error_details_ext] { message: \\\"Metric logginglogmetric-${uniqueId} does not exist.\\\" }\"\n",
"domain": "global",
"message": "Metric logginglogmetric-${uniqueId} does not exist.",
"reason": "notFound"
}
],
"message": "Metric logginglogmetric-${uniqueId} does not exist.",
"status": "NOT_FOUND"
}
}

---

POST https://logging.googleapis.com/v2/projects/${projectId}/metrics?alt=json&prettyPrint=false
Content-Type: application/json
User-Agent: google-api-go-client/0.5
X-Goog-Api-Client: gl-go/1.22.1 gdcl/0.160.0
X-Goog-Api-Client: gl-go/1.22.3 gdcl/0.177.0

{
"bucketOptions": {
Expand Down Expand Up @@ -43,7 +82,6 @@ X-Goog-Api-Client: gl-go/1.22.1 gdcl/0.160.0
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Server: ESF
Server-Timing: gfet4t7; dur=1606
Vary: Origin
Vary: X-Origin
Vary: Referer
Expand Down Expand Up @@ -90,13 +128,12 @@ X-Xss-Protection: 0

GET https://logging.googleapis.com/v2/projects/${projectId}/metrics/logginglogmetric-${uniqueId}?alt=json&prettyPrint=false
User-Agent: google-api-go-client/0.5
X-Goog-Api-Client: gl-go/1.22.1 gdcl/0.160.0
X-Goog-Api-Client: gl-go/1.22.3 gdcl/0.177.0

200 OK
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Server: ESF
Server-Timing: gfet4t7; dur=77
Vary: Origin
Vary: X-Origin
Vary: Referer
Expand Down Expand Up @@ -144,7 +181,7 @@ X-Xss-Protection: 0
PUT https://logging.googleapis.com/v2/projects/${projectId}/metrics/logginglogmetric-${uniqueId}?alt=json&prettyPrint=false
Content-Type: application/json
User-Agent: google-api-go-client/0.5
X-Goog-Api-Client: gl-go/1.22.1 gdcl/0.160.0
X-Goog-Api-Client: gl-go/1.22.3 gdcl/0.177.0

{
"bucketOptions": {
Expand Down Expand Up @@ -188,7 +225,6 @@ X-Goog-Api-Client: gl-go/1.22.1 gdcl/0.160.0
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Server: ESF
Server-Timing: gfet4t7; dur=962
Vary: Origin
Vary: X-Origin
Vary: Referer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
GET https://logging.googleapis.com/v2/projects/${projectId}/metrics/logginglogmetric-${uniqueId}?alt=json&prettyPrint=false
User-Agent: google-api-go-client/0.5
X-Goog-Api-Client: gl-go/1.22.1 gdcl/0.160.0
X-Goog-Api-Client: gl-go/1.22.3 gdcl/0.177.0

200 OK
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Server: ESF
Server-Timing: gfet4t7; dur=89
Vary: Origin
Vary: X-Origin
Vary: Referer
Expand Down Expand Up @@ -54,7 +53,7 @@ X-Xss-Protection: 0
PUT https://logging.googleapis.com/v2/projects/${projectId}/metrics/logginglogmetric-${uniqueId}?alt=json&prettyPrint=false
Content-Type: application/json
User-Agent: google-api-go-client/0.5
X-Goog-Api-Client: gl-go/1.22.1 gdcl/0.160.0
X-Goog-Api-Client: gl-go/1.22.3 gdcl/0.177.0

{
"bucketOptions": {
Expand All @@ -66,7 +65,7 @@ X-Goog-Api-Client: gl-go/1.22.1 gdcl/0.160.0
}
},
"createTime": "2024-04-01T12:34:56.123456Z",
"description": "an updated description",
"description": "a description",
"filter": "resource.type=gae_app AND severity\u003c=ERROR",
"labelExtractors": {
"testkey": "EXTRACT(jsonPayload.request)"
Expand Down Expand Up @@ -98,7 +97,6 @@ X-Goog-Api-Client: gl-go/1.22.1 gdcl/0.160.0
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Server: ESF
Server-Timing: gfet4t7; dur=360
Vary: Origin
Vary: X-Origin
Vary: Referer
Expand Down Expand Up @@ -132,13 +130,12 @@ X-Xss-Protection: 0

GET https://logging.googleapis.com/v2/projects/${projectId}/metrics/logginglogmetric-${uniqueId}?alt=json&prettyPrint=false
User-Agent: google-api-go-client/0.5
X-Goog-Api-Client: gl-go/1.22.1 gdcl/0.160.0
X-Goog-Api-Client: gl-go/1.22.3 gdcl/0.177.0

200 OK
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Server: ESF
Server-Timing: gfet4t7; dur=73
Vary: Origin
Vary: X-Origin
Vary: Referer
Expand Down Expand Up @@ -186,7 +183,7 @@ X-Xss-Protection: 0
PUT https://logging.googleapis.com/v2/projects/${projectId}/metrics/logginglogmetric-${uniqueId}?alt=json&prettyPrint=false
Content-Type: application/json
User-Agent: google-api-go-client/0.5
X-Goog-Api-Client: gl-go/1.22.1 gdcl/0.160.0
X-Goog-Api-Client: gl-go/1.22.3 gdcl/0.177.0

{
"bucketOptions": {
Expand All @@ -198,7 +195,7 @@ X-Goog-Api-Client: gl-go/1.22.1 gdcl/0.160.0
}
},
"createTime": "2024-04-01T12:34:56.123456Z",
"description": "an updated description",
"description": "a description",
"filter": "resource.type=gae_app AND severity\u003c=ERROR",
"labelExtractors": {
"testkey": "EXTRACT(jsonPayload.request)"
Expand Down Expand Up @@ -230,7 +227,6 @@ X-Goog-Api-Client: gl-go/1.22.1 gdcl/0.160.0
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Server: ESF
Server-Timing: gfet4t7; dur=322
Vary: Origin
Vary: X-Origin
Vary: Referer
Expand Down Expand Up @@ -264,13 +260,12 @@ X-Xss-Protection: 0

GET https://logging.googleapis.com/v2/projects/${projectId}/metrics/logginglogmetric-${uniqueId}?alt=json&prettyPrint=false
User-Agent: google-api-go-client/0.5
X-Goog-Api-Client: gl-go/1.22.1 gdcl/0.160.0
X-Goog-Api-Client: gl-go/1.22.3 gdcl/0.177.0

200 OK
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Server: ESF
Server-Timing: gfet4t7; dur=89
Vary: Origin
Vary: X-Origin
Vary: Referer
Expand Down Expand Up @@ -318,7 +313,7 @@ X-Xss-Protection: 0
PUT https://logging.googleapis.com/v2/projects/${projectId}/metrics/logginglogmetric-${uniqueId}?alt=json&prettyPrint=false
Content-Type: application/json
User-Agent: google-api-go-client/0.5
X-Goog-Api-Client: gl-go/1.22.1 gdcl/0.160.0
X-Goog-Api-Client: gl-go/1.22.3 gdcl/0.177.0

{
"bucketOptions": {
Expand All @@ -330,7 +325,7 @@ X-Goog-Api-Client: gl-go/1.22.1 gdcl/0.160.0
}
},
"createTime": "2024-04-01T12:34:56.123456Z",
"description": "an updated description",
"description": "a description",
"filter": "resource.type=gae_app AND severity\u003c=ERROR",
"labelExtractors": {
"testkey": "EXTRACT(jsonPayload.request)"
Expand Down Expand Up @@ -362,7 +357,6 @@ X-Goog-Api-Client: gl-go/1.22.1 gdcl/0.160.0
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Server: ESF
Server-Timing: gfet4t7; dur=375
Vary: Origin
Vary: X-Origin
Vary: Referer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
bounds:
- 1.5
- 4.5
description: an updated description
description: a description
filter: resource.type=gae_app AND severity<=ERROR
labelExtractors:
testkey: EXTRACT(jsonPayload.request)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Step1: Create a logginglogmetric resource, operation succeeds

Step2: Update spec.metricDescriptor.metricKind and valueType fields for the resource, operation fails. We'll see no PUT request
in _http01 and resource has UpdateFailed message in _object01.
Original file line number Diff line number Diff line change
@@ -1,7 +1,46 @@
GET https://logging.googleapis.com/v2/projects/${projectId}/metrics/logginglogmetric-${uniqueId}?alt=json&prettyPrint=false
User-Agent: google-api-go-client/0.5
X-Goog-Api-Client: gl-go/1.22.3 gdcl/0.177.0

404 Not Found
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
"error": {
"code": 404,
"details": [
{
"@type": "type.googleapis.com/google.rpc.DebugInfo",
"detail": "[ORIGINAL ERROR] generic::not_found: Metric logginglogmetric-${uniqueId} does not exist. [google.rpc.error_details_ext] { message: \"Metric logginglogmetric-${uniqueId} does not exist.\" }"
}
],
"errors": [
{
"debugInfo": "detail: \"[ORIGINAL ERROR] generic::not_found: Metric logginglogmetric-${uniqueId} does not exist. [google.rpc.error_details_ext] { message: \\\"Metric logginglogmetric-${uniqueId} does not exist.\\\" }\"\n",
"domain": "global",
"message": "Metric logginglogmetric-${uniqueId} does not exist.",
"reason": "notFound"
}
],
"message": "Metric logginglogmetric-${uniqueId} does not exist.",
"status": "NOT_FOUND"
}
}

---

POST https://logging.googleapis.com/v2/projects/${projectId}/metrics?alt=json&prettyPrint=false
Content-Type: application/json
User-Agent: google-api-go-client/0.5
X-Goog-Api-Client: gl-go/1.22.1 gdcl/0.160.0
X-Goog-Api-Client: gl-go/1.22.3 gdcl/0.177.0

{
"bucketOptions": {
Expand Down Expand Up @@ -43,7 +82,6 @@ X-Goog-Api-Client: gl-go/1.22.1 gdcl/0.160.0
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Server: ESF
Server-Timing: gfet4t7; dur=1514
Vary: Origin
Vary: X-Origin
Vary: Referer
Expand Down Expand Up @@ -90,13 +128,12 @@ X-Xss-Protection: 0

GET https://logging.googleapis.com/v2/projects/${projectId}/metrics/logginglogmetric-${uniqueId}?alt=json&prettyPrint=false
User-Agent: google-api-go-client/0.5
X-Goog-Api-Client: gl-go/1.22.1 gdcl/0.160.0
X-Goog-Api-Client: gl-go/1.22.3 gdcl/0.177.0

200 OK
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Server: ESF
Server-Timing: gfet4t7; dur=95
Vary: Origin
Vary: X-Origin
Vary: Referer
Expand Down Expand Up @@ -144,7 +181,7 @@ X-Xss-Protection: 0
PUT https://logging.googleapis.com/v2/projects/${projectId}/metrics/logginglogmetric-${uniqueId}?alt=json&prettyPrint=false
Content-Type: application/json
User-Agent: google-api-go-client/0.5
X-Goog-Api-Client: gl-go/1.22.1 gdcl/0.160.0
X-Goog-Api-Client: gl-go/1.22.3 gdcl/0.177.0

{
"bucketOptions": {
Expand Down Expand Up @@ -188,7 +225,6 @@ X-Goog-Api-Client: gl-go/1.22.1 gdcl/0.160.0
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Server: ESF
Server-Timing: gfet4t7; dur=1088
Vary: Origin
Vary: X-Origin
Vary: Referer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
GET https://logging.googleapis.com/v2/projects/${projectId}/metrics/logginglogmetric-${uniqueId}?alt=json&prettyPrint=false
User-Agent: google-api-go-client/0.5
X-Goog-Api-Client: gl-go/1.22.1 gdcl/0.160.0
X-Goog-Api-Client: gl-go/1.22.3 gdcl/0.177.0

200 OK
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Server: ESF
Server-Timing: gfet4t7; dur=90
Vary: Origin
Vary: X-Origin
Vary: Referer
Expand Down Expand Up @@ -53,13 +52,12 @@ X-Xss-Protection: 0

GET https://logging.googleapis.com/v2/projects/${projectId}/metrics/logginglogmetric-${uniqueId}?alt=json&prettyPrint=false
User-Agent: google-api-go-client/0.5
X-Goog-Api-Client: gl-go/1.22.1 gdcl/0.160.0
X-Goog-Api-Client: gl-go/1.22.3 gdcl/0.177.0

200 OK
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Server: ESF
Server-Timing: gfet4t7; dur=77
Vary: Origin
Vary: X-Origin
Vary: Referer
Expand Down Expand Up @@ -106,13 +104,12 @@ X-Xss-Protection: 0

GET https://logging.googleapis.com/v2/projects/${projectId}/metrics/logginglogmetric-${uniqueId}?alt=json&prettyPrint=false
User-Agent: google-api-go-client/0.5
X-Goog-Api-Client: gl-go/1.22.1 gdcl/0.160.0
X-Goog-Api-Client: gl-go/1.22.3 gdcl/0.177.0

200 OK
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Server: ESF
Server-Timing: gfet4t7; dur=83
Vary: Origin
Vary: X-Origin
Vary: Referer
Expand Down

0 comments on commit 86a55f9

Please sign in to comment.