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

Feat/circuit relay #6

Merged
merged 50 commits into from
May 28, 2018
Merged
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
81b1e99
feat: port to new ipfsd-ctl
dryajov Dec 21, 2017
7013f88
fix: removing factory
dryajov Dec 23, 2017
65295bf
feat: adopting latest changes to ipfsd-ctl
dryajov Jan 11, 2018
4052ffa
chore: upping ipfsd-ctl version
dryajov Jan 17, 2018
e444539
test: increase timeouts
dryajov Jan 17, 2018
21eaeac
test: fixing circuit tests
dryajov Jan 18, 2018
6cc1628
test: run kad-dht tests in browser
dryajov Jan 18, 2018
4b8907b
wip: adding browser relay tests
dryajov Jan 24, 2018
d40a5bf
increase timeouts
dryajov Jan 25, 2018
9243b65
feat: add missing circuit tests from node runs
dryajov Jan 27, 2018
7a62388
fix: avoid using default API and Gateway ports
dryajov Jan 29, 2018
c61c5fd
feat: adding go to js test
dryajov Jan 29, 2018
90b7320
fix: /ipv4 -> /ip4
dryajov Jan 29, 2018
e4e1790
fix: cant relay if both the relay and one of the nodes are browser
dryajov Jan 29, 2018
46f172f
test: skip `get directory` tests on windows
dryajov Jan 29, 2018
98a7d04
fix: skip repo tests on windows
dryajov Jan 29, 2018
e9e8f73
fix: skip browser tests in node
dryajov Jan 30, 2018
655be31
fix: remove repo tests from browser runs
dryajov Jan 30, 2018
9f91929
fix: timeouts
dryajov Jan 30, 2018
4dd9b5f
fix: timeouts
dryajov Jan 30, 2018
b124d28
feat: increase browser inactivity timeout to make windows hapy
dryajov Jan 30, 2018
d504b65
feat: adding all missing browser tests
dryajov Jan 30, 2018
e938f61
fix: use IPFS_REUSEPORT untille new version of go-ipfs is released
dryajov Feb 2, 2018
d02d608
experiment: remove individual timeouts to rule time out related failures
dryajov Feb 2, 2018
0af7ac5
tests: reworking
dryajov Feb 3, 2018
645bf5f
remove runaway only
dryajov Mar 3, 2018
08d168c
lint
dryajov Mar 3, 2018
14059ed
even better tests
dryajov Mar 3, 2018
4f7451f
test: connect browser nodes with tiemout
dryajov Mar 3, 2018
35253ac
parametrize timeouts
dryajov Mar 3, 2018
1a947d3
reenable skipped test
dryajov Mar 3, 2018
3bb68f9
skip go-browser-browser
dryajov Mar 4, 2018
7157e5d
timeout
dryajov Mar 5, 2018
6ff891e
cleanup based on review
dryajov Mar 6, 2018
e5f617a
fix: naming of funcs
dryajov Mar 6, 2018
59e6a85
fix: naming of funcs
dryajov Mar 6, 2018
e2a007f
split circuit tests
dryajov Mar 6, 2018
c29f3a9
chore: rename files
dryajov Mar 6, 2018
9e9c38c
increase timeout
dryajov Mar 6, 2018
d5dd246
fix: missing import
dryajov Mar 6, 2018
4b3ee06
chore: remove .only
dryajov Mar 6, 2018
efcb48e
chore: add TODO regarding CAN_HOP
dryajov Mar 6, 2018
51a7118
several small fixes
dryajov Mar 6, 2018
06a4b9f
fix: pass options
dryajov Mar 7, 2018
1c261a7
review last commit
dryajov Mar 7, 2018
650876d
chore: updated todo
dryajov Mar 7, 2018
26daf07
chore: up deps
dryajov Mar 17, 2018
2a686e4
fix: daemon type in tests
dryajov Mar 18, 2018
b0e669a
Merge branch 'master' into feat/circuit-relay
daviddias May 28, 2018
9a2efbc
test: skip circuit tests. waiting for go-ipfs 0.4.15
daviddias May 28, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: removing factory
dryajov committed Mar 3, 2018

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit 7013f8830fe5b1c9040ee3c360a8babe0fa9c673
3 changes: 2 additions & 1 deletion .aegir.js
Original file line number Diff line number Diff line change
@@ -11,7 +11,8 @@ module.exports = {
served: true,
included: false
}],
singleRun: true
singleRun: true,
browserNoActivityTimeout: 100 * 1000
},
hooks: {
browser: {
4 changes: 3 additions & 1 deletion test/browser.js
Original file line number Diff line number Diff line change
@@ -2,5 +2,7 @@
'use strict'

// require('./exchange-files')
require('./repo')
// require('./pubsub')
// require('./kad-dht')
require('./circuit-relay')
require('./repo')
71 changes: 28 additions & 43 deletions test/circuit-relay.js
Original file line number Diff line number Diff line change
@@ -12,7 +12,8 @@ const series = require('async/series')
const waterfall = require('async/waterfall')
const multiaddr = require('multiaddr')
const crypto = require('crypto')
const IPFSFactory = require('./utils/ipfs-factory-instance')
const IPFS = require('ipfs')
const createRepo = require('./utils/create-repo-nodejs')

const isNode = require('detect-node')

@@ -37,19 +38,27 @@ function setupInProcNode (factory, addrs, hop, callback) {
hop = false
}

factory.spawnNode(null, Object.assign({}, baseConf, {
Addresses: {
Swarm: addrs
},
EXPERIMENTAL: {
relay: {
enabled: true,
hop: {
enabled: hop
const node = new IPFS({
repo: createRepo(),
init: { bits: 1024 },
config: Object.assign({}, baseConf, {
Addresses: {
Swarm: addrs
},
EXPERIMENTAL: {
relay: {
enabled: true,
hop: {
enabled: hop
}
}
}
}
}), callback)
})
})

node.once('ready', () => {
callback(null, node)
})
}

function setUpJsNode (addrs, hop, callback) {
@@ -264,9 +273,7 @@ function tests (relayType) {
return
}

this.timeout(50 * 1000)

let factory
this.timeout(90 * 1000)

let browserNode1
let browserNode2
@@ -275,11 +282,9 @@ function tests (relayType) {
let browserNode2Addrs

before(function (done) {
factory = new IPFSFactory()

parallel([
(cb) => setupInProcNode(factory, [], false, cb),
(cb) => setupInProcNode(factory, [], false, cb)
(cb) => setupInProcNode([], false, cb),
(cb) => setupInProcNode([], false, cb)
], (err, nodes) => {
expect(err).to.not.exist()
browserNode1 = nodes[0]
@@ -292,8 +297,6 @@ function tests (relayType) {
})
})

after((done) => factory.dismantle(done))

it('should connect and transfer', function (done) {
const data = crypto.randomBytes(128)
series([
@@ -316,17 +319,13 @@ function tests (relayType) {

this.timeout(50 * 1000)

let factory

let browserNode1
let jsTCP
let jsTCPAddrs

before(function (done) {
factory = new IPFSFactory()

parallel([
(cb) => setupInProcNode(factory, [], false, cb),
(cb) => setupInProcNode([], false, cb),
(cb) => setUpJsNode([`${base}/35003`], cb)
], (err, nodes) => {
expect(err).to.not.exist()
@@ -339,12 +338,7 @@ function tests (relayType) {
})
})

after((done) => {
parallel([
(cb) => factory.dismantle(cb),
(cb) => jsTCP.stop(cb)
], done)
})
after((done) => jsTCP.stop(done))

it('should connect and transfer', function (done) {
const data = crypto.randomBytes(128)
@@ -368,17 +362,13 @@ function tests (relayType) {

this.timeout(50 * 1000)

let factory

let browserNode1
let goTCP
let goTCPAddrs

before(function (done) {
factory = new IPFSFactory()

parallel([
(cb) => setupInProcNode(factory, [], false, cb),
(cb) => setupInProcNode([], false, cb),
(cb) => setUpGoNode([`${base}/35003`], cb)
], (err, nodes) => {
expect(err).to.not.exist()
@@ -392,12 +382,7 @@ function tests (relayType) {
})
})

after((done) => {
parallel([
(cb) => factory.dismantle(cb),
(cb) => goTCP.stop(cb)
], done)
})
after((done) => goTCP.stop(done))

it('should connect and transfer', function (done) {
const data = crypto.randomBytes(128)
7 changes: 4 additions & 3 deletions test/exchange-files.js
Original file line number Diff line number Diff line change
@@ -172,7 +172,8 @@ describe('exchange files', () => {

// TODO these tests are not fetching the full dir??
describe('get directory', () => dirs.forEach((num) => {
it(`go -> js: depth: 5, num: ${num}`, () => {
it(`go -> js: depth: 5, num: ${num}`, function () {
this.timeout(10 * 1000)
const dir = tmpDir()
return randomFs({
path: dir,
@@ -190,7 +191,7 @@ describe('exchange files', () => {
})

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

const dir = tmpDir()
return randomFs({
@@ -209,7 +210,7 @@ describe('exchange files', () => {
})

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

const dir = tmpDir()
return randomFs({
1 change: 1 addition & 0 deletions test/kad-dht.js
Original file line number Diff line number Diff line change
@@ -33,6 +33,7 @@ describe.skip('kad-dht', () => {
goD2 = nodes[1]
goD3 = nodes[2]
jsD = nodes[3]
done()
})
})

29 changes: 18 additions & 11 deletions test/repo.js
Original file line number Diff line number Diff line change
@@ -5,7 +5,8 @@ const chai = require('chai')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)
const waterfall = require('async/waterfall')

const series = require('async/series')
const crypto = require('crypto')
const os = require('os')
const path = require('path')
@@ -22,8 +23,8 @@ function catAndCheck (api, hash, data, callback) {
})
}

describe.skip('repo', () => {
it.skip('read repo: go -> js', function (done) {
describe('repo', () => {
it('read repo: go -> js', function (done) {
this.timeout(50 * 1000)

const dir = path.join(os.tmpdir(), hat())
@@ -33,20 +34,23 @@ describe.skip('repo', () => {
let jsDaemon

let hash
waterfall([
series([
(cb) => df.spawn({
repoPath: dir,
disposable: false,
initOptions: { bits: 1024 }
}, (err, node) => {
expect(err).to.not.exist()
goDaemon = node
goDaemon.api.add(data, cb)
},
(res, cb) => {
goDaemon.init(cb)
}),
(cb) => goDaemon.start(cb),
(cb) => goDaemon.api.add(data, (err, res) => {
expect(err).to.not.exist()
hash = res[0].hash
catAndCheck(goDaemon.api, hash, data, cb)
},
cb()
}),
(cb) => catAndCheck(goDaemon.api, hash, data, cb),
(cb) => goDaemon.stop(cb),
(cb) => df.spawn({
type: 'js',
@@ -57,9 +61,12 @@ describe.skip('repo', () => {
expect(err).to.not.exist()
jsDaemon = node
cb()
},
}),
(cb) => jsDaemon.start(cb),
(cb) => catAndCheck(jsDaemon.api, hash, data, cb),
(cb) => jsDaemon.stop(cb)
(cb) => jsDaemon.stop(cb),
(cb) => setTimeout(cb, 10500),
(cb) => jsDaemon.cleanup(cb)
], done)
})

63 changes: 0 additions & 63 deletions test/utils/ipfs-factory-instance/index.js

This file was deleted.