-
Notifications
You must be signed in to change notification settings - Fork 20
Conversation
It is still failing, because it uses IPFS for testing and IPFS is not yet windows ready.
The |
test/with-dag-api.js
Outdated
start: false | ||
}) | ||
|
||
node.on('ready', done) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this not already log the error if there is one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, it was just debug code. I'll revert to original.
@@ -10,7 +9,7 @@ module.exports = (node, name, pathRest, ipldResolver, resolve) => { | |||
if (pathRest.length) { | |||
const pathElem = pathRest.shift() | |||
newNode = node[pathElem] | |||
const newName = path.join(name, pathElem) | |||
const newName = name + '/' + pathElem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems slightly correct but not 100%. What if name
ends with a slash or pathElem
starts with a slash? In that case, we'll have double-slash, while path.join would handle it correctly (but not correctly on windows)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally agree with you. Ideally I should be using be path.posix.join
which works just fine on Node. However, in the Browser it fails with TypeError: Cannot read property 'join' of undefined]
. Must be a babel/webpack issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make sure to not let this one pass. Please add a test for @victorbjelkholm's case and ensure it works both in browser and node.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test case (guard) you want can never happen. name
is really a hash, so it can not have shash. pathElem
comes from pathRest
which is an array that is path separated.
# Conflicts: # test/hamt.js
@diasdavid I've spent the day trying to get the tests to work. But the tests, especially in the Browser, just keep failing non-deterministically. Playing with test timeouts is non-productive. My gut feel is that some evil exists between There are a few os-specific issues that I've addressed. Could we just get them into master. |
@pgte can we have you reviewing this one? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally speaking, given that this package does not touch the material host file-system, and that it's named unixfs
, and that UNIX exposes a file system where paths are separated by the /
character, I think that the path separators should not be changed.
I think that it should be the responsibility of package that accesses the filesystem (js-ipfs
) to translate these paths into native FS paths. Wouldn't you agree?
@richardschneider OK, sorry, misunderstood your intent, it's clear now for me, Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍
@pgte Not sure of the protocol. Do I merge the PR now, and wait for @diasdavid to then release it NPM? |
not sure, usually it's @diasdavid that merges.. |
package.json
Outdated
@@ -11,7 +11,7 @@ | |||
"build": "aegir build", | |||
"test": "aegir test", | |||
"test:node": "aegir test --target node", | |||
"test:browser": "aegir test --target browser", | |||
"test:browser": "aegir test --target browser --timeout 30000", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not use global timeouts. We want to have timeouts per test.
@@ -10,7 +9,7 @@ module.exports = (node, name, pathRest, ipldResolver, resolve) => { | |||
if (pathRest.length) { | |||
const pathElem = pathRest.shift() | |||
newNode = node[pathElem] | |||
const newName = path.join(name, pathElem) | |||
const newName = name + '/' + pathElem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make sure to not let this one pass. Please add a test for @victorbjelkholm's case and ensure it works both in browser and node.js
test/browser.js
Outdated
// require('./exporter')(repo) | ||
// require('./exporter-subtree')(repo) | ||
require('./exporter')(repo) | ||
require('./exporter-subtree')(repo) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why enable these?
test/exporter-subtree.js
Outdated
@@ -36,7 +36,7 @@ module.exports = (repo) => { | |||
fileEql(files[0], smallFile, done) | |||
}) | |||
) | |||
}) | |||
}).timeout(10 * 1000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a small nitpick but a useful one. We prefer to have the timeouts at the top of the test so that it is easy to find it.
test/with-dag-api.js
Outdated
@@ -105,7 +107,8 @@ const strategyOverrides = { | |||
|
|||
} | |||
|
|||
describe('with dag-api', () => { | |||
// TODO: waiting for IPFS support on windows, https://github.com/ipfs/js-ipfs-unixfs-engine/issues/196 | |||
describe.skip('with dag-api', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not skip tests. I understand that you need js-ipfs support on windows but enabling this test will only make Appveyor fail, which is fine while Windows Support is a work in progress
All CI is red, something must have gone wrong. |
As usual, the Browser tests are failing. |
This reverts commit c6f2bff.
@diasdavid LGTM could you please review again |
No description provided.