Skip to content
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

Fix jest tests #255

Merged
merged 5 commits into from
Feb 6, 2024
Merged

Fix jest tests #255

merged 5 commits into from
Feb 6, 2024

Conversation

sumukhswamy
Copy link
Collaborator

@sumukhswamy sumukhswamy commented Jan 30, 2024

Description

added jest tests to increase code coverage and fixed flakey tests in cypress

Issues Resolved

[List any issues this PR will resolve]

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link

codecov bot commented Jan 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (236db60) 53.04% compared to head (b92b443) 59.88%.

❗ Current head b92b443 differs from pull request most recent head b964baa. Consider uploading reports for the commit b964baa to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #255      +/-   ##
==========================================
+ Coverage   53.04%   59.88%   +6.83%     
==========================================
  Files          33       33              
  Lines        1623     1623              
  Branches      288      288              
==========================================
+ Hits          861      972     +111     
+ Misses        674      548     -126     
- Partials       88      103      +15     
Flag Coverage Δ
dashboards-query-workbench 59.88% <ø> (+6.83%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

.cypress/integration/ui.spec.js Show resolved Hide resolved
public/components/QueryResults/QueryResults.tsx Outdated Show resolved Hide resolved
@@ -2181,3 +2196,206 @@ export const mockOpenSearchTreeQuery = {
'{"schema":[{"name":"TABLE_CAT","type":"keyword"},{"name":"TABLE_SCHEM","type":"keyword"},{"name":"TABLE_NAME","type":"keyword"},{"name":"TABLE_TYPE","type":"keyword"},{"name":"REMARKS","type":"keyword"},{"name":"TYPE_CAT","type":"keyword"},{"name":"TYPE_SCHEM","type":"keyword"},{"name":"TYPE_NAME","type":"keyword"},{"name":"SELF_REFERENCING_COL_NAME","type":"keyword"},{"name":"REF_GENERATION","type":"keyword"}],"datarows":[["opensearch-cluster",null,".kibana_1","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,".opendistro-job-scheduler-lock","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,".opendistro-reports-definitions","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,".opendistro-reports-instances","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,".opendistro_security","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,".opensearch-observability","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,".plugins-ml-config","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,".ql-datasources","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,"jaeger-service-2023-01-24","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,"jaeger-span-2023-01-24","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,"opensearch_dashboards_sample_data_ecommerce","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,"opensearch_dashboards_sample_data_flights","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,"opensearch_dashboards_sample_data_logs","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,"otel-v1-apm-service-map","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,"otel-v1-apm-span-000001","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,"otel-v1-apm-span-000002","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,"sample-ecommerce","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,"sample-host-health","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,"sample-http-responses","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,"security-auditlog-2023.10.16","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,"security-auditlog-2023.10.17","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,"security-auditlog-2023.10.18","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,"security-auditlog-2023.10.19","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,"security-auditlog-2023.10.20","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,"security-auditlog-2023.10.21","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,"security-auditlog-2023.10.22","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,"security-auditlog-2023.10.23","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,"security-auditlog-2023.10.24","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,"security-auditlog-2023.10.25","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,"windows","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,".kibana","BASE TABLE",null,null,null,null,null,null],["opensearch-cluster",null,"s3--pWlOosB5t9LzIj0oUsS","BASE TABLE",null,null,null,null,null,null]],"total":32,"size":32,"status":200}',
},
};

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file grows so large, we can do proper breakdown later but wondering if we can move these testing data to another file or even a json file. Keep adding these large piece of data will make it harder and harder to maintain

Signed-off-by: sumukhswamy <sumukhhs@amazon.com>
Signed-off-by: sumukhswamy <sumukhhs@amazon.com>
Signed-off-by: sumukhswamy <sumukhhs@amazon.com>
Signed-off-by: sumukhswamy <sumukhhs@amazon.com>
Signed-off-by: sumukhswamy <sumukhhs@amazon.com>
@sumukhswamy sumukhswamy merged commit 5c06b27 into opensearch-project:main Feb 6, 2024
9 of 10 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Feb 6, 2024
* cypress tests

Signed-off-by: sumukhswamy <sumukhhs@amazon.com>

* changed config for the test to dump data

Signed-off-by: sumukhswamy <sumukhhs@amazon.com>

* added jest tests

Signed-off-by: sumukhswamy <sumukhhs@amazon.com>

* added a few changes for comments

Signed-off-by: sumukhswamy <sumukhhs@amazon.com>

* updated snapshots

Signed-off-by: sumukhswamy <sumukhhs@amazon.com>

---------

Signed-off-by: sumukhswamy <sumukhhs@amazon.com>
(cherry picked from commit 5c06b27)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
sumukhswamy pushed a commit that referenced this pull request Feb 6, 2024
* cypress tests



* changed config for the test to dump data



* added jest tests



* added a few changes for comments



* updated snapshots



---------


(cherry picked from commit 5c06b27)

Signed-off-by: sumukhswamy <sumukhhs@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants