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

Improve stability in Windows #118

Merged
merged 4 commits into from
Jun 30, 2019
Merged

Improve stability in Windows #118

merged 4 commits into from
Jun 30, 2019

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Jun 30, 2019

In the Windows environment + updated globby v10 (#109), files cannot find from the passed directory. This PR fixes it and improve the stability of tests.

  • Update fast-glob to v3 to fix globbing for non-ASCII file #109 breaks a lot of tests because Marp CLI will pass raw Windows paths (micromatch 4 cannot use backslash as path separator). I've refactored the file finder to use File.findPath for converting and normalizing between glob pattern and real path.
  • The latest Chrome has already fixed unresolved app.exit() of Carlo in Windows. We do no longer use the terminate module to kill the remaining process. (But it's still unstable to handle Chrome process while testing)
  • I don't know why but the engine instance cannot compare with the bundled Marp Core in Windows. So we use the exported function for compare to be able to mock in the test.

The best way to prevent new release included bugs is to add the Windows test environment in CI. CircleCI is not supported Windows, but there is a pre-release for preview now.

@yhatt yhatt merged commit 4ded1f9 into master Jun 30, 2019
@yhatt yhatt deleted the windows-test-stability branch June 30, 2019 15:38
@yhatt
Copy link
Member Author

yhatt commented Jun 30, 2019

A standalone build for Windows still failing to read file from directory 🤔

PS C:\Users\yukih\Downloads\marp-cli-v0.11.3-win> .\marp.exe -s C:\Users\yukih\Documents\marp-cli
C:\snapshot\marp-cli\node_modules\@nodelib\fs.scandir\out\providers\async.js:39
        if (!entry.dirent.isSymbolicLink()) {
                          ^

TypeError: entry.dirent.isSymbolicLink is not a function
    at C:\snapshot\marp-cli\node_modules\@nodelib\fs.scandir\out\providers\async.js:39:27
    at C:\snapshot\marp-cli\node_modules\run-parallel\index.js:43:7
    at Array.forEach (<anonymous>)
    at runParallel (C:\snapshot\marp-cli\node_modules\run-parallel\index.js:42:11)
    at settings.fs.readdir (C:\snapshot\marp-cli\node_modules\@nodelib\fs.scandir\out\providers\async.js:28:9)
    at FSReqWrap.oncomplete (fs.js:171:20)

It causes by fallback to old mode in @nodelib/fs.scandir. We can fix by updating pkg to v4.4 but #111 strikes back. We are going to swap package asset to handmade package built with Windows and pkg v4.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant