Skip to content

Commit

Permalink
Osquerybeat: Follow up with changelog and unit test tweak for "Add ac…
Browse files Browse the repository at this point in the history
…tion responses data stream PR" (elastic#39577)
  • Loading branch information
aleksmaus authored May 17, 2024
1 parent cd5df6e commit c559b1a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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*

Expand Down
14 changes: 7 additions & 7 deletions x-pack/osquerybeat/internal/pub/publisher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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",
Expand All @@ -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)
}
})
}
}

Expand Down

0 comments on commit c559b1a

Please sign in to comment.