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

Add Windows CI #287

Closed
nfischer opened this issue Jan 12, 2016 · 10 comments
Closed

Add Windows CI #287

nfischer opened this issue Jan 12, 2016 · 10 comments

Comments

@nfischer
Copy link
Member

This is a follow up to our thread on #272 regarding using AppVeyor for Windows CI. I'm posting this as an issue just so I can mark it as high priority (since I think it's a worthy goal).

This issue could take a long time to resolve, since I think it has 3 parts:

  1. Set up AppVeyor (or some other Windows CI) for the project, similar to our travis setup
  2. Adjust our unit tests to be compatible with Windows (I'm not sure if any of them are not compatible, but just in case they are, this should resolve that).
  3. Fix any bugs specific to Windows that we notice from the CI.

I think we can consider merging in AppVeyor CI once 1 and 2 are complete, and then we can use the CI to help us find the bugs for part 3 and quickly resolve those (and mark them as high priority).

@nfischer
Copy link
Member Author

Also, it looks like our unit test framework is indeed broken on Windows. There's a bug with exec() related to #250. All commands get launched from C:\Users\username instead of the current directory (at least that's what I observe on Windows 7, node v5.3.0).

The issue happens in the test runner here and here.

@BYK
Copy link
Contributor

BYK commented Jan 13, 2016

Willing to give a hand on any Windows bugs. I'm running on Windows 10 + Node 4 and a long time Windows user and developer.

@nfischer
Copy link
Member Author

@BYK That'd be great! Could you first verify the behavior I'm seeing? I'm running on Windows 7, and I'd like to double check that this is also present on Windows 10.

> require('shelljs/global');
> // On Windows
> echo(exec('cd').output); // I think this prints the user's home directory every time, regardless of where this is launched from.

@BYK
Copy link
Contributor

BYK commented Jan 13, 2016

@nfischer it looks like it simply outputs the current directory for me. That said I'm using a different shell, something called xonsh, and in that running cd without arguments switched me to my home directory. This is not the case in PowerShell though.

@nfischer
Copy link
Member Author

Interesting... I thought that exec() would always run in cmd.exe by default. What's the behavior in powershell?

If that much works for you, then are you able to run the unit tests with npm test?

@BYK
Copy link
Contributor

BYK commented Jan 13, 2016

Interesting... I thought that exec() would always run in cmd.exe by default.

Oh, it probably does. I just tried the command manually in my shell. Sorry for not being clearer :)

What's the behavior in powershell?

Same as shelljs.

If that much works for you, then are you able to run the unit tests with npm test?

Here's the full output:


> shelljs@0.5.3 test C:\Users\BYK\Documents\Projects\shelljs
> node scripts/run-tests

'.' is not recognized as an internal or external command,
operable program or batch file.
*** JSHINT FAILED! (return code != 0)

Running test: cat.js
Running test: cd.js
Running test: chmod.js

assert.js:89
  throw new assert.AssertionError({
  ^
AssertionError: 438 == 493
    at Object.<anonymous> (C:\Users\BYK\Documents\Projects\shelljs\test\chmod.js:23:8)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Function.Module.runMain (module.js:467:10)
    at startup (node.js:136:18)
    at node.js:963:3
*** TEST FAILED! (missing exit code "123")

Running test: common.js
Running test: config.js
Running test: cp.js

assert.js:89
  throw new assert.AssertionError({
  ^
AssertionError: 0 == 1
    at Object.<anonymous> (C:\Users\BYK\Documents\Projects\shelljs\test\cp.js:142:8)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Function.Module.runMain (module.js:467:10)
    at startup (node.js:136:18)
    at node.js:963:3
*** TEST FAILED! (missing exit code "123")

Running test: dirs.js
Running test: echo.js
Running test: env.js
Running test: exec.js
Running test: find.js
Running test: grep.js
Running test: ln.js

assert.js:89
  throw new assert.AssertionError({
  ^
AssertionError: false == true
    at Object.<anonymous> (C:\Users\BYK\Documents\Projects\shelljs\test\ln.js:51:1)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Function.Module.runMain (module.js:467:10)
    at startup (node.js:136:18)
    at node.js:963:3
*** TEST FAILED! (missing exit code "123")

Running test: ls.js
Running test: make.js
Running test: mkdir.js
Running test: mv.js
Running test: popd.js
Running test: pushd.js

assert.js:89
  throw new assert.AssertionError({
  ^
AssertionError: 'resources\\pushd' == 'resources/pushd'
    at Object.<anonymous> (C:\Users\BYK\Documents\Projects\shelljs\test\pushd.js:193:8)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Function.Module.runMain (module.js:467:10)
    at startup (node.js:136:18)
    at node.js:963:3
*** TEST FAILED! (missing exit code "123")

Running test: pwd.js
Running test: rm.js
Running test: sed.js
Running test: tempdir.js
Running test: test.js

assert.js:89
  throw new assert.AssertionError({
  ^
AssertionError: false == true
    at Object.<anonymous> (C:\Users\BYK\Documents\Projects\shelljs\test\test.js:76:8)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Function.Module.runMain (module.js:467:10)
    at startup (node.js:136:18)
    at node.js:963:3
*** TEST FAILED! (missing exit code "123")

Running test: to.js
Running test: toEnd.js
Running test: touch.js
Running test: which.js

*******************************************************
WARNING: Some tests did not pass!
*******************************************************
npm ERR! Test failed.  See above for more details.

@BYK
Copy link
Contributor

BYK commented Jan 13, 2016

These don't look like difficult things to fix to me.

@nfischer
Copy link
Member Author

Ok, awesome! When I ran it, I couldn't run a single unit test (because exec() always runs commands in the home directory for me on Windows).

If you'd be interested, would you be able to investigate those unit test failures, and report (and/or fix) the bugs as github issues? That would help tremendously in getting this project running smoothly on Windows.

@BYK
Copy link
Contributor

BYK commented Jan 14, 2016

Will do!

@nfischer
Copy link
Member Author

Fixed in #299

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

No branches or pull requests

3 participants