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

test suite failure #10

Closed
max-mapper opened this issue Oct 16, 2014 · 10 comments
Closed

test suite failure #10

max-mapper opened this issue Oct 16, 2014 · 10 comments

Comments

@max-mapper
Copy link

npm install && npm test fails for me:

test/success/linux-info-zip.zip(buffer): pass

/Users/maxogden/src/js/yauzl/test/test.js:55
              throw new Error(messagePrefix + "not supposed to exist");
                    ^
Error: test/success/unicode.zip(fd): Turmion Kätilöt/: not supposed to exist
    at /Users/maxogden/src/js/yauzl/test/test.js:55:21
    at pendGo (/Users/maxogden/src/js/yauzl/node_modules/pend/index.js:30:3)
    at Pend.go (/Users/maxogden/src/js/yauzl/node_modules/pend/index.js:13:5)
    at ZipFile.<anonymous> (/Users/maxogden/src/js/yauzl/test/test.js:51:27)
    at ZipFile.EventEmitter.emit (events.js:95:17)
    at /Users/maxogden/src/js/yauzl/index.js:237:12
    at /Users/maxogden/src/js/yauzl/index.js:329:5
    at /Users/maxogden/src/js/yauzl/node_modules/fd-slicer/index.js:28:7
    at Object.wrapper [as oncomplete] (fs.js:454:17)
npm ERR! Test failed.  See above for more details.
npm ERR! not ok code 0

this happens for a bunch of the zip files in the success/ folder. if I delete them then npm test finally passes.

could you set up travis CI on this repo? npm install -g travisjs && travisjs init

@malakada
Copy link

@andrewrk
Copy link
Collaborator

looks like maybe it's somehow an OSX issue. Travis wouldn't catch that.

@thejoshwolfe
Copy link
Owner

The test is complaining that there folder test/success/unicode/Turmion Kätilöt doesn't exist. Can you post the results of this command?

$ find test/success/unicode/
test/success/unicode/
test/success/unicode/Turmion Kätilöt
test/success/unicode/Turmion Kätilöt/Hoitovirhe
test/success/unicode/Turmion Kätilöt/Hoitovirhe/Rautaketju.mp3
test/success/unicode/Turmion Kätilöt/Pirun nyrkki
test/success/unicode/Turmion Kätilöt/Pirun nyrkki/Mistä veri pakenee.mp3

@thejoshwolfe
Copy link
Owner

here's another thing to try:

$ node -e "var fs=require('fs');console.log(fs.readdirSync('test/success/unicode'))"
[ 'Turmion Kätilöt' ]

@malakada
Copy link

[Thu Oct 16 14:16:07]$ find test/success/unicode
test/success/unicode
test/success/unicode/Turmion Kätilöt
test/success/unicode/Turmion Kätilöt/Hoitovirhe
test/success/unicode/Turmion Kätilöt/Hoitovirhe/Rautaketju.mp3
test/success/unicode/Turmion Kätilöt/Pirun nyrkki
test/success/unicode/Turmion Kätilöt/Pirun nyrkki/Mistä veri pakenee.mp3
[Thu Oct 16 15:03:06]$ node -e "var fs=require('fs');console.log(fs.readdirSync('test/success/unicode'))"
[ 'Turmion Kätilöt' ]

@thejoshwolfe
Copy link
Owner

I've reproduced this error on windows.

@thejoshwolfe
Copy link
Owner

I've reproduced this error on windows.

false alarm. I ran into a different problem.

@thejoshwolfe
Copy link
Owner

Thanks andrewrk and melissanoelle for helping chase this issue down. It turns out unicode file names are spooky on mac. If a file name has an ä, linux and windows encode it as the unicode "\xc3\xa4", which is just the letter ä. But on mac, ä is an a followed by an umlaut: "\x61\xcc\x88". Why does mac make this more complicated? Why are there two ways to make the ä character in unicode? Whatever.

The conclusion is that the test harness can't trust the host file system, since some file systems scramble the bytes of the file names. I'll need to move the test data into the test code so that expected file paths are deterministic.

@thejoshwolfe
Copy link
Owner

@maxogden, could you see if there are still any test failures for you? thanks.

@max-mapper
Copy link
Author

@thejoshwolfe yep they pass now, thanks!

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

4 participants