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

[coverage] fix jest merging #90915

Merged
merged 9 commits into from
Feb 16, 2021

Conversation

dmlemeshko
Copy link
Member

@dmlemeshko dmlemeshko commented Feb 10, 2021

Summary

Follow-up to #89948
PR fixes code coverage collection for jest tests

https://kibana-ci.elastic.co/job/elastic+kibana+qa-research/189

with coverage plugin id fix
https://kibana-ci.elastic.co/job/elastic+kibana+qa-research/192

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@dmlemeshko dmlemeshko added v8.0.0 backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes labels Feb 10, 2021
@dmlemeshko dmlemeshko marked this pull request as ready for review February 13, 2021 09:58
@dmlemeshko dmlemeshko requested review from a team as code owners February 13, 2021 09:58
@dmlemeshko dmlemeshko added the code coverage Issues & PRs about code coverage label Feb 13, 2021
@dmlemeshko
Copy link
Member Author

dmlemeshko commented Feb 13, 2021

@tylersmalley we actually need this change to make coverage work again. Jest tests no longer need merging so I moved report generation right after tests execution. Still we need to store jest report in artefacts for later ingestion to stats. Other changes are mostly cleanup

@dmlemeshko
Copy link
Member Author

@elasticmachine merge upstream

@dmlemeshko
Copy link
Member Author

@elasticmachine merge upstream

Copy link
Member

@mistic mistic left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -1,5 +1,5 @@
{
"id": "coverage-fixtures",
"id": "coverageFixtures",
Copy link
Member Author

Choose a reason for hiding this comment

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

After merging master on Monday I faced this error in functional tests:

11:37:23       │ proc [kibana]  FATAL  Error: Failed to initialize plugins:
11:37:23       │ proc [kibana] 	Plugin "id" must be camelCase, but found: coverage-fixtures. (invalid-manifest, /dev/shm/workspace/kibana12/test/common/fixtures/plugins/coverage/kibana.json)

I changed plugin id according error an looks like it is working fine

Comment on lines +35 to +37

echo " -> Combine code coverage in a single report"
yarn nyc report --nycrc-path src/dev/code_coverage/nyc_config/nyc.jest.config.js
Copy link
Member Author

Choose a reason for hiding this comment

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

Since we run jest tests in a single place now, I added report generation right after tests are done.

Comment on lines -151 to +154
. src/dev/code_coverage/shell_scripts/merge_jest_and_functional.sh
# zip combined reports
tar -czf kibana-coverage.tar.gz target/kibana-coverage/**/*
. src/dev/code_coverage/shell_scripts/merge_functional.sh
. src/dev/code_coverage/shell_scripts/copy_jest_report.sh
# zip functional combined report
tar -czf kibana-functional-coverage.tar.gz target/kibana-coverage/functional-combined/*
Copy link
Member Author

@dmlemeshko dmlemeshko Feb 16, 2021

Choose a reason for hiding this comment

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

We only merge functional tests now, but we still need to copy jest for ingestion. Functional combined report is uploaded separately since jest was already in artefacts after tests execution.

@@ -188,7 +188,7 @@ def withGcsArtifactUpload(workerName, closure) {
def ARTIFACT_PATTERNS = [
'target/junit/**/*',
'target/kibana-*',
'target/kibana-coverage/**/*',
'target/kibana-coverage/jest/**/*',
Copy link
Member Author

Choose a reason for hiding this comment

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

We should not upload kibana-coverage/functional content to artefacts since it is 30 GB of json files and we are not interested in them individually.

Copy link

@LeeDr LeeDr left a comment

Choose a reason for hiding this comment

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

LGTM - assuming the qa-research job works as expected

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@dmlemeshko dmlemeshko merged commit 2fe0d05 into elastic:master Feb 16, 2021
@dmlemeshko dmlemeshko deleted the fix-code-coverage-merge branch January 31, 2022 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting code coverage Issues & PRs about code coverage release_note:skip Skip the PR/issue when compiling release notes v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants