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

go-ipfs ~~0.4.16~~ => 0.4.17 #28

Merged
merged 13 commits into from
Jul 28, 2018
25 changes: 11 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
"test:node": "cross-env IPFS_REUSEPORT=false aegir test -t node -f test/node.js",
"test:browser": "cross-env IPFS_REUSEPORT=false aegir test -t browser --no-cors -f test/browser.js"
},
"pre-push": [
"lint"
],
"repository": {
"type": "git",
"url": "git+https://github.com/ipfs/interop.git"
Expand All @@ -38,35 +35,35 @@
},
"homepage": "https://github.com/ipfs/interop#readme",
"devDependencies": {
"aegir": "^13.1.0",
"aegir": "^15.1.0",
"async": "^2.6.1",
"bl": "^2.0.0",
"bl": "^2.0.1",
"bs58": "^4.0.1",
"buffer-loader": "0.0.1",
"chai": "^4.1.2",
"cross-env": "^5.1.6",
"cross-env": "^5.2.0",
"cids": "~0.5.3",
"detect-node": "^2.0.3",
"dir-compare": "^1.4.0",
"dirty-chai": "^2.0.1",
"eslint-plugin-react": "^7.8.2",
"expose-loader": "^0.7.5",
"eslint-plugin-react": "^7.10.0",
"expose-loader": "~0.7.5",
"form-data": "^2.3.2",
"go-ipfs-dep": "~0.4.15",
"go-ipfs-dep": "~0.4.17",
"hat": "0.0.3",
"ipfs": "~0.30.0",
"ipfs-api": "^22.0.0",
"ipfsd-ctl": "~0.37.0",
"ipfs": "~0.30.1",
"ipfs-api": "^22.2.4",
"ipfsd-ctl": "~0.39.0",
"left-pad": "^1.3.0",
"libp2p-websocket-star-rendezvous": "~0.2.3",
"lodash": "^4.17.10",
"mocha": "^5.2.0",
"ncp": "^2.0.0",
"pretty-bytes": "^5.0.0",
"pretty-bytes": "^5.1.0",
"random-fs": "^1.0.3",
"rimraf": "^2.6.2",
"stream-to-promise": "^2.2.0",
"transform-loader": "^0.2.4"
"transform-loader": "~0.2.4"
},
"contributors": []
}
72 changes: 45 additions & 27 deletions test/exchange-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const join = require('path').join
const os = require('os')
const hat = require('hat')

const isWindows = os.platform() === 'win32'
// const isWindows = os.platform() === 'win32'

const rmDir = promisify(rimraf)

Expand All @@ -30,26 +30,37 @@ function tmpDir () {
return join(os.tmpdir(), `ipfs_${hat()}`)
}

const KB = 1024
const MB = KB * 1024
// const GB = MB * 1024

const sizes = [
1024,
1024 * 62,
KB,
62 * KB,
// starts failing with spdy
1024 * 64,
1024 * 512,
1024 * 768,
1024 * 1023,
1024 * 1024,
1024 * 1024 * 4,
1024 * 1024 * 8
64 * KB,
512 * KB,
768 * KB,
1023 * KB,
MB,
4 * MB,
8 * MB,
64 * MB,
128 * MB
// 512 * MB,
// GB
]

const dirs = [
5,
10,
50,
100
50
// 100,
// 1000
]

const timeout = 240 * 1000

