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

chore: test compat on windows #980

Merged
merged 2 commits into from Jul 15, 2021

Conversation

jonathanyeung
Copy link
Contributor

@jonathanyeung jonathanyeung commented Jul 15, 2021

Fixing test compat issues that prevent the tests from running/succeeding on Windows:

  1. Various Path Issues
  • Some API's have a lower case vs upper-case for the drive prefix; i.e. c:\ vs C:\. We need to always do case-insensitive string comparisons when doing file path checks.
  • The usual \ vs / issues.
  • Some parameter spacing problems when invoking the Git command
  1. Logger Issues - There's a file handle problem that occurs on Windows with fs/fs-extra that prevents a rename on the log file and leads to the following error. We can just wrap in try/catch as it's not very important where the log ends up during the test:
    Error: EPERM: operation not permitted, rename 'C:\Users\jonat\AppData\Local\Temp\tmp-3032-7f5nAzN3323h\dendron.log' -> 'C:\Users\jonat\AppData\Local\Temp\tmp-3032-7f5nAzN3323h\dendron.log.old'
  	at Object.renameSync (fs.js:772:3)
  	at rename (c:\Code\_dendron\dendron\packages\plugin-core\node_modules\fs-extra\lib\move-sync\move-sync.js:31:8)
  	at doRename (c:\Code\_dendron\dendron\packages\plugin-core\node_modules\fs-extra\lib\move-sync\move-sync.js:23:12)
  	at Object.moveSync (c:\Code\_dendron\dendron\packages\plugin-core\node_modules\fs-extra\lib\move-sync\move-sync.js:17:10)
  	at Function.configure (c:\Code\_dendron\dendron\packages\plugin-core\out\src\logger.js:21:32)
  	at Context.<anonymous> (c:\Code\_dendron\dendron\packages\plugin-core\out\src\test\testUtilsV3.js:191:25)
  	at processImmediate (internal/timers.js:461:21)
  	at process.callbackTrampoline (internal/async_hooks.js:131:14)

There are still some outstanding issues:

  • Some formatting differences in hover causing failures in ReferenceProvider.test.ts - I'll follow up with @SeriousBug
  • Also an outstanding issue with the homedir mock. I'll try to tackle this one later

@kevinslin - is there a way to add a windows flavor to the github CI pass?

@kevinslin kevinslin force-pushed the chore/fix-plugin-core-tests-for-windows branch from acb8516 to 1b7e1ca Compare July 15, 2021 16:26
@kevinslin kevinslin merged commit 8445fec into master Jul 15, 2021
@kevinslin kevinslin deleted the chore/fix-plugin-core-tests-for-windows branch July 15, 2021 16:27
Harshita-mindfire pushed a commit that referenced this pull request Jul 19, 2021
Co-authored-by: Kevin <kevin@dendron.so>
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

2 participants