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

test: 'get recursive' test #741

Merged
merged 9 commits into from
Feb 1, 2017
Merged

test: 'get recursive' test #741

merged 9 commits into from
Feb 1, 2017

Conversation

daviddias
Copy link
Member

Adding since Github acted weird and closed #736

return ipfs('files get QmUhUuiTKkkK8J6JZ9zmj8iNHPuNfGYcszgRumzhHBxEEU').then((out) => {
const directory = path.join(process.cwd(), 'QmUhUuiTKkkK8J6JZ9zmj8iNHPuNfGYcszgRumzhHBxEEU')
expect(fs.readdirSync(directory).length).to.be.eql(8)
// TODO add assertion on content of files
Copy link
Member Author

Choose a reason for hiding this comment

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

@victorbjelkholm your turn, tests are passing :)

(also, make sure to unlink to delete that file, like the other tests do.

Copy link
Member

Choose a reason for hiding this comment

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

@pgte @diasdavid hm, it's not passing for me, getting:

  1) cli --all files with daemon off (requiring js-ipfs core directly) get recursively:

      AssertionError: expected 1 to deeply equal 8
      + expected - actual

      -1
      +8

      at ipfs.then (test/cli/test-files.js:96:56)
      at process._tickDomainCallback (internal/process/next_tick.js:129:7)

  2) cli --all files with daemon on (contacting js-ipfs through http-api) get recursively:

      AssertionError: expected 1 to deeply equal 8
      + expected - actual

      -1
      +8

      at ipfs.then (test/cli/test-files.js:96:56)
      at process._tickDomainCallback (internal/process/next_tick.js:129:7)

Seems it's only pulling down one file rather than 8...

Copy link
Member Author

Choose a reason for hiding this comment

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

Could you try again (fresh npm install)

@daviddias daviddias changed the title test: Add a recursive get test test: 'get recursive' test Jan 30, 2017
@pgte pgte assigned pgte and unassigned victorb Feb 1, 2017
it('add recursively test 1', () => {
return ipfs('files add -r src/init-files/init-docs').then((out) => {
it('add recursively test', () => {
return ipfs('files add -r test/test-data/recursive-get-dir').then((out) => {
Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you for creating a folder that will stay immutable, this will save time in the future :)

Copy link
Member Author

@daviddias daviddias left a comment

Choose a reason for hiding this comment

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

just needs a 'console.log' removed, otherwise LGTM :)

const outDir = path.join(process.cwd(), 'QmYmW4HiZhotsoSqnv2o1oUusvkRM8b9RweBoH7ao5nki2')
rimraf(outDir)
return ipfs('files get QmYmW4HiZhotsoSqnv2o1oUusvkRM8b9RweBoH7ao5nki2').then((out) => {
console.log(out)
Copy link
Member Author

Choose a reason for hiding this comment

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

leftover

@daviddias daviddias merged commit dd21c6d into master Feb 1, 2017
@daviddias daviddias deleted the test/recursive-get branch February 1, 2017 14:43
@daviddias daviddias removed the status/in-progress In progress label Feb 1, 2017
@daviddias
Copy link
Member Author

I've been seeing the get recursive test fail locally and CI for some of the times, does it work 100% in your machine @pgte ?

@pgte
Copy link
Contributor

pgte commented Feb 1, 2017

@diasdavid I haven't been able to make it fail locally..

@daviddias
Copy link
Member Author

I just tried again to see my luck and I got it to fail with the error:

  1) cli files daemon off (directly to core) get recursively:

      AssertionError: expected 1 to equal 0
      + expected - actual

      -1
      +0

      at ipfs.then (test/cli/files.js:190:46)
      at process._tickDomainCallback (internal/process/next_tick.js:129:7)

@daviddias
Copy link
Member Author

@pgte
Copy link
Contributor

pgte commented Feb 1, 2017

@diasdavid correction: I was able to reproduce this. Investigating.

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