Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Unable to run http-api tests #1204

Closed
JonKrone opened this issue Feb 5, 2018 · 2 comments
Closed

Unable to run http-api tests #1204

JonKrone opened this issue Feb 5, 2018 · 2 comments

Comments

@JonKrone
Copy link
Contributor

JonKrone commented Feb 5, 2018

  • Version:
js-ipfs version: 0.27.7
Repo version: 6
System version: x64/win32
Node.js version: v8.5.0
  • Platform: MINGW64_NT-10.0 2.9.0(0.318/5/3) x86_64 Msys
  • Subsystem: js-ipfs-api?

Type: Question / bug

Severity: Medium

Description:

Unable to run js-ipfs/http-api tests. Seems only to happen with tests - I haven't run into any issues with regular jspfs commands.

Relevant error seems to be:
: The filename, directory name, or volume label syntax is incorrect. Error: IO error: C:\Projects\js-ipfs\test\repo-tests-run\datastore/MANIFEST-000014

Steps to reproduce the error:

DEBUG=repo* npm run test:node:http.

I think this is a Windows-only issue, would like verification though.

Sample output:

$ DEBUG=repo* npm run test:node:http                                                                                                                    
                                                                                                                                                        
> ipfs@0.27.7 test:node:http C:\Projects\js-ipfs                                                                                                        
> aegir test -t node -f test/http-api/index.js                                                                                                          
                                                                                                                                                        
Test Node.js                                                                                                                                                                                                                                                                                                  
                                                                                                                                                        
  HTTP API                                                                                                                                              
...
2018-02-05T15:53:37.727Z repo creating datastore                                                                                                        
2018-02-05T15:53:37.737Z repo creating blocks                                                                                                           
2018-02-05T15:53:37.739Z repo created blocks                                                                                                            
: The filename, directory name, or volume label syntax is incorrect. Error: IO error: C:\Projects\js-ipfs\test\repo-tests-run\datastore/MANIFEST-000014 
                                                                                                                                                        
    1) "before all" hook                                                                                                                                

...
                                                                                                                               
  1) HTTP API                                                                                                                                           
       "before all" hook:                                                                                                                               
: The filename, directory name, or volume label syntax is incorrect.ts-run\datastore/MANIFEST-000014                                                    
                                                                                                                                                        
      at node_modules\levelup\lib\levelup.js:117:34                                                                                                     
      at node_modules\leveldown\node_modules\abstract-leveldown\abstract-leveldown.js:40:16                                                             ```

For some reason (I think for non-TTY terminal reasons), the error output is truncated on the line just above the stacktrace. The relevant error is right above the 1) "before all" hook line.

@JonKrone
Copy link
Contributor Author

JonKrone commented Feb 5, 2018

Looks like it might be that nefarious / before MANIFEST. I've dug around looking for where that's coming from and I think it's coming from levelDOWN's compiled C code. I'm having a bear of a time figuring out where exactly, though.

The test creates a new repo by copying a fixture, test/fixtures/go-ipfs-repo. Could it be that that fixture has something os-specific that my test is picking up? As I understand, levelDOWN reads the datastore/CURRENT file for the name of the most recent MANIFEST file. If it's able to properly access \CURRENT for the name of the manifest file, why is it failing for \MANIFEST?

@JonKrone
Copy link
Contributor Author

It seems like file endings were important for this and just about everything ipfs. Both git and my editor were changing line endings on me automatically which totally threw off all the tests.

If there are other devs that are using Windows, I suggest changing Git's autocrlf setting to respect the source line endings of code it pulls down: git config core.autocrlf input. If you run into this problem in the middle of your work you can stash unsaved changes and delete basically everything except your .git folder and then re-checkout the files you deleted git checkout -- .

@ghost ghost removed the status/ready Ready to be worked label Feb 20, 2018
MicrowaveDev pushed a commit to galtproject/js-ipfs that referenced this issue May 22, 2020
I'm assuming that's what it was supposed to be.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants