-
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
[Logs UI] Make version dependent test only run for intended version. #188901
[Logs UI] Make version dependent test only run for intended version. #188901
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
Pinging @elastic/obs-ux-logs-team (Team:obs-ux-logs) |
thanks for tackling this, @awahab07! I wonder if it would make sense to have both variants of the tests tagged this way so that one that only runs when ES |
Yes, this should be possible and would be a neat way. I'll be pushing more changes soon. |
…trics-ui-upgrade-highlight-es-api-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.
Using this.onlyEsVersion(esVersion)
in particular case is not following the original use case and leads to extra filtering on FTR side. Let me know your thoughts on alternative I posted
// All entries contain the highlights | ||
entries.forEach((entry) => { | ||
entry.columns.forEach((column) => { | ||
if ('field' in column && 'highlights' in column && column.highlights.length > 0) { | ||
expect(column.highlights).to.eql(['generate_test_data/simple_logs']); | ||
} | ||
}); |
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 believe the test will look "cleaner" if version is get directly in test:
import semver from 'semver';
...
const kibanaServer = getService('kibanaServer');
const currentVersion = kibanaServer.version.get();
const expectation = semver.gte(currentVersion, '8.10.0') ? [highlightTerms] : highlightTerms.split(' ');
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.
@dmlemeshko thanks for the suggestion. The test is dependent on ES version as there's a change in ES API. Will kibanaServer.version.get()
work in this case?
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.
Hi @dmlemeshko, that indeed looks less verbose. But your example binds it to the Kibana version and not the ES version. Since our goal here is to have different behavior on ES compatibility tests this difference is important. Do you know of a way to do what you show in your example but with respect to the ES version?
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. Then you can use es
service:
const es = getService('es');
const response = await es.info();
const version = response.body.version.number;
…trics-ui-upgrade-highlight-es-api-test
@elasticmachine merge upstream |
@elasticmachine merge upstream |
…trics-ui-upgrade-highlight-es-api-test
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]
History
To update your PR or re-run it, 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.
This looks very elegant, nice job. It's hard to test this in a realistic forward-compat test within this PR, so I guess we'll have to keep an eye on it once backported.
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…rsion. (#188901) (#191925) # Backport This will backport the following commits from `main` to `7.17`: - [[Logs UI] Make version dependent test only run for intended version. (#188901)](#188901) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Abdul Wahab Zahid","email":"awahab07@yahoo.com"},"sourceCommit":{"committedDate":"2024-09-02T12:24:27Z","message":"[Logs UI] Make version dependent test only run for intended version. (#188901)\n\nFixes #163845\r\n\r\n## Summary\r\n\r\nA test in 7.17 is skipped because an ES API in the later versions has\r\nchanged. The PR branches the test to handle both cases, before and after\r\nthe API change. The PR should be backported to 7.17 once merged in main.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"ccbef9f9a5aec5a3abb5c7d4a3574c896bc55f8b","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:obs-ux-logs","v8.16.0","v7.17.24","backport:version"],"number":188901,"url":"https://github.com/elastic/kibana/pull/188901","mergeCommit":{"message":"[Logs UI] Make version dependent test only run for intended version. (#188901)\n\nFixes #163845\r\n\r\n## Summary\r\n\r\nA test in 7.17 is skipped because an ES API in the later versions has\r\nchanged. The PR branches the test to handle both cases, before and after\r\nthe API change. The PR should be backported to 7.17 once merged in main.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"ccbef9f9a5aec5a3abb5c7d4a3574c896bc55f8b"}},"sourceBranch":"main","suggestedTargetBranches":["7.17"],"targetPullRequestStates":[{"branch":"main","label":"v8.16.0","labelRegex":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/188901","number":188901,"mergeCommit":{"message":"[Logs UI] Make version dependent test only run for intended version. (#188901)\n\nFixes #163845\r\n\r\n## Summary\r\n\r\nA test in 7.17 is skipped because an ES API in the later versions has\r\nchanged. The PR branches the test to handle both cases, before and after\r\nthe API change. The PR should be backported to 7.17 once merged in main.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"ccbef9f9a5aec5a3abb5c7d4a3574c896bc55f8b"}},{"branch":"7.17","label":"v7.17.24","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
Fixes #163845
Summary
A test in 7.17 is skipped because an ES API in the later versions has changed. The PR branches the test to handle both cases, before and after the API change. The PR should be backported to 7.17 once merged in main.