Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

feat: add progress bar tests #155

Merged
merged 3 commits into from
Oct 18, 2017
Merged

feat: add progress bar tests #155

merged 3 commits into from
Oct 18, 2017

Conversation

dryajov
Copy link
Contributor

@dryajov dryajov commented Oct 6, 2017

No description provided.

it('add a nested dir as array with progress', (done) => {
// Needs https://github.com/ipfs/js-ipfs-api/issues/339 to be fixed
// for js-ipfs-api + go-ipfs
if (!isNode) { return done() }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, why only non-node environment?

Copy link
Contributor Author

@dryajov dryajov Oct 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, good question - this is basically a copy of the above tests which carries this flag.

Edit: I wonder if its valid for that test as well?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@victorbjelkholm check the issue linked in the comments. go-ipfs started error'ing in v0.4.2

@dryajov mind trying running the dir tests (by removing the if clause) against latest go-ipfs and see if this is still an issue?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 @dryajov did you get to try this one too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did, it seems to still be an issue with the latest master.

src/files.js Outdated
expect(file.hash).to.equal(expectedMultihash)
expect(file.path).to.equal(file.hash)
expect(progCount).to.equal(58)
expect(progress).to.equal(57792)
Copy link
Contributor

@daviddias daviddias Oct 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the actual file size? go-ipfs tends to "add more than needed" in the progress bar, often it shows 10N% added

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran all the tests and all have passed, I think this is the actual size. I'll double check tho.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should test for it. .to.equal(sizeOfTheFile)

Copy link
Contributor

@daviddias daviddias Oct 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 @dryajov this is now one of the last things to do in order to get the whole thing merged, mind checking for the right size?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to switch attention to - ipfs/js-ipfs#1036, since that would be a major missing part of the whole effort. I'll resume this as soon as I get that one squared out.

src/files.js Outdated
expect(root.path).to.equal('test-folder')
expect(root.hash).to.equal(expectedRootMultihash)
expect(progCount).to.equal(8)
expect(progress).to.equal(5)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has to be wrong. How can a nested dir full of files have a progress of 5 bytes only?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is indeed wrong, a fix is coming.

@daviddias
Copy link
Contributor

This also needs for the docs to be updated, ref: ipfs-inactive/js-ipfs-http-client#604 (comment)

@dryajov
Copy link
Contributor Author

dryajov commented Oct 12, 2017

This is currently being held by - ipfs/js-ipfs#1036. Through we can probably merge this on its own and it would cover js-ipfs-api interaction with the go-ipfs progress functionality, it is missing from the js-ipfs http api which the above issue is addressing.

@ghost ghost added the in progress label Oct 15, 2017
@dryajov
Copy link
Contributor Author

dryajov commented Oct 15, 2017

docs have been updated.

@daviddias daviddias merged commit fad3fa2 into master Oct 18, 2017
@ghost ghost removed the P0 - Critical label Oct 18, 2017
@daviddias daviddias deleted the feat/progress-bar branch October 18, 2017 09:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants