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

Unable to get working on Windows under Git Bash using included instructions (No such file or directory) #256

Closed
jameswilddev opened this issue Dec 2, 2019 · 5 comments

Comments

@jameswilddev
Copy link

After following these instructions from the readme, then creating the following file:

@test "this should show up as a test" {
  run "echo something"
  assert_output "something2"
}

Then executing it:

bats test.bats

I see the following output:

$ bats test.bats
/c/Users/james/libexec/bats-core/bats-exec-suite: line 48: /dev/fd/62: No such file or directory

0 tests, 0 failures

These results are mirrorred in a project of mine running on Travis CI. This exact same project works fine on macOS and Linux, so it seems to me that this is some form of incompatability with the Windows environment (though that Travis CI test isn't following the included instructions).

What am I doing wrong?

@jasonkarns
Copy link
Member

I'm making guesses since I can't look into the source at the moment, but the reference to /dev/fd makes me wonder if mingw (the subsystem on which the git-bundled bash runs) supports arbitrary file descriptors...

As mentioned in the readme, bats uses FD3, so my suspicion is that mingw just simply doesn't support file descriptors other than 0, 1 and 2. (This is purely my initial gut speculation, but that's where I'd start)

@jameswilddev
Copy link
Author

As stated this seems to be a limitation of MinGW on Windows. I’ve reverted back to the previous release and that works well. Thanks!

@jasonkarns
Copy link
Member

@jameswilddev would you mind sharing the version(s) that work and those that don't? while I don't think windows is officially supported, if it did work in a previous release, perhaps we can restore it at some point.

@jameswilddev
Copy link
Author

I'm finding that the 1.1.0 release works well. Some of the tools I'm using (bats-assert, bats-support) don't handle error conditions well (you get these file descriptor errors rather than any details when a test fails) but it seems to be enough to ensure that the code works at least.

@ferrisnorth
Copy link

Same, I have reverted to 1.10 so that I can run it on win10

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

No branches or pull requests

3 participants