AlaSQL / alasql

AlaSQL.js - JavaScript SQL database for browser and Node.js. Handles both traditional relational tables and nested JSON data (NoSQL). Export, store, and import data from localStorage, IndexedDB, or Excel.
http://alasql.org
MIT License
7.01k stars 653 forks source link

npm test: Failing tests with local files. #564

Closed a-gorbunov closed 8 years ago

a-gorbunov commented 8 years ago

"npm test" results in 5 fails

1) Test 238 Test from string and into string 1. JSON:
2) Test 238 Test from string and into string 2. CSV() and AS:
3) Test 238 Test from string and into string 3. XLSX:
4) Test 242 Multi-columns Excel file 1. Read multi-column file:
5) Test 242 Multi-columns Excel file 2. Read multi-column file:

All with similar error:

     Error: ENOENT: no such file or directory, open 'C:\UsersUserDesktopTelecomalasql  est\test238.json'
      at Error (native)
      at Object.fs.openSync (fs.js:549:18)
      at Object.fs.writeFileSync (fs.js:1156:15)
      at Object.utils.saveFile (C:\Users\User\Desktop\Telecom\alasql\dist\alasql.js:3441:23)
      at Object.alasql.into.JSON (C:\Users\User\Desktop\Telecom\alasql\dist\alasql.js:13811:21)
      at eval [as intoallfn] (eval at <anonymous> (C:\Users\User\Desktop\Telecom\alasql\dist\alasql.js:6811:22), <anonymous>:3:33)
      at queryfn3 (C:\Users\User\Desktop\Telecom\alasql\dist\alasql.js:6102:19)
      at queryfn (C:\Users\User\Desktop\Telecom\alasql\dist\alasql.js:5817:12)
      at statement (C:\Users\User\Desktop\Telecom\alasql\dist\alasql.js:6819:14)
      at Function.alasql.dexec (C:\Users\User\Desktop\Telecom\alasql\dist\alasql.js:4160:27)
      at Function.alasql.exec (C:\Users\User\Desktop\Telecom\alasql\dist\alasql.js:4111:17)
      at alasql (C:\Users\User\Desktop\Telecom\alasql\dist\alasql.js:120:18)
      at Context.<anonymous> (C:\Users\User\Desktop\Telecom\alasql\test\test238.js:15:9)
      at callFnAsync (C:\Users\User\AppData\Roaming\npm\node_modules\mocha\lib\runnable.js:306:8)
      at Test.Runnable.run (C:\Users\User\AppData\Roaming\npm\node_modules\mocha\lib\runnable.js:261:7)
      at Runner.runTest (C:\Users\User\AppData\Roaming\npm\node_modules\mocha\lib\runner.js:421:10)
      at C:\Users\User\AppData\Roaming\npm\node_modules\mocha\lib\runner.js:528:12
      at next (C:\Users\User\AppData\Roaming\npm\node_modules\mocha\lib\runner.js:341:14)
      at C:\Users\User\AppData\Roaming\npm\node_modules\mocha\lib\runner.js:351:7
      at next (C:\Users\User\AppData\Roaming\npm\node_modules\mocha\lib\runner.js:283:14)
      at Immediate._onImmediate (C:\Users\User\AppData\Roaming\npm\node_modules\mocha\lib\runner.js:319:5)

Something wrong with directory separators, I guess

Operating System: Windows 7 Ultimate 64-bit (6.1, Build 7601) Service Pack 1 Language: Russian (Regional Setting: Russian) Node: v4.2.3 npm: v2.14.7

agershun commented 8 years ago

Probably the proble is in the filename preparation procedure. The name C:\UsersUserDesktopTelecomalasql lacks of \.

mathiasrw commented 8 years ago

Are you sure you dont have a folder named UsersUserDesktopTelecomalasql on your C drive? (just joking...)

I have no idea why it treated the \ as escape char, but if we can swap them to "/" the problem will not be there.

a-gorbunov commented 8 years ago

Heh, tested at work. OS: Win 10 Professional Other values - same as above. Same error :)

agershun commented 8 years ago

Andrey, hi!

I just changed these tests (added path.normalize()) May I ask you to pull changes and test again in Win7 environment. Thank you!

a-gorbunov commented 8 years ago

Pulled "develop" branch. Win10: same errors + 1.

  6) Test 383 - MySQL compatibility issue #452 6. ON UPDATE:

      AssertionError: false == true
      + expected - actual

      -false
      +true

      at Context.<anonymous> (C:\Users\Andrey\Desktop\alasql\test\test383.js:104:5)
      at callFnAsync (C:\Users\Andrey\AppData\Roaming\npm\node_modules\mocha\lib\runnable.js:338:8)
      at Test.Runnable.run (C:\Users\Andrey\AppData\Roaming\npm\node_modules\mocha\lib\runnable.js:290:7)
      at Runner.runTest (C:\Users\Andrey\AppData\Roaming\npm\node_modules\mocha\lib\runner.js:422:10)
      at C:\Users\Andrey\AppData\Roaming\npm\node_modules\mocha\lib\runner.js:533:12
      at next (C:\Users\Andrey\AppData\Roaming\npm\node_modules\mocha\lib\runner.js:342:14)
      at C:\Users\Andrey\AppData\Roaming\npm\node_modules\mocha\lib\runner.js:352:7
      at next (C:\Users\Andrey\AppData\Roaming\npm\node_modules\mocha\lib\runner.js:284:14)
      at Immediate._onImmediate (C:\Users\Andrey\AppData\Roaming\npm\node_modules\mocha\lib\runner.js:320:5)
agershun commented 8 years ago

Okay. Thank you, I will work on it. Good thing - this problem is not AlaSQL directly, but only tests.

For 383 - will check.

mathiasrw commented 8 years ago

Anything new on this?

mathiasrw commented 8 years ago

I will close this. Please reopen if anything new comes up.