-
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
[Infra] API tests deployment agnostic #198257
[Infra] API tests deployment agnostic #198257
Conversation
8df3c3f
to
69efed3
Compare
69efed3
to
6701b34
Compare
@elasticmachine merge upstream |
843e154
to
865ad7a
Compare
865ad7a
to
efe6a2e
Compare
/ci |
@elasticmachine merge upstream |
/ci |
describe('GET /api/metrics/source/{sourceId}', () => { | ||
it('should just work', async () => { | ||
const { body } = await supertestWithAdminScope | ||
.get('/api/metrics/source/default') | ||
.set('kbn-xsrf', 'xxx') | ||
.send({ name: 'NAME', anomalyThreshold: 20 }) | ||
.expect(200); | ||
|
||
await supertest | ||
.patch(`${SOURCE_API_URL}/${SOURCE_ID}`) | ||
.set('kbn-xsrf', 'xxx') | ||
.send({ anomalyThreshold: -2 }) | ||
.expect(400); | ||
await supertest | ||
.patch(`${SOURCE_API_URL}/${SOURCE_ID}`) | ||
.set('kbn-xsrf', 'xxx') | ||
.send({ anomalyThreshold: 101 }) | ||
.expect(400); | ||
expect(body).to.have.property('source'); | ||
expect(body?.source.configuration.metricAlias).to.equal('metrics-*,metricbeat-*'); | ||
expect(body?.source).to.have.property('status'); | ||
expect(body?.source.status?.metricIndicesExist).to.equal(true); | ||
}); | ||
}); | ||
|
||
describe('GET /api/metrics/source/{sourceId}/hasData', () => { | ||
it('should just work', async () => { | ||
const { body } = await supertestWithAdminScope | ||
.get(`/api/metrics/source/default/hasData`) | ||
|
||
.expect(200); | ||
|
||
expect(body).to.have.property('hasData'); | ||
expect(body?.hasData).to.be(true); | ||
}); | ||
}); |
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.
merged with http_source.ts
@@ -1341,5 +1344,119 @@ export default function ({ getService }: FtrProviderContext) { | |||
}); | |||
}); | |||
}); | |||
describe('getElasticsearchMetricQuery', () => { |
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.
Merged with metrics_alerting.ts
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
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.
Great work! LGTM
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
@elasticmachine merge upstream |
There are no new commits on the base branch. |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
History
|
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.
Logs UI test changes LGTM, thank you!
@@ -21,7 +21,6 @@ export default createTestConfig({ | |||
services, | |||
// add feature flags | |||
kbnServerArgs: [ | |||
'--xpack.infra.enabled=true', |
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.
Giving the 👍🏾 as I'm not sure why security solution is a code owner for an observability file? @crespocarlos .
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.
I guess we need to change this https://github.com/crespocarlos/kibana/blob/main/.github/CODEOWNERS#L1625
Starting backport for target branches: 8.x |
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
closes [elastic#198015](elastic#198015) ## Summary Migrate most of the infra APIs integration tests to the deployment-agnostic approach. >[!important] > - Metrics UI related tests were note migrated because the feature is not enabled on serverless. > - `Host with active alerts` test was not migrated because `es_archiver` fails to load the alerts data. This is because on serverless, the alerts indices are created as managed data streams and that causes the `es_archiver` to fail. We should probably try use synthtrace. - [x] Tested against MKI - [x] Tested against stateful --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
Friendly reminder: Looks like this PR hasn’t been backported yet. |
1 similar comment
Friendly reminder: Looks like this PR hasn’t been backported yet. |
closes [elastic#198015](elastic#198015) ## Summary Migrate most of the infra APIs integration tests to the deployment-agnostic approach. >[!important] > - Metrics UI related tests were note migrated because the feature is not enabled on serverless. > - `Host with active alerts` test was not migrated because `es_archiver` fails to load the alerts data. This is because on serverless, the alerts indices are created as managed data streams and that causes the `es_archiver` to fail. We should probably try use synthtrace. - [x] Tested against MKI - [x] Tested against stateful --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Elastic Machine <[email protected]> (cherry picked from commit 26f24c6) # Conflicts: # .github/CODEOWNERS # packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_kibana_client.ts # x-pack/test_serverless/api_integration/test_suites/observability/config.feature_flags.ts # x-pack/test_serverless/api_integration/test_suites/observability/index.feature_flags.ts # x-pack/test_serverless/tsconfig.json
# Backport This will backport the following commits from `main` to `8.x`: - [[Infra] API tests deployment agnostic (#198257)](#198257) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Carlos Crespo","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-05T18:39:58Z","message":"[Infra] API tests deployment agnostic (#198257)\n\ncloses [#198015](https://github.com/elastic/kibana/issues/198015)\r\n\r\n## Summary\r\n\r\nMigrate most of the infra APIs integration tests to the\r\ndeployment-agnostic approach.\r\n\r\n>[!important]\r\n> - Metrics UI related tests were note migrated because the feature is\r\nnot enabled on serverless.\r\n> - `Host with active alerts` test was not migrated because\r\n`es_archiver` fails to load the alerts data. This is because on\r\nserverless, the alerts indices are created as managed data streams and\r\nthat causes the `es_archiver` to fail. We should probably try use\r\nsynthtrace.\r\n\r\n - [x] Tested against MKI\r\n - [x] Tested against stateful\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"26f24c66b5843f5d2c4340dd442c4ddfd375793f","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport missing","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-infra_services"],"number":198257,"url":"https://github.com/elastic/kibana/pull/198257","mergeCommit":{"message":"[Infra] API tests deployment agnostic (#198257)\n\ncloses [#198015](https://github.com/elastic/kibana/issues/198015)\r\n\r\n## Summary\r\n\r\nMigrate most of the infra APIs integration tests to the\r\ndeployment-agnostic approach.\r\n\r\n>[!important]\r\n> - Metrics UI related tests were note migrated because the feature is\r\nnot enabled on serverless.\r\n> - `Host with active alerts` test was not migrated because\r\n`es_archiver` fails to load the alerts data. This is because on\r\nserverless, the alerts indices are created as managed data streams and\r\nthat causes the `es_archiver` to fail. We should probably try use\r\nsynthtrace.\r\n\r\n - [x] Tested against MKI\r\n - [x] Tested against stateful\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"26f24c66b5843f5d2c4340dd442c4ddfd375793f"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/198257","number":198257,"mergeCommit":{"message":"[Infra] API tests deployment agnostic (#198257)\n\ncloses [#198015](https://github.com/elastic/kibana/issues/198015)\r\n\r\n## Summary\r\n\r\nMigrate most of the infra APIs integration tests to the\r\ndeployment-agnostic approach.\r\n\r\n>[!important]\r\n> - Metrics UI related tests were note migrated because the feature is\r\nnot enabled on serverless.\r\n> - `Host with active alerts` test was not migrated because\r\n`es_archiver` fails to load the alerts data. This is because on\r\nserverless, the alerts indices are created as managed data streams and\r\nthat causes the `es_archiver` to fail. We should probably try use\r\nsynthtrace.\r\n\r\n - [x] Tested against MKI\r\n - [x] Tested against stateful\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"26f24c66b5843f5d2c4340dd442c4ddfd375793f"}}]}] BACKPORT--> --------- Co-authored-by: kibanamachine <[email protected]>
closes #198015
Summary
Migrate most of the infra APIs integration tests to the deployment-agnostic approach.
Important
Host with active alerts
test was not migrated becausees_archiver
fails to load the alerts data. This is because on serverless, the alerts indices are created as managed data streams and that causes thees_archiver
to fail. We should probably try use synthtrace.