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

[Backport 1.x] Adds code coverage reporting (#1478) #3293

Conversation

manasvinibs
Copy link
Member

  • Renames build and test workflow to eliminate ambiguity.
  • Adds coverage generation for jest and mocha tests.
  • Expands coverage collection for jest tests.
  • Utilizes lcov reporter as well as text summary reporter.

Resolves #1339
Prerequisite for #1035

Signed-off-by: Tommy Markley [email protected]
(cherry picked from commit 1caf907)

Description

[Describe what this change achieves]

Issues Resolved

[List any issues this PR will resolve]

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
    • yarn test:ftr
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

@manasvinibs manasvinibs requested a review from a team January 19, 2023 20:41
@manasvinibs manasvinibs added the Skip-Changelog PRs that are too trivial to warrant a changelog or release notes entry label Jan 19, 2023
@manasvinibs manasvinibs force-pushed the backport/backport-1478-to-1.x branch from 4a31624 to 6973f50 Compare January 19, 2023 21:45
"test:jest_integration": "node scripts/jest_integration",
"test:mocha": "node scripts/mocha",
"test:mocha:coverage": "grunt test:mochaCoverage",
"test:mocha:coverage": "yarn nyc --reporter=text-summary --reporter=lcov --report-dir=./target/opensearch-dashboards-coverage/mocha node scripts/mocha",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we know that these work in 1.x?

Copy link
Member Author

Choose a reason for hiding this comment

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

When I tried running the above cmd, I got all the tests passing with below summary

411 passing (7s)


=============================== Coverage summary ===============================
Statements   : 45.54% ( 1956/4295 )
Branches     : 20.79% ( 431/2073 )
Functions    : 25.82% ( 228/883 )
Lines        : 46.59% ( 1908/4095 )
================================================================================
Done in 16.20s.```

joshuarrrr
joshuarrrr previously approved these changes Jan 19, 2023
@joshuarrrr
Copy link
Member

looks like the bootstrap step failed on downloading geckodriver

@manasvinibs
Copy link
Member Author

looks like the bootstrap step failed on downloading geckodriver

I think it's flaky. In the last run, it was passing bootstrap https://github.com/opensearch-project/OpenSearch-Dashboards/actions/runs/3962638107/jobs/6789549417#step:12:1232

@joshuarrrr
Copy link
Member

looks like the bootstrap step failed on downloading geckodriver

I think it's flaky. In the last run, it was passing bootstrap https://github.com/opensearch-project/OpenSearch-Dashboards/actions/runs/3962638107/jobs/6789549417#step:12:1232

yeah, that's usually the case when it errors on fetching some resource.

* Renames build and test workflow to eliminate ambiguity.
* Adds coverage generation for jest and mocha tests.
* Expands coverage collection for jest tests.
* Utilizes `lcov` reporter as well as text summary reporter.

Resolves opensearch-project#1339
Prerequisite for opensearch-project#1035

Signed-off-by: Tommy Markley <[email protected]>
(cherry picked from commit 1caf907)
@manasvinibs manasvinibs force-pushed the backport/backport-1478-to-1.x branch from 6973f50 to 68f1bfb Compare January 20, 2023 00:35
@manasvinibs manasvinibs deleted the backport/backport-1478-to-1.x branch January 20, 2023 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip-Changelog PRs that are too trivial to warrant a changelog or release notes entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants