Skip to content

Commit

Permalink
Merge pull request #2094 from yuwenma/stricter-test-timestamp
Browse files Browse the repository at this point in the history
fix: replace mockgcp dynamic timestamp
  • Loading branch information
google-oss-prow[bot] authored Jun 21, 2024
2 parents 71cb90c + ad0b9c0 commit cb4024e
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ status:
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
commonName: common-name
createTime: "2024-06-19T22:54:22.309289161Z"
expirationTime: "2025-06-19T22:54:22.309289161Z"
createTime: "1970-01-01T00:00:00Z"
expirationTime: "1970-01-01T00:00:00Z"
sha1Fingerprint: "12345678"
serviceAccountEmailAddress: p${projectNumber}[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ Grpc-Metadata-Content-Type: application/grpc
"cert": "-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----\n",
"certSerialNumber": "0",
"commonName": "common-name",
"createTime": "2024-06-19T22:54:22.309289161Z",
"expirationTime": "2025-06-19T22:54:22.309289161Z",
"createTime": "2024-04-01T12:34:56.123456Z",
"expirationTime": "2024-04-01T12:34:56.123456Z",
"instance": "sqlinstance-sample-${uniqueId}",
"kind": "sql#sslCert",
"selfLink": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ status:
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
commonName: common-name
createTime: "2024-06-19T22:55:16.440089500Z"
expirationTime: "2025-06-19T22:55:16.440089500Z"
createTime: "1970-01-01T00:00:00Z"
expirationTime: "1970-01-01T00:00:00Z"
sha1Fingerprint: "12345678"
serviceAccountEmailAddress: p${projectNumber}[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ Grpc-Metadata-Content-Type: application/grpc
"cert": "-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----\n",
"certSerialNumber": "0",
"commonName": "common-name",
"createTime": "2024-06-19T22:55:16.440089500Z",
"expirationTime": "2025-06-19T22:55:16.440089500Z",
"createTime": "2024-04-01T12:34:56.123456Z",
"expirationTime": "2024-04-01T12:34:56.123456Z",
"instance": "sqlinstance-sample-${uniqueId}",
"kind": "sql#sslCert",
"selfLink": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ Grpc-Metadata-Content-Type: application/grpc
"cert": "-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----\n",
"certSerialNumber": "0",
"commonName": "common-name",
"createTime": "2024-06-19T22:55:40.568828479Z",
"expirationTime": "2025-06-19T22:55:40.568828479Z",
"createTime": "2024-04-01T12:34:56.123456Z",
"expirationTime": "2024-04-01T12:34:56.123456Z",
"instance": "sqluser-dep-${uniqueId}",
"kind": "sql#sslCert",
"selfLink": "",
Expand Down Expand Up @@ -315,8 +315,8 @@ Grpc-Metadata-Content-Type: application/grpc
"cert": "-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----\n",
"certSerialNumber": "0",
"commonName": "common-name",
"createTime": "2024-06-19T22:55:40.568828479Z",
"expirationTime": "2025-06-19T22:55:40.568828479Z",
"createTime": "2024-04-01T12:34:56.123456Z",
"expirationTime": "2024-04-01T12:34:56.123456Z",
"instance": "sqluser-dep-${uniqueId}",
"kind": "sql#sslCert",
"selfLink": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ Grpc-Metadata-Content-Type: application/grpc
"cert": "-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----\n",
"certSerialNumber": "0",
"commonName": "common-name",
"createTime": "2024-06-19T23:04:51.688945621Z",
"expirationTime": "2025-06-19T23:04:51.688945621Z",
"createTime": "2024-04-01T12:34:56.123456Z",
"expirationTime": "2024-04-01T12:34:56.123456Z",
"instance": "sqlinstance-${uniqueId}",
"kind": "sql#sslCert",
"selfLink": "",
Expand Down Expand Up @@ -529,8 +529,8 @@ Grpc-Metadata-Content-Type: application/grpc
"cert": "-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----\n",
"certSerialNumber": "0",
"commonName": "common-name",
"createTime": "2024-06-19T23:04:51.688945621Z",
"expirationTime": "2025-06-19T23:04:51.688945621Z",
"createTime": "2024-04-01T12:34:56.123456Z",
"expirationTime": "2024-04-01T12:34:56.123456Z",
"instance": "sqlinstance-${uniqueId}",
"kind": "sql#sslCert",
"selfLink": "",
Expand Down
4 changes: 4 additions & 0 deletions tests/e2e/normalize.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ func normalizeKRMObject(u *unstructured.Unstructured, project testgcp.GCPProject
// Specific to BigQuery
visitor.replacePaths[".spec.access[].userByEmail"] = "[email protected]"

// Specific to postgresinstance
visitor.replacePaths[".status.serverCaCert.createTime"] = "1970-01-01T00:00:00Z"
visitor.replacePaths[".status.serverCaCert.expirationTime"] = "1970-01-01T00:00:00Z"

// Specific to Monitoring
visitor.replacePaths[".status.creationRecord[].mutateTime"] = "1970-01-01T00:00:00Z"
visitor.replacePaths[".status.creationRecord[].mutatedBy"] = "[email protected]"
Expand Down
4 changes: 4 additions & 0 deletions tests/e2e/unified_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,10 @@ func runScenario(ctx context.Context, t *testing.T, testPause bool, fixture reso
addSetStringReplacement(".mutationRecords[].mutateTime", "2024-04-01T12:34:56.123456Z")
addSetStringReplacement(".mutationRecords[].mutatedBy", "[email protected]")

// Specific to Sql
addReplacement("serverCaCert.createTime", "2024-04-01T12:34:56.123456Z")
addReplacement("serverCaCert.expirationTime", "2024-04-01T12:34:56.123456Z")

// Specific to KMS

addReplacement("policy.etag", "abcdef0123A=")
Expand Down

0 comments on commit cb4024e

Please sign in to comment.