opensearch-project / OpenSearch-Dashboards

📊 Open source visualization dashboards for OpenSearch.
https://opensearch.org/docs/latest/dashboards/index/
Apache License 2.0
1.65k stars 861 forks source link

[Feature] How to enable cypress coverage for plugins #975

Open joshuali925 opened 2 years ago

joshuali925 commented 2 years ago

Is your feature request related to a problem? Please describe.

Most of plugins use cypress for integration tests, which are not giving coverage currently. Cypress supports code coverage, I spent some time but couldn't get it to work. Here is what I tried:

  1. enable istanbul in .babalrc
  2. add .nycrc
  3. enable coverage in support
  4. add coverage task in cypress plugins
  5. also tried to use cypress webpack preprocessor

Cypress shows 0 for all source files except the files used by tests. Looks like the code is not instrumented, I tried to clean cache and rebuild but didn't work. Could this be related to webpack config from core?

Describe the solution you'd like

Some guidance from core on how to instrument plugin code to enable code coverage

kavilla commented 2 years ago

Right now we don't have officially support cypress within core so we will have to spend sometime doing some RnD, or we can try to see if this repo has more insight: https://github.com/opensearch-project/opensearch-dashboards-functional-test

tmarkley commented 2 years ago

Related to #754

zhongnansu commented 2 years ago

Right now we don't have officially support cypress within core so we will have to spend sometime doing some RnD, or we can try to see if this repo has more insight: https://github.com/opensearch-project/opensearch-dashboards-functional-test

@kavilla Do we have anything on the roadmap about cypress? Or any issue that tracks it?