-
Notifications
You must be signed in to change notification settings - Fork 294
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
[ci-visibility] Extract code coverage from cypress
#3159
[ci-visibility] Extract code coverage from cypress
#3159
Conversation
Overall package sizeSelf size: 4.16 MB Dependency sizes
🤖 This report was automatically generated by heaviest-objects-in-the-universe |
Codecov Report
@@ Coverage Diff @@
## master #3159 +/- ##
==========================================
- Coverage 86.95% 86.64% -0.31%
==========================================
Files 322 328 +6
Lines 11763 11866 +103
Branches 33 33
==========================================
+ Hits 10228 10281 +53
- Misses 1535 1585 +50
... and 30 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
155908b
to
566fa65
Compare
I'm moving this back to draft because I found an important bug |
567cc36
to
eaac6b5
Compare
traceId: this.testSuiteSpan.context()._traceId, | ||
spanId: this.testSuiteSpan.context()._spanId, | ||
sessionId: this.testSuiteSpan.context()._traceId, | ||
suiteId: this.testSuiteSpan.context()._spanId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated fix: these names make more sense, given that that's what we end up encoding
ok that should be fixed |
const coverageFiles = getCoveredFilenamesFromCoverage(coverage) | ||
const relativeCoverageFiles = coverageFiles.map(file => getTestSuitePath(file, rootDir)) | ||
const formattedCoverage = { | ||
sessionId: testSuiteSpan.context()._traceId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to call .context()
twice no ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also in jest and mocha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
everytime i use both spanId and traceId i usually "cache" the span context
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true. Will change that
Co-authored-by: Ugaitz Urien <ugaitz.urien@datadoghq.com>
What does this PR do?
If
window.__coverage__
available from the test's context, it means that the web app has been instrumented with code coverage. If that's the case, we extract it.Motivation
First step to making ITR usable with cypress.