-
Notifications
You must be signed in to change notification settings - Fork 407
Test coverage for GitTempDir #1901
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1901 +/- ##
==========================================
- Coverage 91.09% 91.05% -0.05%
==========================================
Files 185 185
Lines 10719 10719
Branches 1575 1575
==========================================
- Hits 9765 9760 -5
- Misses 954 959 +5
Continue to review full report at Codecov.
|
|
Looks like we're good 👌 |
annthurium
left a comment
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.
thanks for making our test coverage more stable! I have a question or two for my own education but nothing blocking.
Why were these files causing flapping in the first place? Were there timing issues or something, where sometimes we met certain conditions and sometimes not?
| } | ||
|
|
||
| await tempDir.ensure(); | ||
| assert.strictEqual(root, tempDir.getRootPath()); |
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.
just for my own education...
you assign root = tempDir.getRootPath on line 11, and then assert that that these are still equal. With this assertion, are you testing that ensure() does not change the root path?
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.
With this assertion, are you testing that
ensure()does not change the root path?
Yup, exactly. I wanted to assert that multiple calls to ensure() wouldn't create new temp directories, basically.
| const tempDir = new GitTempDir(); | ||
| await tempDir.ensure(); | ||
|
|
||
| assert.match(tempDir.getSocketPath(), /^\\\\\?\\pipe\\/); |
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.
fun regex. oh, windows.
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.
Named pipes are fun 🙃
|
Please be sure to read the contributor's guide to the GitHub package before submitting any pull requests.
Requirements
Description of the Change
Adds test coverage for
GitTempDirto prevent coverage flapping in unrelated pull requests.Alternate Designs
I could have only covered the lines that weren't hit by other codepaths, but it's a small class so I just covered the whole thing.
Benefits
GitTempDir is one of the culprits in test coverage flapping that we see on unrelated PRs. This is one step toward minimizing those changes and keeping CodeCov output relevent.
Possible Drawbacks
N/A
Applicable Issues
N/A
Metrics
N/A
Tests
This should raise GitTempDir's coverage to 100%.
Documentation
N/A
Release Notes
N/A
User Experience Research (Optional)
N/A