-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Ingest code coverage #62336
Ingest code coverage #62336
Conversation
… ingest-code-coverage
… ingest-code-coverage
… ingest-code-coverage
…/kibana into ingest-code-coverage-WITH-MASTER
@tylersmalley thanks for the review sir! :) |
@wayneseymour, went through the code but I have a few questions about the overall approach. What was the reasoning behind publishing the code coverage reports over generating the standard XML and using something like CodeCOV? I am wondering how many people will actually pull up the reports to figure out what should have coverage added. In addition, there is no way for a reviewer to utilize these reports to understand how the coverage is effected. Lastly, I am concerned with including code coverage of functional tests. This code coverage does not carry the same weight as that of unit tests, and I would argue create a false sense of confidence when there is coverage. We should strive to have code coverage through unit tests, and functional tests should be another matter. |
Well, the first question is good for @dmlemeshko to answer, perhaps tonight as he's in Europe. Sorry, I just built what I was asked! lol nice to not be in charge sometimes! lol |
@tylersmalley @dmlemeshko @LeeDr perhaps a zoom is in order? |
@tylersmalley previous meetings with @spalger and our team lead led us down the path to use Istanbul/nyc and to ingest the data into Elasticsearch so we could use Kibana dashboards. I agree that the functional test coverage can be misleading in that it shows the code executed even if a test didn't verify everything on the page. But what it does show in combination with the other test types, and is important, is what code wasn't executed at all. And of course, it's very easy to filter out from any reports you want to look at.
I agree. But that doesn't mean we shouldn't have the data on functional tests. There are areas of code that we can't unit test. It's important for people to understand that you cannot take the average of the different types of tests, nor can you take the sum of them. There's almost certainly a lot of overlap between the different types of tests. If unit tests show 40% coverage and functional tests show 50% coverage, all you can really say is that you have at least 40% coverage (not 45%, not 50%, not 90%). |
We have sync'd with @LeeDr and are fine if you move forward given QA will be owning the project. Given that, would you mind adding an exclusion for Also, oddly enough, I am not seeing code coverage for anything in |
…overage-WITH-MASTER
Why kind sir, art thou suggestion we "eat our own dog food"?! :) |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
1 similar comment
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Summary
Ingest code coverage to Kibana Stats
Hosting
Code coverage Collection
Tools and Tests
We collect coverage for
Running locally
set
CODE_COVERAGE=1
beforekbn bootstrap
In addition, setting
NODE_ENV=test
is required for x-pack jest testsyarn run grunt "test:mochaCoverage"
node scripts/jest --verbose --coverage
node ./legacy/plugins/canvas/scripts/shareable_runtime && node --max-old-space-size=6144 scripts/jest --verbose --detectOpenHandles --coverage
node scripts/functional_tests --exclude-tag "skipCoverage"
Reports
Final reports are 3 separate reports: mocha, jest-combined, functional-combined (we merge coverage collected from oss & x-pack tests into a single report)
Ingestion
Checklist
Delete any items that are not applicable to this PR.
src/dev/code_coverage/ingest_coverage/integration_tests/ingest_coverage.test.js