From c559b1a6b0e104a6d32899b7ac277faa16f0d992 Mon Sep 17 00:00:00 2001 From: Aleksandr Maus Date: Fri, 17 May 2024 12:49:14 -0400 Subject: [PATCH] Osquerybeat: Follow up with changelog and unit test tweak for "Add action responses data stream PR" (#39577) --- CHANGELOG.next.asciidoc | 1 + x-pack/osquerybeat/internal/pub/publisher_test.go | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 96462205dc8..1c0ead5ceae 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -51,6 +51,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff] *Osquerybeat* +- Add action responses data stream, allowing osquerybeat to post action results directly to elasticsearch. {pull}39143[39143] *Packetbeat* diff --git a/x-pack/osquerybeat/internal/pub/publisher_test.go b/x-pack/osquerybeat/internal/pub/publisher_test.go index 4c34b667ff8..ad592bf7ec6 100644 --- a/x-pack/osquerybeat/internal/pub/publisher_test.go +++ b/x-pack/osquerybeat/internal/pub/publisher_test.go @@ -137,7 +137,6 @@ func TestActionResultToEvent(t *testing.T) { "count": 1, "started_at": "2024-04-18T19:39:39.532125Z" } `), - // "agent_id": "bf3d6036-2260-4bbf-94a3-5ccce0d75d9e", want: toMap(t, `{ "completed_at": "2024-04-18T19:39:39.740162Z", "action_response": { @@ -170,7 +169,6 @@ func TestActionResultToEvent(t *testing.T) { "error": "query failed, code: 1, message: no such table: osquery_foo", "started_at": "2024-04-20T14:56:34.87195Z" }`), - // "agent_id": "bf3d6036-2260-4bbf-94a3-5ccce0d75d9e", want: toMap(t, `{ "completed_at": "2024-04-20T14:56:34.87195Z", "action_id": "70539d80-4082-41e9-aff4-fbb877dd752b", @@ -186,11 +184,13 @@ func TestActionResultToEvent(t *testing.T) { } for _, tc := range tests { - got := actionResultToEvent(tc.req, tc.res) - diff := cmp.Diff(tc.want, got) - if diff != "" { - t.Error(diff) - } + t.Run(tc.name, func(t *testing.T) { + got := actionResultToEvent(tc.req, tc.res) + diff := cmp.Diff(tc.want, got) + if diff != "" { + t.Error(diff) + } + }) } }