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

Commit

Permalink
only missing circuit relay interop tests
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Nov 8, 2017
1 parent 36afc59 commit bad8232
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 22 deletions.
31 changes: 18 additions & 13 deletions .aegir.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const parallel = require('async/parallel')
const ads = require('./test/utils/another-daemon-spawner')
const js = ads.spawnJsNode
// const go = ads.spawnGoNode
const go = ads.spawnGoNode
const stop = ads.stopNodes

/*
Expand All @@ -12,18 +12,23 @@ const stop = ads.stopNodes
function start (done) {
const base = '/ip4/127.0.0.1/tcp'

parallel([
(cb) => js([`${base}/10007`, `${base}/20007/ws`], true, 31007, 32007, cb),
(cb) => js([`${base}/10008`, `${base}/20008/ws`], true, 31008, 32008, cb),
(cb) => js([`${base}/10012`, `${base}/20012/ws`], true, 31012, 32012, cb),
(cb) => js([`${base}/10013`, `${base}/20013/ws`], true, 31013, 32013, cb),
(cb) => js([`${base}/10014`, `${base}/20014/ws`], true, 31014, 32014, cb),
(cb) => js([`${base}/10015`, `${base}/20015/ws`], true, 31015, 32015, cb)
// (cb) => go([`${base}/10027`, `${base}/20027/ws`], true, 33027, 44027, cb),
// (cb) => go([`${base}/10028`, `${base}/20028/ws`], true, 33028, 44028, cb),
// (cb) => go([`${base}/10031`, `${base}/20031/ws`], true, 33031, 44031, cb),
// (cb) => go([`${base}/10032`, `${base}/20032/ws`], true, 33032, 44032, cb)
], done)
if (!process.env.IPFS_TEST) {
parallel([
(cb) => js([`${base}/10007`, `${base}/20007/ws`], true, 31007, 32007, cb),
(cb) => js([`${base}/10008`, `${base}/20008/ws`], true, 31008, 32008, cb),
(cb) => js([`${base}/10012`, `${base}/20012/ws`], true, 31012, 32012, cb),
(cb) => js([`${base}/10013`, `${base}/20013/ws`], true, 31013, 32013, cb),
(cb) => js([`${base}/10014`, `${base}/20014/ws`], true, 31014, 32014, cb),
(cb) => js([`${base}/10015`, `${base}/20015/ws`], true, 31015, 32015, cb)
], done)
} else {
parallel([
(cb) => go([`${base}/10027`, `${base}/20027/ws`], true, 33027, 44027, cb),
(cb) => go([`${base}/10028`, `${base}/20028/ws`], true, 33028, 44028, cb),
(cb) => go([`${base}/10031`, `${base}/20031/ws`], true, 33031, 44031, cb),
(cb) => go([`${base}/10032`, `${base}/20032/ws`], true, 33032, 44032, cb)
], done)
}
}

module.exports = {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
"test:unit:node:gateway": "aegir test -t node -f test/gateway/index.js",
"test:unit:node:cli": "aegir test -t node -f test/cli/index.js",
"test:unit:browser": "aegir test -t browser --no-cors",
"test:interop": "aegir test -t node -t browser -f test/interop",
"test:interop:node": "aegir test -t node -f test/interop/node.js",
"test:interop:browser": "aegir test -t browser -f test/interop/browser.js",
"test:interop": "IPFS_TEST=interop aegir test -t node -t browser -f test/interop",
"test:interop:node": "IPFS_TEST=interop aegir test -t node -f test/interop/node.js",
"test:interop:browser": "IPFS_TEST=interop aegir test -t browser -f test/interop/browser.js",
"test:benchmark": "echo \"Error: no benchmarks yet\" && exit 1",
"test:benchmark:node": "echo \"Error: no benchmarks yet\" && exit 1",
"test:benchmark:node:core": "echo \"Error: no benchmarks yet\" && exit 1",
Expand Down
2 changes: 1 addition & 1 deletion test/interop/circuit.js → test/interop/circuit-relay.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const js = ads.spawnJsNode
const go = ads.spawnGoNode
const stop = ads.stopNodes

describe.skip('circuit interop', function () {
describe.only('circuit interop', () => {
let jsTCP
let jsTCPAddrs
let jsWS
Expand Down
4 changes: 2 additions & 2 deletions test/interop/node.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env mocha */
'use strict'

require('./repo')
require('./exchange-files')
require('./circuit')
require('./circuit-relay')
require('./kad-dht')
require('./repo')
7 changes: 4 additions & 3 deletions test/interop/repo.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ function catAndCheck (daemon, hash, data, callback) {
(cb) => daemon.api.cat(hash, cb),
(stream, cb) => stream.pipe(bl(cb))
], (err, file) => {
console.log('got file')
expect(err).to.not.exist()
expect(file).to.eql(data)
callback()
})
}

describe.only('repo', () => {
describe('repo', () => {
it('read repo: go -> js', (done) => {
const dir = os.tmpdir() + '/' + Math.ceil(Math.random() * 10000)
const data = crypto.randomBytes(1024 * 5)
Expand Down Expand Up @@ -59,7 +58,9 @@ describe.only('repo', () => {
], done)
})

it('read repo: js -> go', (done) => {
// This was last due to an update on go-ipfs that changed how datastore is
// configured
it.skip('read repo: js -> go', (done) => {
const dir = os.tmpdir() + '/' + Math.ceil(Math.random() * 10000)
const data = crypto.randomBytes(1024 * 5)

Expand Down

0 comments on commit bad8232

Please sign in to comment.