ITADN

BigQuery logging test suite fails

#1093Closedphilippschulte 创建于 2025-09-09
P
philippschultecommented
The following test is failing: ``` === NAME TestAccFastlyServiceVCL_bigquerylogging_default block_fastly_service_logging_bigquery_test.go:166: Step 1/1 error: Check failed: Check 2/4 error: bad match BigQuery logging match: &fastly.BigQuery{ ... // 5 identical fields FormatVersion: nil, Name: &"test-bigquery", - Placement: &"", + Placement: nil, ProcessingRegion: &"none", ProjectID: &"example-gcp-project", ... // 8 identical fields } --- FAIL: TestAccFastlyServiceVCL_bigquerylogging_default (10.14s) ``` The reason for this failure is because we prune empty values in `flattenBigQuery`: ``` ... // prune any empty values that come from the default string value in structs for k, v := range data { if v == "" { delete(data, k) } } ... ``` but in the test input struct we set the `placement` field explicit to an empty string: ``` bigQueryLog := gofastly.BigQuery{ Dataset: gofastly.ToPointer("example_bq_dataset"), User: gofastly.ToPointer(email), Format: gofastly.ToPointer(LoggingBigQueryDefaultFormat), Name: gofastly.ToPointer("test-bigquery"), Placement: gofastly.ToPointer(""), ProjectID: gofastly.ToPointer("example-gcp-project"), ResponseCondition: gofastly.ToPointer(""), SecretKey: gofastly.ToPointer(secretKey), Table: gofastly.ToPointer("example_bq_table"), Template: gofastly.ToPointer(""), ProcessingRegion: gofastly.ToPointer("none"), } ``` Because of the flatten logic the state becomes `nil` for `placement` but the test input expects `""`, so the comparison fails.
关闭于 2025-09-09 0 条评论