{{ message }}
fix: code coverage incomplete on redirect#660
Merged
emilyrohrbough merged 15 commits intoOct 25, 2023
Merged
Conversation
mschile
reviewed
Jun 14, 2023
mschile
reviewed
Jun 14, 2023
| "support-utils.js", | ||
| "task-utils.js" | ||
| "task-utils.js", | ||
| "support.js" |
Contributor
There was a problem hiding this comment.
Why is this being excluded?
Contributor
Author
There was a problem hiding this comment.
If you run the unit-tests, support.js is reported as having too little coverage, but support.js is not even being tested (only support-utils.js). I thought that this is an issue with my code, but I get the same result on the main branch.
mschile
reviewed
Jun 15, 2023
Co-authored-by: Matt Schile <mschile@gmail.com>
Contributor
Author
|
@mschile , @cacieprins This MR has been hanging around for almost 4 months. Is there something I can do to get this merged? |
Contributor
|
Hi @fvclaus 👋, sorry for the delay. I will try to get back to this very soon. |
mschile
approved these changes
Oct 23, 2023
emilyrohrbough
approved these changes
Oct 25, 2023
emilyrohrbough
left a comment
Member
There was a problem hiding this comment.
@fvclaus Nice job tracking down the root-cause of this issues. We appreciate the contribution!
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

We have a frontend that, upon loading, redirects the user to Keycloak. The user logs in and is returned to the application. The code coverage written to the disk was incomplete and after hours of debugging I found the issue. The problem is the caching of references to the
window.__coverage__object. When the code that redirects the user is instrumented, the covered statements will be different for the initial redirect and the subsequent return so this plugin will correctly recognize them as different and will keep a reference to both coverage objects. When the code that redirects the user is not instrumented (because it is a library), the coverage object will be identical. Both coverage objects will have identical statement coverage and the current version of the code will throw away the second coverage object, keeping only the reference to the first one which is not updated anymore. This will result in a code coverage where only the statments until the call to the library are covered.Before:
After:
Keywords for Google: Code coverage different in
afterEach.