-
Notifications
You must be signed in to change notification settings - Fork 427
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
Add system tests to elasticsearch package #4442
Add system tests to elasticsearch package #4442
Conversation
(cherry picked from commit f02544d517fbf57827bc43f46265896656e96adb)
🌐 Coverage report
|
3570a06
to
231b51f
Compare
1abd59b
to
9d48135
Compare
9d48135
to
1a540b9
Compare
🚀 Benchmarks reportTo see the full report comment with |
@@ -27,3 +36,10 @@ services: | |||
command: "./generate-logs.sh" | |||
volumes: | |||
- ./scripts/generate-logs.sh:/generate-logs.sh | |||
- "${SERVICE_LOGS_DIR}:/var/log" | |||
- es_logs:/es_logs | |||
volumes: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Elasticsearch container must not be started with root user. With this in memory mount, log_generation
container, which is logged in with root, is able to get the files generated by the elasticsearch container and copy them to ${SERVICE_LOGS_DIR}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what a good "dev loop" for this stuff is. But these seem to take about 20 minutes to run and eventually I get 2 failures
--- Test results for package: elasticsearch - START ---
FAILURE DETAILS:
elasticsearch/gc default (variant: elasticsearch_8.5.0):
[0] parsing field value failed: field "process.pid"'s Go type, string, does not match the expected field type: long (field value: 172)
[1] parsing field value failed: field "process.pid"'s Go type, string, does not match the expected field type: long (field value: 191)
[2] parsing field value failed: field "process.pid"'s Go type, string, does not match the expected field type: long (field value: 209)
elasticsearch/slowlog default (variant: elasticsearch_8.5.0):
[0] parsing field value failed: field "elasticsearch.slowlog.id"'s Go type, <nil>, does not match the expected field type: keyword (field value: <nil>)
╭───────────────┬────────────────┬───────────┬────────────────────────────────────────┬─────────────────────────────────────────────────────────────────────────────────────────────────┬────────────────╮
│ PACKAGE │ DATA STREAM │ TEST TYPE │ TEST NAME │ RESULT │ TIME ELAPSED │
├───────────────┼────────────────┼───────────┼────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────┼────────────────┤
│ elasticsearch │ audit │ system │ default (variant: elasticsearch_8.5.0) │ PASS │ 50.42037067s │
│ elasticsearch │ cluster_stats │ system │ default (variant: elasticsearch_8.5.0) │ PASS │ 49.489491231s │
│ elasticsearch │ gc │ system │ default (variant: elasticsearch_8.5.0) │ FAIL: one or more errors found in documents stored in logs-elasticsearch.gc-ep data stream │ 53.643696827s │
│ elasticsearch │ index │ system │ default (variant: elasticsearch_8.5.0) │ PASS │ 54.83371928s │
│ elasticsearch │ index_recovery │ system │ default (variant: elasticsearch_8.5.0) │ PASS │ 54.26436754s │
│ elasticsearch │ index_summary │ system │ default (variant: elasticsearch_8.5.0) │ PASS │ 57.360332617s │
│ elasticsearch │ ml_job │ system │ default (variant: elasticsearch_8.5.0) │ PASS │ 1m16.96065921s │
│ elasticsearch │ node │ system │ default (variant: elasticsearch_8.5.0) │ PASS │ 58.722088277s │
│ elasticsearch │ node_stats │ system │ default (variant: elasticsearch_8.5.0) │ PASS │ 58.491270634s │
│ elasticsearch │ server │ system │ default (variant: elasticsearch_8.5.0) │ PASS │ 58.943940543s │
│ elasticsearch │ shard │ system │ default (variant: elasticsearch_8.5.0) │ PASS │ 54.375799125s │
│ elasticsearch │ slowlog │ system │ default (variant: elasticsearch_8.5.0) │ FAIL: one or more errors found in documents stored in logs-elasticsearch.slowlog-ep data stream │ 54.671515062s │
╰───────────────┴────────────────┴───────────┴────────────────────────────────────────┴─────────────────────────────────────────────────────────────────────────────────────────────────┴────────────────╯
I'll start poking around to see if I can figure out what's up. Maybe it's just full docker disk again.
@@ -0,0 +1,4 @@ | |||
variants: | |||
elasticsearch_8.5.0: | |||
ELASTIC_VERSION: 8.5.0-SNAPSHOT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonder if this should be 8.6.0-SNAPSHOT now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or both versions? Though it will take twice as much time to complete the test run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yikes
@matschaffer, It unfortunately takes a big chunk of time to complete. Regarding the error above, did you start a clean elastic-package stack? In the Which makes me wonder whether your elastic-package stack had the Filebeat version of the pipelines installed when the tests ran. If that's the case, I think fleet for some reason didn't replace them or picked up Filebeat's pipelines instead. If that's true, we may have problems. I'll try to reproduce this. |
I think most time is spent setting and tearing down the _dev docker-compose, as well as enrolling an agent with the test's configuration for each data stream. There's maybe a way to provide a single test configuration so all data stream's are collected in a single run, but I can't see any notes on that in the documentation |
That would be nice, because the datastream is always deleted after the tests runs. But by looking at the elastic-package system test code, the runner always creates and destroys the container on each run |
@matschaffer , there are 2 possible explanations: |
LGTM - we can reach out to the ecosystem team to investigate ways to make the system tests cheaper to run as this will become increasingly problematic if we add variants |
What does this PR do?
This PR adds system tests to the Elasticsearch package
Checklist
I have added an entry to my package'schangelog.yml
file.How to test this PR locally
elastic-package stack up -v -d --version 8.5.0-SNAPSHOT
cd packages/elasticsearch && elastic-package build && elastic-package test system
Related issues