node-redis-server icon indicating copy to clipboard operation
node-redis-server copied to clipboard

fix: Do not quote spawn args on Windows

Open pke opened this issue 4 years ago • 11 comments

Without setting windowsVerbatimArguments: true in the spawn options the redis-server would be spawned with redis-server.exe "--port 3679" which it would not accept as a valid argument.

pke avatar Oct 26 '19 23:10 pke

@BrandonZacharie not sure why the tests would fail now. Could you take a look please?

pke avatar Oct 26 '19 23:10 pke

I had Travis CI run tests on the development branch again since they had not not been run in over a year to make sure they still pass and they do.

BrandonZacharie avatar Oct 28 '19 20:10 BrandonZacharie

I see two things are needed here. First, I suppose windowsVerbatimArguments should only equal true when running under Windows. Second, a Travis CI configuration that will run tests under Windows in addition to Linux.

BrandonZacharie avatar Oct 28 '19 20:10 BrandonZacharie

Thanks for looking into this. According to the nodejs docs the windowsVerbatimArguments argument is ignored on anything but Windows, so it should be safe.

I'll add a Travis CI config entry for Windows.

pke avatar Oct 28 '19 21:10 pke

Hmmm, adding Windows CI target did not really help. It checks out the code with CRLF endings and the linter already errors. And the tests that do run, have the same timeout problem as in linux env. But I fail to see how my change causes the tests to fail.

pke avatar Nov 05 '19 23:11 pke

@BrandonZacharie I've just run the tests on the master branch on a fresh linux machine. They fail with 3 tests.

image

So this has nothing to do with my patch for Windows. Could you please verify on your side again the tests are fine?

pke avatar Nov 10 '19 20:11 pke

@BrandonZacharie I've just run the tests on the master branch on a fresh linux machine. They fail with 3 tests.

image

So this has nothing to do with my patch for Windows. Could you please verify on your side again the tests are fine?

It looks like your tests are failing because that port is taken; I assume Redis is already running

BrandonZacharie avatar Nov 11 '19 02:11 BrandonZacharie

The tests pass for me locally and pass in CI. There may be dragons but I haven't been able to reproduce errors except when changing windowsVerbatimArguments.

BrandonZacharie avatar Nov 11 '19 02:11 BrandonZacharie

What version of Redis are you running on Linux?

BrandonZacharie avatar Nov 11 '19 02:11 BrandonZacharie

Redis server v=5.0.3 sha=00000000:0 malloc=jemalloc-5.1.0 bits=64 build=afa0decbb6de285f

pke avatar Nov 13 '19 09:11 pke

Running this on a system with no redis running from the master branch results in the exact 3 failed tests. I am out of ideas. Which redis are you testing with? @BrandonZacharie

pke avatar Nov 14 '19 13:11 pke