describe('exchange files', () => {
let goDaemon
let jsDaemon
Expand All @@ -58,7 +69,7 @@ describe('exchange files', () => {
let nodes

before(function (done) {
this.timeout(50 * 1000)
this.timeout(timeout)

parallel([
(cb) => goDf.spawn({ initOptions: { bits: 1024 } }, cb),
Expand All @@ -74,10 +85,14 @@ describe('exchange files', () => {
})
})

after((done) => parallel(nodes.map((node) => (cb) => node.stop(cb)), done))
after(function (done) {
this.timeout(timeout)

parallel(nodes.map((node) => (cb) => node.stop(cb)), done)
})

it('connect go <-> js', function (done) {
this.timeout(50 * 1000)
this.timeout(timeout)

let jsId
let goId
Expand Down Expand Up @@ -107,7 +122,7 @@ describe('exchange files', () => {
})

it('connect js <-> js', function (done) {
this.timeout(50 * 1000)
this.timeout(timeout)

let jsId
let js2Id
Expand Down Expand Up @@ -138,8 +153,10 @@ describe('exchange files', () => {

describe('cat file', () => sizes.forEach((size) => {
it(`go -> js: ${pretty(size)}`, function (done) {
this.timeout(50 * 1000)
this.timeout(timeout)

const data = crypto.randomBytes(size)

waterfall([
(cb) => goDaemon.api.add(data, cb),
(res, cb) => jsDaemon.api.cat(res[0].hash, cb)
Expand All @@ -151,8 +168,10 @@ describe('exchange files', () => {
})

it(`js -> go: ${pretty(size)}`, function (done) {
this.timeout(50 * 1000)
this.timeout(timeout)

const data = crypto.randomBytes(size)

waterfall([
(cb) => jsDaemon.api.add(data, cb),
(res, cb) => goDaemon.api.cat(res[0].hash, cb)
Expand All @@ -164,8 +183,10 @@ describe('exchange files', () => {
})

it(`js -> js: ${pretty(size)}`, function (done) {
this.timeout(20 * 1000)
this.timeout(timeout)

const data = crypto.randomBytes(size)

waterfall([
(cb) => js2Daemon.api.add(data, cb),
(res, cb) => jsDaemon.api.cat(res[0].hash, cb)
Expand All @@ -179,14 +200,11 @@ describe('exchange files', () => {

// TODO these tests are not fetching the full dir??
describe('get directory', () => dirs.forEach((num) => {
// skipping until https://github.com/ipfs/interop/issues/9 is addressed
if (isWindows) {
return
}

it(`go -> js: depth: 5, num: ${num}`, function () {
this.timeout(50 * 1000)
this.timeout(timeout)

const dir = tmpDir()

return randomFs({
path: dir,
depth: 5,
Expand All @@ -203,7 +221,7 @@ describe('exchange files', () => {
})

it(`js -> go: depth: 5, num: ${num}`, function () {
this.timeout(50 * 1000)
this.timeout(timeout)

const dir = tmpDir()
return randomFs({
Expand All @@ -222,7 +240,7 @@ describe('exchange files', () => {
})

it(`js -> js: depth: 5, num: ${num}`, function () {
this.timeout(80 * 1000)
this.timeout(timeout)

const dir = tmpDir()
return randomFs({
Expand Down
2 changes: 1 addition & 1 deletion test/node.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-env mocha */
'use strict'

require('./pubsub')
require('./circuit')
require('./repo')
require('./exchange-files')
require('./kad-dht')
require('./pubsub')
require('./pin')
3 changes: 2 additions & 1 deletion test/pin.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ describe('pin', function () {
})
})

describe(`go and js pinset storage are compatible`, function () {
// FIXME: https://github.com/ipfs/js-ipfs/issues/1467
describe.skip('go and js pinset storage are compatible', function () {
function pipeline (options) {
// by starting each daemon with the same repoPath, they
// will read/write pins from the same datastore.
Expand Down
8 changes: 4 additions & 4 deletions test/repo.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ function catAndCheck (api, hash, data, callback) {
})
}

describe('repo', () => {
// The repo was again changed on go-ipfs 0.4.16
// TODO: create spec tests for repo
describe.skip('repo', () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

📍

// skipping until https://github.com/ipfs/interop/issues/8 is addressed
if (isWindows) {
return
Expand Down Expand Up @@ -77,9 +79,7 @@ describe('repo', () => {
], done)
})

// This was last due to an update on go-ipfs that changed how datastore is
// configured
it.skip('read repo: js -> go', function (done) {
it('read repo: js -> go', function (done) {
this.timeout(50 * 1000)
const dir = path.join(os.tmpdir(), hat())
const data = crypto.randomBytes(1024 * 5)
Expand Down