Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

files interop tests currently failing #50

Closed
alanshaw opened this issue Dec 18, 2018 · 3 comments
Closed

files interop tests currently failing #50

alanshaw opened this issue Dec 18, 2018 · 3 comments
Labels
kind/bug A bug in existing code (including security flaws) P1 High: Likely tackled by core team if no one steps up

Comments

@alanshaw
Copy link
Member

Using js-ipfs master we're getting failures reading files and directories that do not exist. The error message has changed.

 1) files
       returns an error when reading non-existent files:

      AssertionError: expected { Object (message, code) } to deeply equal { Object (message, code) }
      + expected - actual

       {
         "code": 0
      -  "message": "file does not exist"
      +  "message": "/i-do-not-exist-0.7005556072496701 does not exist"
       }
      
      at results.forEach.res (test/files.js:93:50)
      at Array.forEach (<anonymous>)
      at Promise.all.then.results (test/files.js:93:15)
      at process._tickCallback (internal/process/next_tick.js:68:7)

  2) files
       returns an error when writing deeply nested files and the parents do not exist:

      AssertionError: expected { Object (message, code) } to deeply equal { Object (message, code) }
      + expected - actual

       {
         "code": 0
      -  "message": "file does not exist"
      +  "message": "directory does not exist"
       }
      
      at results.forEach.res (test/files.js:93:50)
      at Array.forEach (<anonymous>)
      at Promise.all.then.results (test/files.js:93:15)
      at process._tickCallback (internal/process/next_tick.js:68:7)

cc @achingbrain

@achingbrain
Copy link
Member

We probably want to make the tests less strict here.

"file does not exist"
"/i-do-not-exist-0.7005556072496701 does not exist"

The first error is returned by go-ipfs, the second is by js-ipfs and is (I think) more useful to the user.

"file does not exist"
"directory does not exist"

Similar thing here - the error is caused by the intermediate directories not existing, so the second error is more expressive of the actual problem (though could include the directory path).

What do you think?

@alanshaw
Copy link
Member Author

alanshaw commented Dec 18, 2018

I agree the message is more descriptive on the JS IPFS side. Testing for "does not exist" in the message is good enough IMHO!

@daviddias daviddias added kind/bug A bug in existing code (including security flaws) P1 High: Likely tackled by core team if no one steps up labels Jan 19, 2019
@alanshaw
Copy link
Member Author

fixed by 7c74643 in #51

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug A bug in existing code (including security flaws) P1 High: Likely tackled by core team if no one steps up
Projects
None yet
Development

No branches or pull requests

4 participants