-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Stack Monitoring] api tests for cluster and elasticsearch #145138
Conversation
@@ -6,8 +6,10 @@ | |||
*/ | |||
|
|||
import { get, groupBy } from 'lodash'; | |||
import { prefixIndexPatternWithCcs } from '../../../../../common/ccs_utils'; | |||
import { INDEX_PATTERN_ELASTICSEARCH } from '../../../../../common/constants'; | |||
import { |
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.
We didn't read from agent data in this query. Uncovered this with failing tests
…-ref HEAD~1..HEAD --fix'
}); | ||
}); | ||
|
||
describe('with red platinum cluster', () => { |
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.
These tests are duplicates of the legacy ones that are not testing metricbeat data. I've attempted to use the corresponding _mb archive to no avail so we have to rewrite if we want to keep them.
I've opted to remove them without replacement because they're only testing variants of the same API, and the first test guarantees that metricbeat/package data is properly loaded
Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI) |
@elasticmachine merge upstream |
describe('node detail - metricbeat and package', function () { | ||
['mb', 'package'].forEach((source) => { | ||
describe(`node detail ${source}`, function () { | ||
// TODO: https://github.com/elastic/stack-monitoring/issues/31 |
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.
this almost 4 years old 🎂
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.
Let's add that to the board :)
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.
LGTM! Just left a question.
}); | ||
}); | ||
|
||
describe('with red platinum cluster', () => { |
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.
We don't need these red platinum
and shards relocating
tests anymore?
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.
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.
Just realized it's a different file but the comment applies for this one as well
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Unknown metric groupsESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @klacabane |
…45138) ### Summary Part of elastic#119658 Add api integration tests for cluster and elasticsearch routes to validate behavior when reading data ingested by elastic-agent. We currently have a testing suite for legacy and another one for metricbeat. Since metricbeat and agent documents only differ in their metadata, for example agent will populate a `data_stream.*` property to identify the document types while metricbeat uses `metricset.*`, the tests assertion validating _business_ data should pass regardless of the documents source. With this in mind the metricbeat tests were updated to run the tests twice, one time with metricbeat data and a second time with package data. To generate the archives the `metrics-*` mappings were extracted with esArchiver from an elasticsearch with the package installed, and the documents were transformed from the metricbeat documents with [this script](https://gist.github.com/klacabane/654497ff86053c60af6df15fa6f6f657). Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 5cf0d0f)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…5138) (#145985) # Backport This will backport the following commits from `main` to `8.6`: - [[Stack Monitoring] api tests for cluster and elasticsearch (#145138)](#145138) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Kevin Lacabane","email":"kevin.lacabane@elastic.co"},"sourceCommit":{"committedDate":"2022-11-22T13:02:50Z","message":"[Stack Monitoring] api tests for cluster and elasticsearch (#145138)\n\n### Summary\r\nPart of https://github.com/elastic/kibana/issues/119658\r\n\r\nAdd api integration tests for cluster and elasticsearch routes to\r\nvalidate behavior when reading data ingested by elastic-agent.\r\n\r\nWe currently have a testing suite for legacy and another one for\r\nmetricbeat. Since metricbeat and agent documents only differ in their\r\nmetadata, for example agent will populate a `data_stream.*` property to\r\nidentify the document types while metricbeat uses `metricset.*`, the\r\ntests assertion validating _business_ data should pass regardless of the\r\ndocuments source. With this in mind the metricbeat tests were updated to\r\nrun the tests twice, one time with metricbeat data and a second time\r\nwith package data.\r\n\r\nTo generate the archives the `metrics-*` mappings were extracted with\r\nesArchiver from an elasticsearch with the package installed, and the\r\ndocuments were transformed from the metricbeat documents with [this\r\nscript](https://gist.github.com/klacabane/654497ff86053c60af6df15fa6f6f657).\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"5cf0d0f24817db4b36501c6c06f6cfb4cd61c296","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Infra Monitoring UI","release_note:skip","Feature:Stack Monitoring","v8.6.0","v8.7.0"],"number":145138,"url":"https://github.com/elastic/kibana/pull/145138","mergeCommit":{"message":"[Stack Monitoring] api tests for cluster and elasticsearch (#145138)\n\n### Summary\r\nPart of https://github.com/elastic/kibana/issues/119658\r\n\r\nAdd api integration tests for cluster and elasticsearch routes to\r\nvalidate behavior when reading data ingested by elastic-agent.\r\n\r\nWe currently have a testing suite for legacy and another one for\r\nmetricbeat. Since metricbeat and agent documents only differ in their\r\nmetadata, for example agent will populate a `data_stream.*` property to\r\nidentify the document types while metricbeat uses `metricset.*`, the\r\ntests assertion validating _business_ data should pass regardless of the\r\ndocuments source. With this in mind the metricbeat tests were updated to\r\nrun the tests twice, one time with metricbeat data and a second time\r\nwith package data.\r\n\r\nTo generate the archives the `metrics-*` mappings were extracted with\r\nesArchiver from an elasticsearch with the package installed, and the\r\ndocuments were transformed from the metricbeat documents with [this\r\nscript](https://gist.github.com/klacabane/654497ff86053c60af6df15fa6f6f657).\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"5cf0d0f24817db4b36501c6c06f6cfb4cd61c296"}},"sourceBranch":"main","suggestedTargetBranches":["8.6"],"targetPullRequestStates":[{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/145138","number":145138,"mergeCommit":{"message":"[Stack Monitoring] api tests for cluster and elasticsearch (#145138)\n\n### Summary\r\nPart of https://github.com/elastic/kibana/issues/119658\r\n\r\nAdd api integration tests for cluster and elasticsearch routes to\r\nvalidate behavior when reading data ingested by elastic-agent.\r\n\r\nWe currently have a testing suite for legacy and another one for\r\nmetricbeat. Since metricbeat and agent documents only differ in their\r\nmetadata, for example agent will populate a `data_stream.*` property to\r\nidentify the document types while metricbeat uses `metricset.*`, the\r\ntests assertion validating _business_ data should pass regardless of the\r\ndocuments source. With this in mind the metricbeat tests were updated to\r\nrun the tests twice, one time with metricbeat data and a second time\r\nwith package data.\r\n\r\nTo generate the archives the `metrics-*` mappings were extracted with\r\nesArchiver from an elasticsearch with the package installed, and the\r\ndocuments were transformed from the metricbeat documents with [this\r\nscript](https://gist.github.com/klacabane/654497ff86053c60af6df15fa6f6f657).\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"5cf0d0f24817db4b36501c6c06f6cfb4cd61c296"}}]}] BACKPORT--> Co-authored-by: Kevin Lacabane <kevin.lacabane@elastic.co>
Summary
Part of #119658
Add api integration tests for cluster and elasticsearch routes to validate behavior when reading data ingested by elastic-agent.
We currently have a testing suite for legacy and another one for metricbeat. Since metricbeat and agent documents only differ in their metadata, for example agent will populate a
data_stream.*
property to identify the document types while metricbeat usesmetricset.*
, the tests assertion validating business data should pass regardless of the documents source. With this in mind the metricbeat tests were updated to run the tests twice, one time with metricbeat data and a second time with package data.To generate the archives the
metrics-*
mappings were extracted with esArchiver from an elasticsearch with the package installed, and the documents were transformed from the metricbeat documents with this script.