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

Commit

Permalink
tests: adjusting for ipfsd-ctl changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dryajov committed Jan 2, 2018
1 parent e9dbe6a commit 5d81bcb
Show file tree
Hide file tree
Showing 22 changed files with 52 additions and 58 deletions.
6 changes: 2 additions & 4 deletions test/cli/pubsub.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const ipfsExec = require('../utils/ipfs-exec')
const IPFS = require('../../src')

const DaemonFactory = require('ipfsd-ctl')
const df = DaemonFactory.create()
const df = DaemonFactory.create({ type: 'js' })

const config = {
Bootstrap: [],
Expand Down Expand Up @@ -41,9 +41,8 @@ describe('pubsub', function () {
this.timeout(60 * 1000)

DaemonFactory
.create({ remote: false })
.create({ type: 'proc' })
.spawn({
type: 'proc',
exec: IPFS,
config,
args: ['--enable-pubsub-experiment']
Expand All @@ -59,7 +58,6 @@ describe('pubsub', function () {

before((done) => {
df.spawn({
type: 'js',
args: ['--enable-pubsub-experiment'],
exec: `./src/cli/bin.js`,
config
Expand Down
6 changes: 3 additions & 3 deletions test/cli/swarm.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const ipfsExec = require('../utils/ipfs-exec')
const parallel = require('async/parallel')

const DaemonFactory = require('ipfsd-ctl')
const df = DaemonFactory.create()
const df = DaemonFactory.create({ type: 'js' })

const config = {
Bootstrap: [],
Expand All @@ -36,15 +36,15 @@ describe('swarm', () => {

series([
(cb) => {
df.spawn({ type: 'js', exec: `./src/cli/bin.js`, config }, (err, node) => {
df.spawn({ exec: `./src/cli/bin.js`, config }, (err, node) => {
expect(err).to.not.exist()
ipfsA = ipfsExec(node.repoPath)
nodes.push(node)
cb()
})
},
(cb) => {
df.spawn({ type: 'js', exec: `./src/cli/bin.js`, config }, (err, node) => {
df.spawn({ exec: `./src/cli/bin.js`, config }, (err, node) => {
expect(err).to.not.exist()
node.api.id((err, id) => {
expect(err).to.not.exist()
Expand Down
19 changes: 9 additions & 10 deletions test/core/bitswap.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ const multihashing = require('multihashing-async')
const CID = require('cids')

const DaemonFactory = require('ipfsd-ctl')
const df = DaemonFactory.create()
const df = DaemonFactory.create({ type: 'js' })

const dfProc = DaemonFactory.create({ type: 'proc' })

// This gets replaced by '../utils/create-repo-browser.js' in the browser
const createTempRepo = require('../utils/create-repo-nodejs.js')
Expand Down Expand Up @@ -68,7 +70,6 @@ let nodes = []

function addNode (inProcNode, callback) {
df.spawn({
type: 'js',
exec: `./src/cli/bin.js`,
config: {
Addresses: {
Expand Down Expand Up @@ -114,14 +115,12 @@ describe('bitswap', function () {
})
}

DaemonFactory
.create({ remote: false })
.spawn({ type: 'proc', exec: IPFS, config }, (err, _ipfsd) => {
expect(err).to.not.exist()
nodes.push(_ipfsd)
inProcNode = _ipfsd.api
done()
})
dfProc.spawn({ exec: IPFS, config }, (err, _ipfsd) => {
expect(err).to.not.exist()
nodes.push(_ipfsd)
inProcNode = _ipfsd.api
done()
})
})

afterEach(function (done) {
Expand Down
7 changes: 3 additions & 4 deletions test/core/bootstrap.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const isNode = require('detect-node')
const IPFS = require('../../src')

const DaemonFactory = require('ipfsd-ctl')
const df = DaemonFactory.create({ remote: false })
const df = DaemonFactory.create({ type: 'proc' })

describe('bootstrap', () => {
if (!isNode) {
Expand All @@ -23,7 +23,6 @@ describe('bootstrap', () => {
before(function (done) {
this.timeout(40 * 1000)
df.spawn({
type: 'proc',
exec: IPFS,
config: {
Addresses: {
Expand Down Expand Up @@ -76,7 +75,7 @@ describe('bootstrap', () => {
it('add a peer to the bootstrap list', (done) => {
node.bootstrap.add('/ip4/111.111.111.111/tcp/1001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLUVIT', (err, res) => {
expect(err).to.not.exist()
expect(res).to.be.eql({Peers: ['/ip4/111.111.111.111/tcp/1001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLUVIT']})
expect(res).to.be.eql({ Peers: ['/ip4/111.111.111.111/tcp/1001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLUVIT'] })
node.bootstrap.list((err, list) => {
expect(err).to.not.exist()
expect(list.Peers).to.deep.equal(updatedList)
Expand All @@ -88,7 +87,7 @@ describe('bootstrap', () => {
it('remove a peer from the bootstrap list', (done) => {
node.bootstrap.rm('/ip4/111.111.111.111/tcp/1001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLUVIT', (err, res) => {
expect(err).to.not.exist()
expect(res).to.be.eql({Peers: ['/ip4/111.111.111.111/tcp/1001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLUVIT']})
expect(res).to.be.eql({ Peers: ['/ip4/111.111.111.111/tcp/1001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLUVIT'] })
node.bootstrap.list((err, list) => {
expect(err).to.not.exist()
expect(list.Peers).to.deep.equal(defaultList)
Expand Down
4 changes: 1 addition & 3 deletions test/core/files-sharding.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const pull = require('pull-stream')
const IPFS = require('../../src/core')

const DaemonFactory = require('ipfsd-ctl')
const df = DaemonFactory.create({ remote: false })
const df = DaemonFactory.create({ type: 'proc' })

describe('files directory (sharding tests)', () => {
function createTestFiles () {
Expand All @@ -35,7 +35,6 @@ describe('files directory (sharding tests)', () => {
this.timeout(40 * 1000)

df.spawn({
type: 'proc',
exec: IPFS,
config: {
Addresses: {
Expand Down Expand Up @@ -86,7 +85,6 @@ describe('files directory (sharding tests)', () => {
this.timeout(40 * 1000)

df.spawn({
type: 'proc',
exec: IPFS,
args: ['--enable-sharding-experiment'],
config: {
Expand Down
4 changes: 2 additions & 2 deletions test/core/interface/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ const test = require('interface-ipfs-core')
const IPFS = require('../../../src')

const DaemonFactory = require('ipfsd-ctl')
const df = DaemonFactory.create({ remote: false })
const df = DaemonFactory.create({ type: 'proc' })

const common = {
setup: function (callback) {
callback(null, df, 'proc', IPFS)
callback(null, df, IPFS)
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/core/interface/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ const test = require('interface-ipfs-core')
const IPFS = require('../../../src')

const DaemonFactory = require('ipfsd-ctl')
const df = DaemonFactory.create({ remote: false })
const df = DaemonFactory.create({ type: 'proc' })

const common = {
setup: function (callback) {
callback(null, df, 'proc', IPFS)
callback(null, df, IPFS)
}
}
test.config(common)
4 changes: 2 additions & 2 deletions test/core/interface/dag.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ const test = require('interface-ipfs-core')
const IPFS = require('../../../src')

const DaemonFactory = require('ipfsd-ctl')
const df = DaemonFactory.create({ remote: false })
const df = DaemonFactory.create({ type: 'proc' })

const common = {
setup: function (callback) {
callback(null, df, 'proc', IPFS)
callback(null, df, IPFS)
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/core/interface/dht.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
const test = require('interface-ipfs-core')
const DaemonFactory = require('ipfsd-ctl')
const df = DaemonFactory.create()
const df = DaemonFactory.create({ type: 'proc'})
const common = {
setup: function (callback) {
callback(null, df)
callback(null, df, IPFS)
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/core/interface/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ const test = require('interface-ipfs-core')
const IPFS = require('../../../src')

const DaemonFactory = require('ipfsd-ctl')
const df = DaemonFactory.create({ remote: false })
const df = DaemonFactory.create({ type: 'proc' })

const common = {
setup: function (callback) {
callback(null, df, 'proc', IPFS)
callback(null, df, IPFS)
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/core/interface/generic.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ const test = require('interface-ipfs-core')
const IPFS = require('../../../src')

const DaemonFactory = require('ipfsd-ctl')
const df = DaemonFactory.create({ remote: false })
const df = DaemonFactory.create({ type: 'proc' })

const common = {
setup: function (callback) {
callback(null, df, 'proc', IPFS)
callback(null, df, IPFS)
}
}
test.generic(common)
4 changes: 2 additions & 2 deletions test/core/interface/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ const test = require('interface-ipfs-core')
const IPFS = require('../../../src')

const DaemonFactory = require('ipfsd-ctl')
const df = DaemonFactory.create({ remote: false })
const df = DaemonFactory.create({ type: 'proc' })

const common = {
setup: function (callback) {
callback(null, df, 'proc', IPFS)
callback(null, df, IPFS)
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/core/interface/pubsub.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ const test = require('interface-ipfs-core')
const IPFS = require('../../../src')

const DaemonFactory = require('ipfsd-ctl')
const df = DaemonFactory.create({ remote: false })
const df = DaemonFactory.create({ type: 'proc' })

const common = {
setup: function (callback) {
callback(null, df, 'proc', IPFS)
callback(null, df, IPFS)
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/core/interface/swarm.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ const test = require('interface-ipfs-core')
const IPFS = require('../../../src')

const DaemonFactory = require('ipfsd-ctl')
const df = DaemonFactory.create({ remote: false })
const df = DaemonFactory.create({ type: 'proc' })

const common = {
setup: function (callback) {
callback(null, df, 'proc', IPFS)
callback(null, df, IPFS)
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/core/kad-dht.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ chai.use(dirtyChai)
const parallel = require('async/parallel')

const DaemonFactory = require('ipfsd-ctl')
const df = DaemonFactory.create()
const df = DaemonFactory.create({ type: 'js' })

const config = {
Addresses: {
Expand All @@ -26,7 +26,7 @@ const config = {
}

function createNode (callback) {
df.spawn({ type: 'js', exec: './src/cli/bin.js', config }, callback)
df.spawn({ exec: './src/cli/bin.js', config }, callback)
}

describe('verify that kad-dht is doing its thing', () => {
Expand Down
4 changes: 2 additions & 2 deletions test/http-api/interface/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
const test = require('interface-ipfs-core')

const DaemonFactory = require('ipfsd-ctl')
const df = DaemonFactory.create()
const df = DaemonFactory.create({ type: 'js' })

const common = {
setup: function (callback) {
callback(null, df, 'js', './src/cli/bin.js')
callback(null, df, './src/cli/bin.js')
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/http-api/interface/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
const test = require('interface-ipfs-core')

const DaemonFactory = require('ipfsd-ctl')
const df = DaemonFactory.create()
const df = DaemonFactory.create({ type: 'js' })

const common = {
setup: function (callback) {
callback(null, df, 'js', './src/cli/bin.js')
callback(null, df, './src/cli/bin.js')
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/http-api/interface/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
const test = require('interface-ipfs-core')

const DaemonFactory = require('ipfsd-ctl')
const df = DaemonFactory.create()
const df = DaemonFactory.create({ type: 'js' })

const common = {
setup: function (callback) {
callback(null, df, 'js', './src/cli/bin.js')
callback(null, df, './src/cli/bin.js')
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/http-api/interface/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
const test = require('interface-ipfs-core')

const DaemonFactory = require('ipfsd-ctl')
const df = DaemonFactory.create()
const df = DaemonFactory.create({ type: 'js' })

const common = {
setup: function (callback) {
callback(null, df, 'js', './src/cli/bin.js')
callback(null, df, './src/cli/bin.js')
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/http-api/interface/pubsub.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
const test = require('interface-ipfs-core')

const DaemonFactory = require('ipfsd-ctl')
const df = DaemonFactory.create()
const df = DaemonFactory.create({ type: 'js' })

const common = {
setup: function (callback) {
callback(null, df, 'js', './src/cli/bin.js')
callback(null, df, './src/cli/bin.js')
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/http-api/interface/swarm.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
const test = require('interface-ipfs-core')

const DaemonFactory = require('ipfsd-ctl')
const df = DaemonFactory.create()
const df = DaemonFactory.create({ type: 'js' })

const common = {
setup: function (callback) {
callback(null, df, 'js', './src/cli/bin.js')
callback(null, df, './src/cli/bin.js')
}
}

Expand Down
Loading

0 comments on commit 5d81bcb

Please sign in to comment.