-
Notifications
You must be signed in to change notification settings - Fork 916
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
[Chore] Update timeline default expression #2720
[Chore] Update timeline default expression #2720
Conversation
Thank you so much for doing this! |
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 the cypress ones i would leave the same*, those are BWC tests so it's there to ensure that |
Could we also add to this script to make the query But if we can add to the section to ensure that it updates the value to be |
I am a bit curious. Won't this cause backward compatibility issue? For example, if an saved expression is using |
It should only cause a failure in the test after generation existing timeline visualizations should still contain |
Update default expression from `.es(*)` to `opensearch(*)`. Both work, but we'd prefer the latter Signed-off-by: Josh Romero <[email protected]>
Signed-off-by: Josh Romero <[email protected]>
a16af6b
to
47303cf
Compare
To make sure we continue supporting the old format. Signed-off-by: Josh Romero <[email protected]>
Signed-off-by: Josh Romero <[email protected]>
Thanks @zhongnansu - I went ahead and updated all the other references, except for those in the BWC cypress tests as per @kavilla's note. |
@joshuarrrr @kavilla is there anything pending for this PR? |
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.
Timeline BWC test is passing locally for me
huh... that's surprising. Maybe I'll try re-running and hoping. 🤞 |
converting to draft until I have some time to investigate/fix bwc tests |
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #2720 +/- ##
==========================================
- Coverage 66.41% 66.39% -0.02%
==========================================
Files 3206 3209 +3
Lines 61597 61633 +36
Branches 9503 9507 +4
==========================================
+ Hits 40909 40921 +12
- Misses 18410 18426 +16
- Partials 2278 2286 +8
Flags with carried forward coverage won't be shown. Click here to find out more. see 38 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Signed-off-by: Josh Romero <[email protected]>
Signed-off-by: Josh Romero <[email protected]>
- wait for loader to finish after clicking update Signed-off-by: Josh Romero <[email protected]>
@@ -79,6 +79,10 @@ describe('Generating BWC test data with security', () => { | |||
.find('[data-test-subj="newItemButton"]') | |||
.click(); | |||
cy.get('[data-test-subj="visType-timelion"]').click(); | |||
// update default expression to use `.es(*)` instead of `.opensearch(*)` for bwc |
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.
NIT: do you think we could create a common function
Cypress.Commands.add('clearWithBackspaces', (selector, count) => {
cy.get(selector).then($element => {
const backspaces = '{backspace}'.repeat(count);
$element.type(`{selectAll}${backspaces}`);
});
});
So this could simplifies to
cy.clearWithBackspaces('[class="view-line"]', 15).type('.es(*)');
and this function could also be imported in other tests. I see there are 2 more tests using similar function. maybe put it in a until or common folder?
Also curious why we need these many backspaces
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.
Yeah, I meant to call this out in a comment. For some reason, the {selectAll}
cypress sequence doesn't work in this field the way it's supposed to (or at least the way I understand that it's supposed to work). Previously, when the default expression was .es(*)
, there were 6 total characters - you'll see that some tests "cleared" the input by repeating five backspaces (and reusing the .
). Now that we've made the default expression opensearch(*)
, there are 14 total characters that need deleting, if you delete them one by one. I didn't try .clear()
either, but because it's supposed to just alias type({selectAll}{backspace})
, I suspect it won't work either.
I do like the simplification idea, although I don't think we need a common function for it.
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.
See if you like my latest approach better! I sure do 😁
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.
kk I like it
Signed-off-by: Josh Romero <[email protected]>
Signed-off-by: Josh Romero <[email protected]>
Signed-off-by: Josh Romero <[email protected]>
* [Chore] Update other timeline `es()` examples and test usage to make sure we continue supporting the old format. * [Chore] Update BWC data generation to use es(*) * [Test] Add better programmatic text clearing for monaco editor * [Test] Wait for loader to finish after clicking update Update default expression from `.es(*)` to `opensearch(*)`. Both work, but we'd prefer the latter Signed-off-by: Josh Romero <[email protected]> --------- Signed-off-by: Josh Romero <[email protected]> (cherry picked from commit 7efc231) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
* [Chore] Update timeline default expression (#2720) * [Chore] Update other timeline `es()` examples and test usage to make sure we continue supporting the old format. * [Chore] Update BWC data generation to use es(*) * [Test] Add better programmatic text clearing for monaco editor * [Test] Wait for loader to finish after clicking update Update default expression from `.es(*)` to `opensearch(*)`. Both work, but we'd prefer the latter Signed-off-by: Josh Romero <[email protected]> --------- Signed-off-by: Josh Romero <[email protected]> (cherry picked from commit 7efc231) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md * add changelog Signed-off-by: Josh Romero <[email protected]> --------- Signed-off-by: Josh Romero <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Josh Romero <[email protected]>
* [Chore] Update other timeline `es()` examples and test usage to make sure we continue supporting the old format. * [Chore] Update BWC data generation to use es(*) * [Test] Add better programmatic text clearing for monaco editor * [Test] Wait for loader to finish after clicking update Update default expression from `.es(*)` to `opensearch(*)`. Both work, but we'd prefer the latter Signed-off-by: Josh Romero <[email protected]> --------- Signed-off-by: Josh Romero <[email protected]> Signed-off-by: David Sinclair <[email protected]>
Description
Update default expression from
.es(*)
toopensearch(*)
in the timeline visualization. Both work, but we'd prefer the latterIssues Resolved
#1631
Check List
yarn test:jest
yarn test:jest_integration
yarn test:ftr