shelljs icon indicating copy to clipboard operation
shelljs copied to clipboard

Non-windows tests failing on WSL

Open joshi-sh opened this issue 7 years ago • 4 comments

Node version (or tell us if you're using electron or some other framework):

Node v8.12.0

ShellJS version (the most recent version/Github branch you see the bug on):

ShellJS v0.8.2/master

Operating system:

Ubuntu 16.04.3 on WSL for Windows 10

Description of the bug:

Running tests on WSL causes ShellJS to run non-Windows tests and skip Windows-only tests. This generates a lot of noise when running tests.

Example ShellJS command to reproduce the error:

npm test

There doesn't seem to be much of an official way to test for WSL vs native Linux, this seems to be the best way.

joshi-sh avatar Sep 20 '18 07:09 joshi-sh

Annoyingly, at least one test on WSL (which › Windows can search with or without a .exe extension) needs to be run in Linux mode.

joshi-sh avatar Sep 20 '18 08:09 joshi-sh

Can you paste a summary of the actual skips & failures, and describe the intended skips and failures?

nfischer avatar Sep 20 '18 19:09 nfischer

Testing for windows and WSL (here is the diff, I'll submit a PR when we can figure out which tests to skip on WSL) produces the following output:

Warning: skipping platform-dependent test. 'Basic usage with octal codes' on platform: Windows
Warning: skipping platform-dependent test. 'symbolic mode' on platform: Windows
Warning: skipping platform-dependent test. 'symbolic mode, without group' on platform: Windows
Warning: skipping platform-dependent test. 'Test setuid' on platform: Windows
Warning: skipping platform-dependent test. 'Test setgid' on platform: Windows
Warning: skipping platform-dependent test. 'Test sticky bit' on platform: Windows
Warning: skipping platform-dependent test. 'Test directories' on platform: Windows
Warning: skipping platform-dependent test. 'Test recursion' on platform: Windows
Warning: skipping platform-dependent test. 'Test symbolic links w/ recursion  - WARNING: *nix only' on platform: Windows
Warning: skipping platform-dependent test. 'multiple symbolic modes #3' on platform: Windows
Warning: skipping platform-dependent test. 'u+wx' on platform: Windows
Warning: skipping platform-dependent test. 'Multiple symbolic modes at once' on platform: Windows
Warning: skipping platform-dependent test. 'u+rw,g+wx' on platform: Windows
Warning: skipping platform-dependent test. 'Make sure chmod succeeds for a variety of octal codes' on platform: Windows
Warning: skipping platform-dependent test. '-R implies to not follow links' on platform: Windows
Warning: skipping platform-dependent test. 'Missing -R implies -L' on platform: Windows
Warning: skipping platform-dependent test. 'preserve mode bits by default for file' on platform: Windows
Warning: skipping platform-dependent test. '-R implies -P' on platform: Windows
Warning: skipping platform-dependent test. 'using -P explicitly works' on platform: Windows
Warning: skipping platform-dependent test. 'using -PR on a link to a folder does not follow the link' on platform: Windows
Warning: skipping platform-dependent test. '-L overrides -P for copying directory' on platform: Windows
Warning: skipping platform-dependent test. 'Recursive, copies entire directory with no symlinks and -L option does not cause change in behavior' on platform: Windows
Warning: skipping platform-dependent test. 'cp -R should be able to copy a readonly src. issue #98; (Non window platforms only)' on platform: Windows
Warning: skipping platform-dependent test. 'set shell option (TODO: add tests for Windows)' on platform: Windows
Warning: skipping platform-dependent test. '-RAL flag, follows symlinks' on platform: Windows
Warning: skipping platform-dependent test. '-L flag, path is symlink' on platform: Windows
Warning: skipping platform-dependent test. 'follow links to directories by default' on platform: Windows
Warning: skipping platform-dependent test. 'long option, single file' on platform: Windows
Warning: skipping platform-dependent test. 'long option, glob files' on platform: Windows
Warning: skipping platform-dependent test. 'long option, directory' on platform: Windows
Warning: skipping platform-dependent test. 'long option, directory, recursive (and windows converts slashes)' on platform: Windows
Warning: skipping platform-dependent test. 'Check for invalid permissions' on platform: Windows
Warning: skipping platform-dependent test. 'rm -rf on a symbolic link to a dir deletes its contents' on platform: Windows
Warning: skipping platform-dependent test. 'remove broken symbolic link' on platform: Windows
Warning: skipping platform-dependent test. 'remove fifo' on platform: Windows
Warning: skipping platform-dependent test. '-d option fails for a link' on platform: Windows
Warning: skipping platform-dependent test. '-f option succeeds for a link' on platform: Windows
Warning: skipping platform-dependent test. '-L option succeeds for a symlink' on platform: Windows
Warning: skipping platform-dependent test. '-L option works for broken symlinks' on platform: Windows
Warning: skipping platform-dependent test. '-L option fails for missing files' on platform: Windows
Warning: skipping platform-dependent test. 'touching broken link creates a new file' on platform: Windows

joshi-sh avatar Sep 21 '18 05:09 joshi-sh

@joshi-sh I still don't clearly understand what's going on.

  1. Status quo: which tests do we currently skip on WSL that we should not skip?
  2. Status quo: which tests currently run (and fail) on WSL?
  3. Currently, we summarize our supported platforms as "unix" and "Windows". Should we consider WSL to be "unix", "Windows", or does it need its own third category?

nfischer avatar Sep 22 '18 04:09 nfischer