From 68d6c264617affecd9ab4b248c13aa5b8892b1fd Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 10 Oct 2023 18:20:37 +0200 Subject: [PATCH] test: ignore client.geo fields in system tests (#11810) (#11820) (cherry picked from commit 654b105cb8da50af5b561c86532bb6ce69918c79) Co-authored-by: kruskall <99559985+kruskall@users.noreply.github.com> --- systemtest/approvals/TestIntake/Errors.approved.json | 9 +++------ systemtest/approvals/TestIntake/Events.approved.json | 9 +++------ .../approvals/TestIntake/Transactions.approved.json | 9 +++------ .../TestIntake/TransactionsHugeTraces.approved.json | 9 +++------ .../approvals/TestOTLPGRPCLogsClientIP.approved.json | 9 ++++++--- systemtest/intake_test.go | 1 + systemtest/otlp_test.go | 2 +- 7 files changed, 20 insertions(+), 28 deletions(-) diff --git a/systemtest/approvals/TestIntake/Errors.approved.json b/systemtest/approvals/TestIntake/Errors.approved.json index edd7bb0cec..3ffe4fc007 100644 --- a/systemtest/approvals/TestIntake/Errors.approved.json +++ b/systemtest/approvals/TestIntake/Errors.approved.json @@ -10,16 +10,13 @@ }, "client": { "geo": { - "city_name": "Sheridan", "continent_name": "North America", "country_iso_code": "US", "country_name": "United States", "location": { - "lat": 40.1405, - "lon": -86.2209 - }, - "region_iso_code": "US-IN", - "region_name": "Indiana" + "lat": "dynamic", + "lon": "dynamic" + } }, "ip": "12.53.12.1" }, diff --git a/systemtest/approvals/TestIntake/Events.approved.json b/systemtest/approvals/TestIntake/Events.approved.json index 6ed0ab137e..740283244e 100644 --- a/systemtest/approvals/TestIntake/Events.approved.json +++ b/systemtest/approvals/TestIntake/Events.approved.json @@ -565,16 +565,13 @@ }, "client": { "geo": { - "city_name": "Sheridan", "continent_name": "North America", "country_iso_code": "US", "country_name": "United States", "location": { - "lat": 40.1405, - "lon": -86.2209 - }, - "region_iso_code": "US-IN", - "region_name": "Indiana" + "lat": "dynamic", + "lon": "dynamic" + } }, "ip": "12.53.12.1" }, diff --git a/systemtest/approvals/TestIntake/Transactions.approved.json b/systemtest/approvals/TestIntake/Transactions.approved.json index 6625df8356..77e6ad2ccf 100644 --- a/systemtest/approvals/TestIntake/Transactions.approved.json +++ b/systemtest/approvals/TestIntake/Transactions.approved.json @@ -307,16 +307,13 @@ }, "client": { "geo": { - "city_name": "Sheridan", "continent_name": "North America", "country_iso_code": "US", "country_name": "United States", "location": { - "lat": 40.1405, - "lon": -86.2209 - }, - "region_iso_code": "US-IN", - "region_name": "Indiana" + "lat": "dynamic", + "lon": "dynamic" + } }, "ip": "12.53.12.1" }, diff --git a/systemtest/approvals/TestIntake/TransactionsHugeTraces.approved.json b/systemtest/approvals/TestIntake/TransactionsHugeTraces.approved.json index 594dbe6642..53aeea4b60 100644 --- a/systemtest/approvals/TestIntake/TransactionsHugeTraces.approved.json +++ b/systemtest/approvals/TestIntake/TransactionsHugeTraces.approved.json @@ -9,16 +9,13 @@ }, "client": { "geo": { - "city_name": "Sheridan", "continent_name": "North America", "country_iso_code": "US", "country_name": "United States", "location": { - "lat": 40.1405, - "lon": -86.2209 - }, - "region_iso_code": "US-IN", - "region_name": "Indiana" + "lat": "dynamic", + "lon": "dynamic" + } }, "ip": "12.53.12.1" }, diff --git a/systemtest/approvals/TestOTLPGRPCLogsClientIP.approved.json b/systemtest/approvals/TestOTLPGRPCLogsClientIP.approved.json index 7c29b81a2b..ef73e0dc06 100644 --- a/systemtest/approvals/TestOTLPGRPCLogsClientIP.approved.json +++ b/systemtest/approvals/TestOTLPGRPCLogsClientIP.approved.json @@ -8,13 +8,16 @@ }, "client": { "geo": { + "city_name": "dynamic", "continent_name": "Europe", "country_iso_code": "ES", "country_name": "Spain", "location": { - "lat": 40.4172, - "lon": -3.684 - } + "lat": "dynamic", + "lon": "dynamic" + }, + "region_iso_code": "dynamic", + "region_name": "dynamic" }, "ip": "195.55.79.118" }, diff --git a/systemtest/intake_test.go b/systemtest/intake_test.go index 1b7e64e948..2d068227ff 100644 --- a/systemtest/intake_test.go +++ b/systemtest/intake_test.go @@ -56,6 +56,7 @@ func TestIntake(t *testing.T) { result := estest.ExpectMinDocs(t, systemtest.Elasticsearch, response.Accepted, "traces-apm*,metrics-apm*,logs-apm*", nil, ) + tc.dynamicFields = append(tc.dynamicFields, "client.geo.city_name", "client.geo.location.lat", "client.geo.location.lon", "client.geo.region_iso_code", "client.geo.region_name") approvaltest.ApproveEvents(t, t.Name(), result.Hits.Hits, tc.dynamicFields...) }) } diff --git a/systemtest/otlp_test.go b/systemtest/otlp_test.go index 2781af2eb6..9122c2d6e1 100644 --- a/systemtest/otlp_test.go +++ b/systemtest/otlp_test.go @@ -478,7 +478,7 @@ func TestOTLPGRPCLogsClientIP(t *testing.T) { require.NoError(t, err) result := estest.ExpectDocs(t, systemtest.Elasticsearch, "logs-apm*", nil) - approvaltest.ApproveEvents(t, t.Name(), result.Hits.Hits) + approvaltest.ApproveEvents(t, t.Name(), result.Hits.Hits, "client.geo.city_name", "client.geo.location.lat", "client.geo.location.lon", "client.geo.region_iso_code", "client.geo.region_name") } func newMobileLogs(body interface{}) plog.Logs {