-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Agentbeat tests based on agentbeat.spec.yml #41074
base: main
Are you sure you want to change the base?
Conversation
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
|
53931f7
to
ffafe79
Compare
b496aa8
to
2bae33b
Compare
2bae33b
to
4740fbe
Compare
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
This is the first part of a solution, the spec parsing works, but we aren't actually testing enough. When I run this locally, I see it starting agentbeat with each of the beats as sub-commands. However, each of these Beats is configured to do nothing, so we aren't testing as much as we should. The example of the type of problem we want to catch is #39818, where agentbeat was silently not including an import that was included if you ran it directly as part of heartbeat. The minimal reproduction for this is this heartbeat configuration which I'll put in heartbeat.yml: heartbeat.monitors:
- type: browser
enabled: true
id: my-monitor
schedule: '@every 10s'
output.console:
hosts: ["localhost:9200"]
enabled: true Then if I revert 4c4b2f8 and run the following it reproduces:
What we need to do is to parse the list of inputs out of the spec files, and then create a config file for each of the Beats that includes all the inputs it can run, and then make sure that the Beat starts without exiting like this. The config file for each Beat looks slightly different, see https://github.com/elastic/beats/blob/main/x-pack/filebeat/filebeat.yml for example compared to the heartbeat example above. Probably templating the config file would work for this. Additionally, it would be nice if these tests were written as Go tests. Then the test report would be in the same format as all the other tests. At least a test case per beat, you could have sub-tests for each of the inputs. |
Proposed commit message
Added checks for Agentbeat that execute all unique commands for inputs from agentbeat.spec.yml and validates that those can start without failures.
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.How to test this PR locally
Related issues
Logs
Buildkite builds: https://buildkite.com/elastic/beats-xpack-agentbeat/builds?branch=oakrizan%3Aagentbeat-integration-tests-spec