Closed mashhurs closed 7 months ago
Functionally this looks good. I left some optional comments.
When running the tests locally, using the instructions in the README file, I noticed there were some errors in the output:
Error: one or more test cases failed Internal failure happened with nginx, process return code: 1. --- Test results for package: nginx - START --- FAILURE DETAILS: nginx/access default (variant: v1): [0] field "message" is undefined โญโโโโโโโโโโฌโโโโโโโโโโโโโโฌโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโฎ โ PACKAGE โ DATA STREAM โ TEST TYPE โ TEST NAME โ RESULT โ TIME ELAPSED โ โโโโโโโโโโโผโโโโโโโโโโโโโโผโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโค โ nginx โ access โ system โ default (variant: v1) โ FAIL: one or more errors found in documents stored in logs-nginx.access-ep data stream โ 48.090519211s โ โ nginx โ error โ system โ default (variant: v1) โ PASS โ 36.341966511s โ โ nginx โ stubstatus โ system โ default (variant: v1) โ PASS โ 31.301999294s โ โฐโโโโโโโโโโดโโโโโโโโโโโโโโดโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโฏ --- Test results for package: nginx - END --- Done
however, the script finished successfully:
... Stopping elastic-package stack... Take down the Elastic stack Done $ echo $? 0
Shouldn't the above test failure have caused the script to fail too?
This result is coming from internal elastic-package
, not from elastic_integration
or es-output
plugins. If you take a look more logs, you will be able to see how many events plugins processed. Some of events may get rejected by ES and that is caught by elastic-package
. Every integration behavior is different and may require different setting especially in es-output
side (ECS compatibility, ILM, datastream, etc...).
So, with current E2E tests, we are more focusing on running integrations with elastic_integration
plugin, may extend to output plugins. Current failure looks because ECS is enabled by default and the data is in event.original
.
If any failure happens with this, tests fail, otherwise prints out every possible failures (elastic-package
, es-output
, etc...) for better visibility.
This result is coming from internal
elastic-package
, not fromelastic_integration
ores-output
plugins. If you take a look more logs, you will be able to see how many events plugins processed. Some of events may get rejected by ES and that is caught byelastic-package
. Every integration behavior is different and may require different setting especially ines-output
side (ECS compatibility, ILM, datastream, etc...). So, with current E2E tests, we are more focusing on running integrations withelastic_integration
plugin, may extend to output plugins. Current failure looks because ECS is enabled by default and the data is inevent.original
. If any failure happens with this, tests fail, otherwise prints out every possible failures (elastic-package
,es-output
, etc...) for better visibility.
Thanks for the clarification. This is alright for now, but I fear it could be trappy behaviour for someone not familiar with the test troubleshooting a failed CI job where there is a genuine error like the one you described above, plus the above nginx error which should be ignored (but how would the person triaging know about it? should we address this in a troubleshooting guide here or at a later PR?)
cc @mashhurs
Description
Adds integration tests for
["apache", "m365_defender", "nginx", "tomcat"]
integrations, can be easily changeable inmain.py
High level description: E2E framework
elastic-package
elastic_integration
plugin processed events. Sometimes, events might get cancelled in integrations, so E2E checks ifelastic-package
got some errors to make sure the expectation met.elastic-package
How to test
.buildkite/scripts/e2e/README.md
file.README.md
for the guide.Integrate with BK CI
STACK_VERSION
and export it. This will be resolved through BK pipeline script viaELASTIC_STACK_VERSION
(as we use)pip install -r .buildkite/scripts/e2e/requirements.txt
python .buildkite/scripts/e2e/main.py
Author's checklist
elastic-package
to run Logstash with auto config reload. It is very useful when we apply other config in-flight testing, PR: https://github.com/elastic/elastic-package/pull/1668Logs