-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[test] Enhance testcases to be run on windows #1320
Conversation
Awesome! I gave this a shot on Windows and am seeing one of the tests failing
but this seems likely unrelated to your change. Are you also seeing this test fail? |
Sometimes I do, I'm unsure where this error comes from because when I run the tests a second time the error is gone. This is also why I added the |
|
||
test_script: | ||
- .\node_modules\.bin\tsc --version | ||
- .\node_modules\.bin\tsc -p test |
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.
iirc npx
is cross-platform. Either approach is 🆗with me.
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.
Could be, but npx
was introduced with [email protected]
so this won't work with node@6
.
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.
Ah yes the "fun" of test matricies ^_^ ... technically we could do npm i -g [email protected]
, but it's a lot of time to add to each test run for little-to-no gain. Carry on 👍 🙏
assume(stats.size).equals(4096); | ||
// Either 4096 on Unix or 4100 on Windows | ||
// because of the eol. | ||
assume(stats.size).either([4096, 4100]); |
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.
Can we get the value based on the platform then assert it? If we get 4096
on Windows it's a bug and if we get 4100
on *nix it's a bug. e.g.:
// Either 4096 on Unix or 4100 on Windows because of the eol
const expected = process.platform === 'win32' ? 4100 : 4096;
assume(stats.size).equals(expected);
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.
Would like to see the stat change suggested implemented before merge, but once that's done you have my 👍
... thanks for taking the time to add this @ChrisAlderson!
Added the change you suggested @indexzero, also merged with |
* [test] Windows systems do not have gid or uid * [test] Adjust assumtion of filesize for Windows eol * [test-refactor] Use rimraf to remove test fixtures on all systems * [dist] Add appveyor config to test against Windows * [dist] Disable build section for appveyor * [dist fix] Use tsc in node_modules * [test] Assume size based on platform, requested by @indexzero * [test] close logger to remove log-file on windows
I had a few issues when running the test cases on Windows.
The rest of the commits were for adding AppVeyor CI. If we don't want AppVeyor to test against Windows I can create a new PR.