From b8e91def8e0b5dd9ca2d3d4a7d2a66bfa5ade196 Mon Sep 17 00:00:00 2001 From: Andrew Wilkins Date: Wed, 31 Mar 2021 11:45:46 +0800 Subject: [PATCH 1/4] tests/system: fix system tests (#5037) * tests/system: adapt to new API response In https://github.com/elastic/kibana/pull/95146 the response structure for listing APM agent central config changed. Update system tests to match. * tests/system: add user_agent.device.type https://github.com/elastic/elasticsearch/pull/69322 added support for extracting device types to the user_agent ingest processors. Update approvals to match. (cherry picked from commit 0e09aa69022be69e15345b21d891ed3ec7c3f067) --- docs/data/elasticsearch/generated/errors.json | 3 ++- docs/data/elasticsearch/generated/transactions.json | 3 ++- systemtest/approvals/TestRUMErrorSourcemapping.approved.json | 3 ++- systemtest/approvals/TestRUMXForwardedFor.approved.json | 3 ++- tests/system/error.approved.json | 3 ++- tests/system/kibana.py | 2 +- tests/system/transaction.approved.json | 3 ++- 7 files changed, 13 insertions(+), 7 deletions(-) diff --git a/docs/data/elasticsearch/generated/errors.json b/docs/data/elasticsearch/generated/errors.json index 66d7cc5f853..d6edcf19027 100644 --- a/docs/data/elasticsearch/generated/errors.json +++ b/docs/data/elasticsearch/generated/errors.json @@ -407,7 +407,8 @@ }, "user_agent": { "device": { - "name": "Other" + "name": "Other", + "type": "Other" }, "name": "Other", "original": "Mozilla Chrome Edge" diff --git a/docs/data/elasticsearch/generated/transactions.json b/docs/data/elasticsearch/generated/transactions.json index 231771c6dbb..b57d7944c86 100644 --- a/docs/data/elasticsearch/generated/transactions.json +++ b/docs/data/elasticsearch/generated/transactions.json @@ -497,7 +497,8 @@ }, "user_agent": { "device": { - "name": "Other" + "name": "Other", + "type": "Other" }, "name": "Other", "original": "Mozilla Chrome Edge" diff --git a/systemtest/approvals/TestRUMErrorSourcemapping.approved.json b/systemtest/approvals/TestRUMErrorSourcemapping.approved.json index 59b399291cb..40b3f7aee09 100644 --- a/systemtest/approvals/TestRUMErrorSourcemapping.approved.json +++ b/systemtest/approvals/TestRUMErrorSourcemapping.approved.json @@ -302,7 +302,8 @@ }, "user_agent": { "device": { - "name": "Other" + "name": "Other", + "type": "Other" }, "name": "Go-http-client", "original": "Go-http-client/1.1", diff --git a/systemtest/approvals/TestRUMXForwardedFor.approved.json b/systemtest/approvals/TestRUMXForwardedFor.approved.json index 865865e2398..535aefe0563 100644 --- a/systemtest/approvals/TestRUMXForwardedFor.approved.json +++ b/systemtest/approvals/TestRUMXForwardedFor.approved.json @@ -65,7 +65,8 @@ }, "user_agent": { "device": { - "name": "Other" + "name": "Other", + "type": "Other" }, "name": "Go-http-client", "original": "Go-http-client/1.1", diff --git a/tests/system/error.approved.json b/tests/system/error.approved.json index 66d7cc5f853..d6edcf19027 100644 --- a/tests/system/error.approved.json +++ b/tests/system/error.approved.json @@ -407,7 +407,8 @@ }, "user_agent": { "device": { - "name": "Other" + "name": "Other", + "type": "Other" }, "name": "Other", "original": "Mozilla Chrome Edge" diff --git a/tests/system/kibana.py b/tests/system/kibana.py index d84706d4b1e..7baa7b5f4c5 100644 --- a/tests/system/kibana.py +++ b/tests/system/kibana.py @@ -61,7 +61,7 @@ def list_agent_config(self): } ) assert resp.status_code == 200, resp.status_code - return resp.json() + return resp.json()['configurations'] def delete_agent_config(self, service, env=None): data = { diff --git a/tests/system/transaction.approved.json b/tests/system/transaction.approved.json index 231771c6dbb..b57d7944c86 100644 --- a/tests/system/transaction.approved.json +++ b/tests/system/transaction.approved.json @@ -497,7 +497,8 @@ }, "user_agent": { "device": { - "name": "Other" + "name": "Other", + "type": "Other" }, "name": "Other", "original": "Mozilla Chrome Edge" From eb7cd8e98d2f4aba4c663443413a38119f89efcc Mon Sep 17 00:00:00 2001 From: Andrew Wilkins Date: Wed, 31 Mar 2021 19:58:07 +0800 Subject: [PATCH 2/4] user_agent.device.type isn't in 7.x yet --- tests/system/error.approved.json | 3 +-- tests/system/transaction.approved.json | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/system/error.approved.json b/tests/system/error.approved.json index d6edcf19027..66d7cc5f853 100644 --- a/tests/system/error.approved.json +++ b/tests/system/error.approved.json @@ -407,8 +407,7 @@ }, "user_agent": { "device": { - "name": "Other", - "type": "Other" + "name": "Other" }, "name": "Other", "original": "Mozilla Chrome Edge" diff --git a/tests/system/transaction.approved.json b/tests/system/transaction.approved.json index b57d7944c86..231771c6dbb 100644 --- a/tests/system/transaction.approved.json +++ b/tests/system/transaction.approved.json @@ -497,8 +497,7 @@ }, "user_agent": { "device": { - "name": "Other", - "type": "Other" + "name": "Other" }, "name": "Other", "original": "Mozilla Chrome Edge" From 27278bb9af618d5056e3fdf81949b978a3a3a4f2 Mon Sep 17 00:00:00 2001 From: Andrew Wilkins Date: Wed, 31 Mar 2021 20:13:40 +0800 Subject: [PATCH 3/4] make update --- docs/data/elasticsearch/generated/errors.json | 3 +-- docs/data/elasticsearch/generated/transactions.json | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/data/elasticsearch/generated/errors.json b/docs/data/elasticsearch/generated/errors.json index d6edcf19027..66d7cc5f853 100644 --- a/docs/data/elasticsearch/generated/errors.json +++ b/docs/data/elasticsearch/generated/errors.json @@ -407,8 +407,7 @@ }, "user_agent": { "device": { - "name": "Other", - "type": "Other" + "name": "Other" }, "name": "Other", "original": "Mozilla Chrome Edge" diff --git a/docs/data/elasticsearch/generated/transactions.json b/docs/data/elasticsearch/generated/transactions.json index b57d7944c86..231771c6dbb 100644 --- a/docs/data/elasticsearch/generated/transactions.json +++ b/docs/data/elasticsearch/generated/transactions.json @@ -497,8 +497,7 @@ }, "user_agent": { "device": { - "name": "Other", - "type": "Other" + "name": "Other" }, "name": "Other", "original": "Mozilla Chrome Edge" From 596b12a0f2eca271554875c97f39eaef47431c03 Mon Sep 17 00:00:00 2001 From: Andrew Wilkins Date: Thu, 1 Apr 2021 09:01:10 +0800 Subject: [PATCH 4/4] systemtest: revert approvals changes --- systemtest/approvals/TestRUMErrorSourcemapping.approved.json | 3 +-- systemtest/approvals/TestRUMXForwardedFor.approved.json | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/systemtest/approvals/TestRUMErrorSourcemapping.approved.json b/systemtest/approvals/TestRUMErrorSourcemapping.approved.json index 40b3f7aee09..59b399291cb 100644 --- a/systemtest/approvals/TestRUMErrorSourcemapping.approved.json +++ b/systemtest/approvals/TestRUMErrorSourcemapping.approved.json @@ -302,8 +302,7 @@ }, "user_agent": { "device": { - "name": "Other", - "type": "Other" + "name": "Other" }, "name": "Go-http-client", "original": "Go-http-client/1.1", diff --git a/systemtest/approvals/TestRUMXForwardedFor.approved.json b/systemtest/approvals/TestRUMXForwardedFor.approved.json index 535aefe0563..865865e2398 100644 --- a/systemtest/approvals/TestRUMXForwardedFor.approved.json +++ b/systemtest/approvals/TestRUMXForwardedFor.approved.json @@ -65,8 +65,7 @@ }, "user_agent": { "device": { - "name": "Other", - "type": "Other" + "name": "Other" }, "name": "Go-http-client", "original": "Go-http-client/1.1",