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

run-tests.js is broken for cmd.exe #294

Closed
nfischer opened this issue Jan 19, 2016 · 15 comments
Closed

run-tests.js is broken for cmd.exe #294

nfischer opened this issue Jan 19, 2016 · 15 comments

Comments

@nfischer
Copy link
Member

I was trying out run-tests.js on my Windows machine, and ran into lots of problems. Since we're trying to get good support for Windows, I figured I'd make this a formal issue so that others can chime in and confirm the behavior I'm seeing.

The end-goal of this issue is to open up cmd.exe on Windows, cd to the shelljs directory, type npm test, and see that all the tests pass. To me this seems like a worthy goal.

With that said, if someone else sees behavior different from what I'm seeing, please verify that you're running everything through cmd.exe, like I am. I already know this can run on some other shells (Bash, for instance), but I'd like to see this work on this particular shell.

Initial problems I've seen:

  • must use node path/to/jshint in the run-tests script, instead of relying on the shebang
  • must expand wildcards ourselves, not relying on the shell, since cmd relies on the application to expand them, and jshint doesn't appear to be doing this
  • exec() will start in the current working directory if run through cmd.exe. If we pass the cwd argument to child_process.exec(), then this will fix the issue only for admin mode (not regular user mode). I think this is only possible to fix for admin mode. This means that all our exec calls will need pwd() prefixed to the paths.

I'll add more to the list in comments as I find the issues.

@nfischer
Copy link
Member Author

I'll open a PR later that at least gets jshint working properly (and should work on both Windows and Linux).

@mtscout6
Copy link

Have you considered getting a CI setup with AppVeyor? It's a free service like travis that runs on Windows machines. It also supports GitHub integration like Travis for Pull Requests so you know they work with both Windows and Linux based systems.

@nfischer
Copy link
Member Author

Yes! We're working on setting up AppVeyor (although this issue sounds like it needs to be fixed before AppVeyor can be useful). If you have any experience writing an AppVeyor configure file, help would be appreciated 👍

@mtscout6
Copy link

I did one for react-bootstrap which is:

https://github.com/react-bootstrap/react-bootstrap/blob/master/appveyor.yml


version: '{build}'

# Install scripts. (runs after repo cloning)
install:
  # Get the latest stable version of io.js
  - ps: Install-Product node ''
  - npm -g install npm@latest
  - set PATH=%APPDATA%\npm;%PATH%
  - node --version
  - npm --version
  - npm install

# No need for MSBuild on this project
build: off

test_script:
  - npm test

@nfischer
Copy link
Member Author

Awesome! That looks great, thank you! @ariporad what do you think?

@nfischer
Copy link
Member Author

@mtscout6 Would you be able to take a look at #298? I'm using the same yml, and the project is configured to only run AppVeyor on branches with the yml file. Unfortunately, I'm not seeing AppVeyor integration on the PR, although the page for it is https://ci.appveyor.com/project/nfischer/shelljs. Could it perhaps be ignoring the yml file? Thanks in advance!

@mtscout6
Copy link

I'll have to look at it tomorrow when I'm back in front of a computer.

On Tue, Jan 19, 2016, 17:15 Nate Fischer notifications@github.com wrote:

@mtscout6 https://github.com/mtscout6 Would you be able to take a look
at #298 #298? I'm using the same
yml, and the project is configured to only run AppVeyor on branches with
the yml file. Unfortunately, I'm not seeing AppVeyor integration on the PR,
although the page for it is
https://ci.appveyor.com/project/nfischer/shelljs. Could it perhaps be
ignoring the yml file? Thanks in advance!


Reply to this email directly or view it on GitHub
#294 (comment).

@nfischer
Copy link
Member Author

Thanks! It seems like it's only running on the master branch, not the PR, which might explain it

@mtscout6
Copy link

At first glance I think you're missing this:

screen shot 2016-01-20 at 10 05 10 am

Here's a screenshot of React-Bootstrap's configuration as well:

screen shot 2016-01-20 at 10 09 50 am

It's odd some things can be controlled through the yaml file, but not everything. It's in typical Microsoft fassion.

@mtscout6
Copy link

If you're up for granting me access to that project in AppVeyor I can poke around and see if anything stands out to me.

@nfischer
Copy link
Member Author

Yup, I was missing that. I double checked that our settings match yours and will try another commit later today to test. Thanks!

@mtscout6
Copy link

Another issue with why AppVeyor is not getting triggered is because you need to setup a webhook in Github.

Here's more of React-Bootstrap's configuration:

screen shot 2016-01-20 at 5 13 46 pm

@mtscout6
Copy link

These are the specific details of that webhook:

screen shot 2016-01-20 at 5 16 11 pm

@nfischer
Copy link
Member Author

Ok, great! Unfortunately, I don't have access to the settings for this repo, so I won't be able to get that modified just yet. @ariporad @arturadib would one of you be able to grant access or set this up? I can provide the webhook.

@ariporad
Copy link
Contributor

@nfischer: Nope, waiting on @arturadib to give both of us admin access to the shelljs org. Then we can.

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