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

Commit 5d81bcb

Browse files
committed
tests: adjusting for ipfsd-ctl changes
1 parent e9dbe6a commit 5d81bcb

22 files changed

+52
-58
lines changed

test/cli/pubsub.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const ipfsExec = require('../utils/ipfs-exec')
1212
const IPFS = require('../../src')
1313

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

1717
const config = {
1818
Bootstrap: [],
@@ -41,9 +41,8 @@ describe('pubsub', function () {
4141
this.timeout(60 * 1000)
4242

4343
DaemonFactory
44-
.create({ remote: false })
44+
.create({ type: 'proc' })
4545
.spawn({
46-
type: 'proc',
4746
exec: IPFS,
4847
config,
4948
args: ['--enable-pubsub-experiment']
@@ -59,7 +58,6 @@ describe('pubsub', function () {
5958

6059
before((done) => {
6160
df.spawn({
62-
type: 'js',
6361
args: ['--enable-pubsub-experiment'],
6462
exec: `./src/cli/bin.js`,
6563
config

test/cli/swarm.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const ipfsExec = require('../utils/ipfs-exec')
1212
const parallel = require('async/parallel')
1313

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

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

3737
series([
3838
(cb) => {
39-
df.spawn({ type: 'js', exec: `./src/cli/bin.js`, config }, (err, node) => {
39+
df.spawn({ exec: `./src/cli/bin.js`, config }, (err, node) => {
4040
expect(err).to.not.exist()
4141
ipfsA = ipfsExec(node.repoPath)
4242
nodes.push(node)
4343
cb()
4444
})
4545
},
4646
(cb) => {
47-
df.spawn({ type: 'js', exec: `./src/cli/bin.js`, config }, (err, node) => {
47+
df.spawn({ exec: `./src/cli/bin.js`, config }, (err, node) => {
4848
expect(err).to.not.exist()
4949
node.api.id((err, id) => {
5050
expect(err).to.not.exist()

test/core/bitswap.spec.js

+9-10
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ const multihashing = require('multihashing-async')
1717
const CID = require('cids')
1818

1919
const DaemonFactory = require('ipfsd-ctl')
20-
const df = DaemonFactory.create()
20+
const df = DaemonFactory.create({ type: 'js' })
21+
22+
const dfProc = DaemonFactory.create({ type: 'proc' })
2123

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

6971
function addNode (inProcNode, callback) {
7072
df.spawn({
71-
type: 'js',
7273
exec: `./src/cli/bin.js`,
7374
config: {
7475
Addresses: {
@@ -114,14 +115,12 @@ describe('bitswap', function () {
114115
})
115116
}
116117

117-
DaemonFactory
118-
.create({ remote: false })
119-
.spawn({ type: 'proc', exec: IPFS, config }, (err, _ipfsd) => {
120-
expect(err).to.not.exist()
121-
nodes.push(_ipfsd)
122-
inProcNode = _ipfsd.api
123-
done()
124-
})
118+
dfProc.spawn({ exec: IPFS, config }, (err, _ipfsd) => {
119+
expect(err).to.not.exist()
120+
nodes.push(_ipfsd)
121+
inProcNode = _ipfsd.api
122+
done()
123+
})
125124
})
126125

127126
afterEach(function (done) {

test/core/bootstrap.spec.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const isNode = require('detect-node')
1010
const IPFS = require('../../src')
1111

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

1515
describe('bootstrap', () => {
1616
if (!isNode) {
@@ -23,7 +23,6 @@ describe('bootstrap', () => {
2323
before(function (done) {
2424
this.timeout(40 * 1000)
2525
df.spawn({
26-
type: 'proc',
2726
exec: IPFS,
2827
config: {
2928
Addresses: {
@@ -76,7 +75,7 @@ describe('bootstrap', () => {
7675
it('add a peer to the bootstrap list', (done) => {
7776
node.bootstrap.add('/ip4/111.111.111.111/tcp/1001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLUVIT', (err, res) => {
7877
expect(err).to.not.exist()
79-
expect(res).to.be.eql({Peers: ['/ip4/111.111.111.111/tcp/1001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLUVIT']})
78+
expect(res).to.be.eql({ Peers: ['/ip4/111.111.111.111/tcp/1001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLUVIT'] })
8079
node.bootstrap.list((err, list) => {
8180
expect(err).to.not.exist()
8281
expect(list.Peers).to.deep.equal(updatedList)
@@ -88,7 +87,7 @@ describe('bootstrap', () => {
8887
it('remove a peer from the bootstrap list', (done) => {
8988
node.bootstrap.rm('/ip4/111.111.111.111/tcp/1001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLUVIT', (err, res) => {
9089
expect(err).to.not.exist()
91-
expect(res).to.be.eql({Peers: ['/ip4/111.111.111.111/tcp/1001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLUVIT']})
90+
expect(res).to.be.eql({ Peers: ['/ip4/111.111.111.111/tcp/1001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLUVIT'] })
9291
node.bootstrap.list((err, list) => {
9392
expect(err).to.not.exist()
9493
expect(list.Peers).to.deep.equal(defaultList)

test/core/files-sharding.spec.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const pull = require('pull-stream')
1111
const IPFS = require('../../src/core')
1212

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

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

3737
df.spawn({
38-
type: 'proc',
3938
exec: IPFS,
4039
config: {
4140
Addresses: {
@@ -86,7 +85,6 @@ describe('files directory (sharding tests)', () => {
8685
this.timeout(40 * 1000)
8786

8887
df.spawn({
89-
type: 'proc',
9088
exec: IPFS,
9189
args: ['--enable-sharding-experiment'],
9290
config: {

test/core/interface/block.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ const test = require('interface-ipfs-core')
55
const IPFS = require('../../../src')
66

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

1010
const common = {
1111
setup: function (callback) {
12-
callback(null, df, 'proc', IPFS)
12+
callback(null, df, IPFS)
1313
}
1414
}
1515

test/core/interface/config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ const test = require('interface-ipfs-core')
55
const IPFS = require('../../../src')
66

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

1010
const common = {
1111
setup: function (callback) {
12-
callback(null, df, 'proc', IPFS)
12+
callback(null, df, IPFS)
1313
}
1414
}
1515
test.config(common)

test/core/interface/dag.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ const test = require('interface-ipfs-core')
55
const IPFS = require('../../../src')
66

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

1010
const common = {
1111
setup: function (callback) {
12-
callback(null, df, 'proc', IPFS)
12+
callback(null, df, IPFS)
1313
}
1414
}
1515

test/core/interface/dht.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
const test = require('interface-ipfs-core')
66
77
const DaemonFactory = require('ipfsd-ctl')
8-
const df = DaemonFactory.create()
8+
const df = DaemonFactory.create({ type: 'proc'})
99
1010
const common = {
1111
setup: function (callback) {
12-
callback(null, df)
12+
callback(null, df, IPFS)
1313
}
1414
}
1515

test/core/interface/files.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ const test = require('interface-ipfs-core')
55
const IPFS = require('../../../src')
66

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

1010
const common = {
1111
setup: function (callback) {
12-
callback(null, df, 'proc', IPFS)
12+
callback(null, df, IPFS)
1313
}
1414
}
1515

test/core/interface/generic.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ const test = require('interface-ipfs-core')
55
const IPFS = require('../../../src')
66

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

1010
const common = {
1111
setup: function (callback) {
12-
callback(null, df, 'proc', IPFS)
12+
callback(null, df, IPFS)
1313
}
1414
}
1515
test.generic(common)

test/core/interface/object.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ const test = require('interface-ipfs-core')
55
const IPFS = require('../../../src')
66

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

1010
const common = {
1111
setup: function (callback) {
12-
callback(null, df, 'proc', IPFS)
12+
callback(null, df, IPFS)
1313
}
1414
}
1515

test/core/interface/pubsub.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ const test = require('interface-ipfs-core')
55
const IPFS = require('../../../src')
66

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

1010
const common = {
1111
setup: function (callback) {
12-
callback(null, df, 'proc', IPFS)
12+
callback(null, df, IPFS)
1313
}
1414
}
1515

test/core/interface/swarm.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ const test = require('interface-ipfs-core')
55
const IPFS = require('../../../src')
66

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

1010
const common = {
1111
setup: function (callback) {
12-
callback(null, df, 'proc', IPFS)
12+
callback(null, df, IPFS)
1313
}
1414
}
1515

test/core/kad-dht.node.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ chai.use(dirtyChai)
99
const parallel = require('async/parallel')
1010

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

1414
const config = {
1515
Addresses: {
@@ -26,7 +26,7 @@ const config = {
2626
}
2727

2828
function createNode (callback) {
29-
df.spawn({ type: 'js', exec: './src/cli/bin.js', config }, callback)
29+
df.spawn({ exec: './src/cli/bin.js', config }, callback)
3030
}
3131

3232
describe('verify that kad-dht is doing its thing', () => {

test/http-api/interface/block.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
const test = require('interface-ipfs-core')
55

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

99
const common = {
1010
setup: function (callback) {
11-
callback(null, df, 'js', './src/cli/bin.js')
11+
callback(null, df, './src/cli/bin.js')
1212
}
1313
}
1414

test/http-api/interface/config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
const test = require('interface-ipfs-core')
55

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

99
const common = {
1010
setup: function (callback) {
11-
callback(null, df, 'js', './src/cli/bin.js')
11+
callback(null, df, './src/cli/bin.js')
1212
}
1313
}
1414

test/http-api/interface/files.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
const test = require('interface-ipfs-core')
55

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

99
const common = {
1010
setup: function (callback) {
11-
callback(null, df, 'js', './src/cli/bin.js')
11+
callback(null, df, './src/cli/bin.js')
1212
}
1313
}
1414

test/http-api/interface/object.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
const test = require('interface-ipfs-core')
55

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

99
const common = {
1010
setup: function (callback) {
11-
callback(null, df, 'js', './src/cli/bin.js')
11+
callback(null, df, './src/cli/bin.js')
1212
}
1313
}
1414

test/http-api/interface/pubsub.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
const test = require('interface-ipfs-core')
55

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

99
const common = {
1010
setup: function (callback) {
11-
callback(null, df, 'js', './src/cli/bin.js')
11+
callback(null, df, './src/cli/bin.js')
1212
}
1313
}
1414

test/http-api/interface/swarm.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
const test = require('interface-ipfs-core')
55

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

99
const common = {
1010
setup: function (callback) {
11-
callback(null, df, 'js', './src/cli/bin.js')
11+
callback(null, df, './src/cli/bin.js')
1212
}
1313
}
1414

0 commit comments

Comments
 (0)