-
Notifications
You must be signed in to change notification settings - Fork 919
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
[Tests] Migrate VisBuilder functional tests into Dashboards repo #6102
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6102 +/- ##
==========================================
+ Coverage 67.31% 67.33% +0.02%
==========================================
Files 3348 3348
Lines 64966 64966
Branches 10465 10465
==========================================
+ Hits 43729 43743 +14
+ Misses 18690 18677 -13
+ Partials 2547 2546 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
956523e
to
341f24c
Compare
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. The security overrides need to be validated but that isnt applicable to the local cypress tests so should not block this PR.
cypress/fixtures/example.json
Outdated
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.
Do we need 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.
Removed
const resizeObserverLoopErrRe = /^[^(ResizeObserver loop limit exceeded)]/; | ||
Cypress.on('uncaught:exception', (err) => { | ||
/* returning false here prevents Cypress from failing the test */ | ||
if (resizeObserverLoopErrRe.test(err.message)) { | ||
return false; | ||
} | ||
}); |
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?
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 was migrated as it is from FT Repo. I think without this we are seeing errors on few of Vis builder tests. We might want to dive deep into the tests which are exposing this behavior but for now keeping the parity with FT repo tests I'm just keeping this logic in place.
ResizeObserver loop limit exceeded
When Cypress detects uncaught errors originating from your application it will automatically fail the current test.
This behavior is configurable, and you can choose to turn this off by listening to theuncaught:exception
event.
https://on.cypress.io/uncaught-exception-from-application
at (http://localhost:5601/app/vis-builder/#/?_q=(filters:!(),query:(language:kuery,query:''))&_a=(metadata:(editor:(errors:(),state:clean),originatingApp:dashboards),style:(addLegend:!t,addTooltip:!t,legendPosition:right,type:histogram),ui:(),visualization:(activeVisualization:(aggConfigParams:!(),name:histogram),indexPattern:a031e530-5a88-11ed-a595-f5e6ea9b3826,searchField:''))&_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:'2021-12-31T08:00:00.000Z',to:'2022-10-02T07:00:00.000Z')):0:0)
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.
Think we should catch these errors instead of skipping it like 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.
Agreed! I think this is more of a Cypress version specific issue than application and might have been introduced in FT repo as a workaround till they upgrade. I see this thread about the same: cypress-io/cypress#8418
May be as part of Cypress version upgrade effort, we can get rid of similar stuff.
* This overwrites the default visit command to authenticate before visiting | ||
* webpages if SECURITY_ENABLED cypress env var is true | ||
*/ | ||
Cypress.Commands.overwrite('visit', (orig, url, options) => { |
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.
Have we validated these overrides?
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'm still validating/fixing issues for running security enabled tests and its overrides. But as you said should not be a blocker for this PR or to run local CI.
341f24c
to
8d84da3
Compare
8f10eb6
to
4df7360
Compare
cypress/utils/commands.js
Outdated
}; | ||
|
||
export const CURRENT_TENANT = { | ||
defaultTenant: 'private', |
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.
make this global please
Signed-off-by: Manasvini B Suryanarayana <manasvis@amazon.com>
4df7360
to
e1e834e
Compare
@@ -0,0 +1,4123 @@ | |||
{ |
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.
do you think we can compress these large files and update the helper function to modify it? also, not sure if the ndjson vs json.txt was intentionally i think we should standardize our saved objects
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.
can we standardize the structure of this? might need to be compressed too
Hi @manasvinibs , are we targeting this PR for 2.15 or 2.16? |
Convert to draft due to no progress. |
Description
Issues Resolved
Testing the changes
Run Cypress Tests for ciGroup11 should run all the tests for visBuilders app in the CI.
https://github.com/opensearch-project/OpenSearch-Dashboards/actions/runs/8220159200/job/22478945672?pr=6102
Check List
yarn test:jest
yarn test:jest_integration