-
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
[Index Management] Test LogsDb Index Template Modifications #206548
[Index Management] Test LogsDb Index Template Modifications #206548
Conversation
Pinging @elastic/kibana-management (Team:Kibana Management) |
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.
Thanks for working on this @SoniaSanzV! Overall, it looks good, but I have a few comments/questions. Let me know what you think.
x-pack/test/functional/apps/index_management/index_templates_tab/index_template_tab.ts
Show resolved
Hide resolved
@@ -79,5 +79,96 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { | |||
// Close detail tab | |||
await testSubjects.click('closeDetailsButton'); | |||
}); | |||
|
|||
it('can modify ignore_above, ignore_malformed, ignore_dynamic_beyond_limit, subobjects and timestamp format in an index template with logsdb index mode', async () => { |
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 test verifies that we can create an index template with the mentioned index/mappings settings, but doesn't the test flow require overriding them? I'm wondering if we should also verify that we can edit these settings after the initial creation.
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.
You are right! I can create the index template from ES and then modify it in this test.
@@ -128,6 +128,94 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { | |||
expect(await testSubjects.getVisibleText('indexModeValue')).to.be('LogsDB'); | |||
await testSubjects.click('closeDetailsButton'); | |||
}); | |||
|
|||
it('can modify ignore_above, ignore_malformed, ignore_dynamic_beyond_limit, subobjects and timestamp format in an index template with logsdb index mode', async () => { |
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.
For serverless FTRs, we usually add tests for the main functionalities unless some logic is different from stateful - otherwise, there is a lot of code duplication and too heavy tests. Since the related index templates logic is same for both stateful and serverless, I wonder whether it's necessary to add this test here as well. 🤔 Wdyt?
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 added both because it was specified in the Issue description, but I see your point. I don't have a strong opinion.
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 see...let's leave it then to make sure it works correctly in serverless too.
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.
Thanks for addressing my feedback @SoniaSanzV! I added a few more comments. Also, could you run the flaky test runner to check for flakiness?
data_stream: {}, | ||
template: { | ||
settings: { | ||
mode: 'logsdb', |
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 think the setting should be index.mode
instead of just mode
. See https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html
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.
It seems that both are accepted. I'll keep yours since is more verbose.
await testSubjects.setValue( | ||
'kibanaCodeEditor', | ||
JSON.stringify({ | ||
index: { |
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 wonder if this overwrites the index.mode
setting to standard
since we don't specify it explicitly and it might be reset to the default value 🤔
x-pack/test/functional/apps/index_management/index_templates_tab/index_template_tab.ts
Show resolved
Hide resolved
'_source can not be disabled in index using [logsdb] index mode' | ||
); | ||
|
||
// Comeback to templates tab |
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.
Why do we need this step?
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.
After all the test we delete the index template and and click reloadButton
to avoid refreshing the page. I'll add it in the afterEach section.
// Fill out required fields | ||
await testSubjects.setValue('nameField', INDEX_TEMPLATE_NAME); | ||
await testSubjects.setValue('indexPatternsField', 'logsdb-test-index-pattern'); | ||
describe('index modification', () => { |
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.
did you mean "index template modification"?
}); | ||
|
||
// Close detail tab | ||
await testSubjects.click('closeDetailsButton'); |
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 step could be added in a before() if it's needed for the next test.
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.
Added in the afterEach section.
💚 Build Succeeded
Metrics [docs]Async chunks
History
cc @SoniaSanzV |
Flaky Test Runner Stats🎉 All tests passed! - kibana-flaky-test-suite-runner#7734[✅] x-pack/test/functional/apps/index_management/config.ts: 200/200 tests passed. |
Ran and passed! |
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.
Thanks for addressing my comments @SoniaSanzV! Latest changes lgtm 👍
Starting backport for target branches: 8.x |
…206548) Part of elastic#203716 ## Summary This PR introduces a new test case for LogsDB in both Stateful and Serverless: > Verify that users can override LogsDB index settings including: ignore_above, ignore_malformed, ignore_dynamic_beyond_limit, subobjects and timestamp format. For modify `subobjects` and `timestamp` format it must be done from the mappings tab. For `ignore_above`, `ignore_malformed`, `ignore_dynamic_beyond_limit` the configuration is done in the Settings tab. It also introduces a test case only for Stateful (enableMappingsSourceFieldSection [is disabled](https://github.com/elastic/kibana/blob/9c6de6aabced9d180bf1d68ec42708c27e5616d6/config/serverless.yml#L112) for serverless) > Verify that users cannot disable synthetic source for a LogsDB index. (cherry picked from commit 75e1866)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…06548) (#207019) # Backport This will backport the following commits from `main` to `8.x`: - [[Index Management] Test LogsDb Index Template Modifications (#206548)](#206548) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Sonia Sanz Vivas","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-17T06:15:23Z","message":"[Index Management] Test LogsDb Index Template Modifications (#206548)\n\nPart of https://github.com/elastic/kibana/issues/203716\n\n## Summary\nThis PR introduces a new test case for LogsDB in both Stateful and\nServerless:\n\n> Verify that users can override LogsDB index settings including:\nignore_above, ignore_malformed, ignore_dynamic_beyond_limit, subobjects\nand timestamp format.\n\nFor modify `subobjects` and `timestamp` format it must be done from the\nmappings tab. For `ignore_above`, `ignore_malformed`,\n`ignore_dynamic_beyond_limit` the configuration is done in the Settings\ntab.\n\nIt also introduces a test case only for Stateful\n(enableMappingsSourceFieldSection [is\ndisabled](https://github.com/elastic/kibana/blob/9c6de6aabced9d180bf1d68ec42708c27e5616d6/config/serverless.yml#L112)\nfor serverless)\n\n> Verify that users cannot disable synthetic source for a LogsDB index.","sha":"75e186691509e613d2a0735a15d9aa60fa9c13a8","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Index Management","Team:Kibana Management","release_note:skip","v9.0.0","backport:prev-minor"],"title":"[Index Management] Test LogsDb Index Template Modifications","number":206548,"url":"https://github.com/elastic/kibana/pull/206548","mergeCommit":{"message":"[Index Management] Test LogsDb Index Template Modifications (#206548)\n\nPart of https://github.com/elastic/kibana/issues/203716\n\n## Summary\nThis PR introduces a new test case for LogsDB in both Stateful and\nServerless:\n\n> Verify that users can override LogsDB index settings including:\nignore_above, ignore_malformed, ignore_dynamic_beyond_limit, subobjects\nand timestamp format.\n\nFor modify `subobjects` and `timestamp` format it must be done from the\nmappings tab. For `ignore_above`, `ignore_malformed`,\n`ignore_dynamic_beyond_limit` the configuration is done in the Settings\ntab.\n\nIt also introduces a test case only for Stateful\n(enableMappingsSourceFieldSection [is\ndisabled](https://github.com/elastic/kibana/blob/9c6de6aabced9d180bf1d68ec42708c27e5616d6/config/serverless.yml#L112)\nfor serverless)\n\n> Verify that users cannot disable synthetic source for a LogsDB index.","sha":"75e186691509e613d2a0735a15d9aa60fa9c13a8"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/206548","number":206548,"mergeCommit":{"message":"[Index Management] Test LogsDb Index Template Modifications (#206548)\n\nPart of https://github.com/elastic/kibana/issues/203716\n\n## Summary\nThis PR introduces a new test case for LogsDB in both Stateful and\nServerless:\n\n> Verify that users can override LogsDB index settings including:\nignore_above, ignore_malformed, ignore_dynamic_beyond_limit, subobjects\nand timestamp format.\n\nFor modify `subobjects` and `timestamp` format it must be done from the\nmappings tab. For `ignore_above`, `ignore_malformed`,\n`ignore_dynamic_beyond_limit` the configuration is done in the Settings\ntab.\n\nIt also introduces a test case only for Stateful\n(enableMappingsSourceFieldSection [is\ndisabled](https://github.com/elastic/kibana/blob/9c6de6aabced9d180bf1d68ec42708c27e5616d6/config/serverless.yml#L112)\nfor serverless)\n\n> Verify that users cannot disable synthetic source for a LogsDB index.","sha":"75e186691509e613d2a0735a15d9aa60fa9c13a8"}}]}] BACKPORT--> Co-authored-by: Sonia Sanz Vivas <[email protected]>
…206548) Part of elastic#203716 ## Summary This PR introduces a new test case for LogsDB in both Stateful and Serverless: > Verify that users can override LogsDB index settings including: ignore_above, ignore_malformed, ignore_dynamic_beyond_limit, subobjects and timestamp format. For modify `subobjects` and `timestamp` format it must be done from the mappings tab. For `ignore_above`, `ignore_malformed`, `ignore_dynamic_beyond_limit` the configuration is done in the Settings tab. It also introduces a test case only for Stateful (enableMappingsSourceFieldSection [is disabled](https://github.com/elastic/kibana/blob/9c6de6aabced9d180bf1d68ec42708c27e5616d6/config/serverless.yml#L112) for serverless) > Verify that users cannot disable synthetic source for a LogsDB index.
Part of #203716
Summary
This PR introduces a new test case for LogsDB in both Stateful and Serverless:
For modify
subobjects
andtimestamp
format it must be done from the mappings tab. Forignore_above
,ignore_malformed
,ignore_dynamic_beyond_limit
the configuration is done in the Settings tab.It also introduces a test case only for Stateful (enableMappingsSourceFieldSection is disabled for serverless)