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.
What is this?
This PR adds a Windows CI workflow and fixes a few issues that cause test failures in Windows environments. For the most part, this involves using path helpers rather than hardcoding path separators.
Windows also has issues with atomic file operations. Errors from
rimraf
are now ignored in@percy/core
tests, and the browser installation test was removed due to it also needing to delete files. Since this test was removed, browser installation coverage became zero which prompted a coverage ignore statement to be added. Ultimately, the tests need the browser to be downloaded in order to work, so I'm confident in removing coverage from this file since it is technically tested before any relevant tests run.One final hanging issue was that
@percy/cli-exec
tests were hanging, but only in Windows CI. In a local Windows environment, I was unable to reproduce. Debugging showed it to be because of the browser processes's stdio pipes being left open. Even stranger, is@percy/core
tests were not hanging even though the source seemed to be stemming from there. In the end, I found this internal Node issue in which a comment mentions a workaround for ending the piped streams manually after the process exits. Adding that change indeed fixed the hanging issue, and another comment points to the issue being fixed as of Node 13. Since Node 12 still has a year of life left, we should leave this workaround in for the time being (even though I didn't experience it myself locally).