Skip to content

Commit

Permalink
test: ignore client.geo fields in system tests (#11810) (#11820)
Browse files Browse the repository at this point in the history
(cherry picked from commit 654b105)

Co-authored-by: kruskall <[email protected]>
  • Loading branch information
mergify[bot] and kruskall authored Oct 10, 2023
1 parent 05ef701 commit 68d6c26
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 28 deletions.
9 changes: 3 additions & 6 deletions systemtest/approvals/TestIntake/Errors.approved.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
9 changes: 3 additions & 6 deletions systemtest/approvals/TestIntake/Events.approved.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
9 changes: 3 additions & 6 deletions systemtest/approvals/TestIntake/Transactions.approved.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
9 changes: 6 additions & 3 deletions systemtest/approvals/TestOTLPGRPCLogsClientIP.approved.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
1 change: 1 addition & 0 deletions systemtest/intake_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
})
}
Expand Down
2 changes: 1 addition & 1 deletion systemtest/otlp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 68d6c26

Please sign in to comment.