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

Commit 0c73e99

Browse files
committed
fix: make ci happy again
1 parent 2651787 commit 0c73e99

File tree

6 files changed

+50
-39
lines changed

6 files changed

+50
-39
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
"joi": "^14.3.0",
130130
"joi-browser": "^13.4.0",
131131
"joi-multiaddr": "^4.0.0",
132-
"libp2p": "libp2p/js-libp2p#master",
132+
"libp2p": "~0.25.0-rc.0",
133133
"libp2p-bootstrap": "~0.9.3",
134134
"libp2p-crypto": "~0.16.0",
135135
"libp2p-kad-dht": "~0.14.4",

test/core/interface.spec.js

-4
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,6 @@ describe('interface-ipfs-core tests', function () {
184184
config = null
185185
}
186186

187-
config = config || {
188-
Bootstrap: []
189-
}
190-
191187
const spawnOptions = { repoPath, config, initOptions: { bits: 512 } }
192188

193189
ipfsFactory.spawn(spawnOptions, (err, _ipfsd) => {

test/core/preload.spec.js

+25-24
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,16 @@ describe('preload', () => {
1919
let repo
2020

2121
before(function (done) {
22-
this.timeout(20 * 1000)
22+
this.timeout(50 * 1000)
2323

2424
repo = createTempRepo()
2525
ipfs = new IPFS({
2626
repo,
2727
config: {
2828
Addresses: {
2929
Swarm: []
30-
}
30+
},
31+
Bootstrap: []
3132
},
3233
preload: {
3334
enabled: true,
@@ -44,25 +45,25 @@ describe('preload', () => {
4445
})
4546

4647
after(function (done) {
47-
this.timeout(20 * 1000)
48+
this.timeout(50 * 1000)
4849
ipfs.stop(done)
4950
})
5051

5152
after(function (done) {
52-
this.timeout(20 * 1000)
53+
this.timeout(50 * 1000)
5354
repo.teardown(done)
5455
})
5556

5657
it('should preload content added with add', function (done) {
57-
this.timeout(20 * 1000)
58+
this.timeout(50 * 1000)
5859
ipfs.add(Buffer.from(hat()), (err, res) => {
5960
expect(err).to.not.exist()
6061
MockPreloadNode.waitForCids(res[0].hash, done)
6162
})
6263
})
6364

6465
it('should preload multiple content added with add', function (done) {
65-
this.timeout(20 * 1000)
66+
this.timeout(50 * 1000)
6667
ipfs.add([{
6768
content: Buffer.from(hat())
6869
}, {
@@ -76,7 +77,7 @@ describe('preload', () => {
7677
})
7778

7879
it('should preload multiple content and intermediate dirs added with add', function (done) {
79-
this.timeout(20 * 1000)
80+
this.timeout(50 * 1000)
8081
ipfs.add([{
8182
path: 'dir0/dir1/file0',
8283
content: Buffer.from(hat())
@@ -97,7 +98,7 @@ describe('preload', () => {
9798
})
9899

99100
it('should preload multiple content and wrapping dir for content added with add and wrapWithDirectory option', function (done) {
100-
this.timeout(20 * 1000)
101+
this.timeout(50 * 1000)
101102
ipfs.add([{
102103
path: 'dir0/dir1/file0',
103104
content: Buffer.from(hat())
@@ -118,7 +119,7 @@ describe('preload', () => {
118119
})
119120

120121
it('should preload content retrieved with cat', function (done) {
121-
this.timeout(20 * 1000)
122+
this.timeout(50 * 1000)
122123
ipfs.add(Buffer.from(hat()), { preload: false }, (err, res) => {
123124
expect(err).to.not.exist()
124125
ipfs.cat(res[0].hash, (err) => {
@@ -129,7 +130,7 @@ describe('preload', () => {
129130
})
130131

131132
it('should preload content retrieved with get', function (done) {
132-
this.timeout(20 * 1000)
133+
this.timeout(50 * 1000)
133134
ipfs.add(Buffer.from(hat()), { preload: false }, (err, res) => {
134135
expect(err).to.not.exist()
135136
ipfs.get(res[0].hash, (err) => {
@@ -140,7 +141,7 @@ describe('preload', () => {
140141
})
141142

142143
it('should preload content retrieved with ls', function (done) {
143-
this.timeout(20 * 1000)
144+
this.timeout(50 * 1000)
144145
ipfs.add([{
145146
path: 'dir0/dir1/file0',
146147
content: Buffer.from(hat())
@@ -169,23 +170,23 @@ describe('preload', () => {
169170
})
170171

171172
it('should preload content added with object.new', function (done) {
172-
this.timeout(20 * 1000)
173+
this.timeout(50 * 1000)
173174
ipfs.object.new((err, cid) => {
174175
expect(err).to.not.exist()
175176
MockPreloadNode.waitForCids(cid.toBaseEncodedString(), done)
176177
})
177178
})
178179

179180
it('should preload content added with object.put', function (done) {
180-
this.timeout(20 * 1000)
181+
this.timeout(50 * 1000)
181182
ipfs.object.put({ Data: Buffer.from(hat()), Links: [] }, (err, cid) => {
182183
expect(err).to.not.exist()
183184
MockPreloadNode.waitForCids(cid.toBaseEncodedString(), done)
184185
})
185186
})
186187

187188
it('should preload content added with object.patch.addLink', function (done) {
188-
this.timeout(20 * 1000)
189+
this.timeout(50 * 1000)
189190
parallel({
190191
parent: (cb) => {
191192
waterfall([
@@ -214,7 +215,7 @@ describe('preload', () => {
214215
})
215216

216217
it('should preload content added with object.patch.rmLink', function (done) {
217-
this.timeout(20 * 1000)
218+
this.timeout(50 * 1000)
218219
waterfall([
219220
(cb) => ipfs.object.put({ Data: Buffer.from(hat()), Links: [] }, cb),
220221
(cid, cb) => ipfs.object.get(cid, (err, node) => cb(err, { node, cid })),
@@ -239,7 +240,7 @@ describe('preload', () => {
239240
})
240241

241242
it('should preload content added with object.patch.setData', function (done) {
242-
this.timeout(20 * 1000)
243+
this.timeout(50 * 1000)
243244
ipfs.object.put({ Data: Buffer.from(hat()), Links: [] }, (err, cid) => {
244245
expect(err).to.not.exist()
245246

@@ -251,7 +252,7 @@ describe('preload', () => {
251252
})
252253

253254
it('should preload content added with object.patch.appendData', function (done) {
254-
this.timeout(20 * 1000)
255+
this.timeout(50 * 1000)
255256
ipfs.object.put({ Data: Buffer.from(hat()), Links: [] }, (err, cid) => {
256257
expect(err).to.not.exist()
257258

@@ -263,7 +264,7 @@ describe('preload', () => {
263264
})
264265

265266
it('should preload content retrieved with object.get', function (done) {
266-
this.timeout(20 * 1000)
267+
this.timeout(50 * 1000)
267268
ipfs.object.new(null, { preload: false }, (err, cid) => {
268269
expect(err).to.not.exist()
269270

@@ -275,15 +276,15 @@ describe('preload', () => {
275276
})
276277

277278
it('should preload content added with block.put', function (done) {
278-
this.timeout(20 * 1000)
279+
this.timeout(50 * 1000)
279280
ipfs.block.put(Buffer.from(hat()), (err, block) => {
280281
expect(err).to.not.exist()
281282
MockPreloadNode.waitForCids(block.cid.toBaseEncodedString(), done)
282283
})
283284
})
284285

285286
it('should preload content retrieved with block.get', function (done) {
286-
this.timeout(20 * 1000)
287+
this.timeout(50 * 1000)
287288
ipfs.block.put(Buffer.from(hat()), { preload: false }, (err, block) => {
288289
expect(err).to.not.exist()
289290
ipfs.block.get(block.cid, (err) => {
@@ -294,7 +295,7 @@ describe('preload', () => {
294295
})
295296

296297
it('should preload content retrieved with block.stat', function (done) {
297-
this.timeout(20 * 1000)
298+
this.timeout(50 * 1000)
298299
ipfs.block.put(Buffer.from(hat()), { preload: false }, (err, block) => {
299300
expect(err).to.not.exist()
300301
ipfs.block.stat(block.cid, (err) => {
@@ -305,7 +306,7 @@ describe('preload', () => {
305306
})
306307

307308
it('should preload content added with dag.put', function (done) {
308-
this.timeout(20 * 1000)
309+
this.timeout(50 * 1000)
309310
const obj = { test: hat() }
310311
ipfs.dag.put(obj, { format: 'dag-cbor', hashAlg: 'sha2-256' }, (err, cid) => {
311312
expect(err).to.not.exist()
@@ -314,7 +315,7 @@ describe('preload', () => {
314315
})
315316

316317
it('should preload content retrieved with dag.get', function (done) {
317-
this.timeout(20 * 1000)
318+
this.timeout(50 * 1000)
318319
const obj = { test: hat() }
319320
const opts = { format: 'dag-cbor', hashAlg: 'sha2-256', preload: false }
320321
ipfs.dag.put(obj, opts, (err, cid) => {
@@ -328,7 +329,7 @@ describe('preload', () => {
328329
})
329330

330331
describe('preload disabled', function () {
331-
this.timeout(20 * 1000)
332+
this.timeout(50 * 1000)
332333
let ipfs
333334
let repo
334335

test/http-api/interface.js

-4
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,6 @@ describe('interface-ipfs-core over ipfs-http-client tests', () => {
113113
config = undefined
114114
}
115115

116-
config = config || {
117-
Bootstrap: []
118-
}
119-
120116
const spawnOptions = { repoPath, config, initOptions: { bits: 512 } }
121117

122118
ipfsFactory.spawn(spawnOptions, (err, _ipfsd) => {

test/http-api/routes.js

+10-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('HTTP API', () => {
1717
const repoTests = path.join(__dirname, '../repo-tests-run')
1818

1919
// bootstrap nodes get the set up too slow and gets timed out
20-
const testsForCustomConfig = ['dht.js', 'name.js', 'ping.js']
20+
const testsForCustomConfig = ['dht.js', 'files.js', 'name.js', 'pin.js', 'ping.js']
2121

2222
let http = {}
2323

@@ -49,15 +49,18 @@ describe('HTTP API', () => {
4949

5050
before(async function () {
5151
this.timeout(60 * 1000)
52+
5253
await startHttpAPI(config)
5354
})
5455

55-
after(async () => {
56+
after(async function () {
57+
this.timeout(50 * 1000)
58+
5659
await http.api.stop()
5760
clean(repoTests)
5861
})
5962

60-
describe('## http-api spec tests', () => {
63+
describe('## http-api spec tests for custom config', () => {
6164
fs.readdirSync(path.join(`${__dirname}/inject/`))
6265
.forEach((file) => testsForCustomConfig.includes(file) && require(`./inject/${file}`)(http))
6366
})
@@ -73,12 +76,14 @@ describe('HTTP API', () => {
7376
await startHttpAPI(config)
7477
})
7578

76-
after(async () => {
79+
after(async function () {
80+
this.timeout(50 * 1000)
81+
7782
await http.api.stop()
7883
clean(repoTests)
7984
})
8085

81-
describe('## http-api spec tests', () => {
86+
describe('## http-api spec tests for default config', () => {
8287
fs.readdirSync(path.join(`${__dirname}/inject/`))
8388
.forEach((file) => !testsForCustomConfig.includes(file) && require(`./inject/${file}`)(http))
8489
})

test/utils/interface-common-factory.js

+14-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,20 @@ function createFactory (options) {
1010
options = options || {}
1111

1212
options.factoryOptions = options.factoryOptions || { type: 'proc', exec: IPFS }
13-
options.spawnOptions = options.spawnOptions || { initOptions: { bits: 512 }, config: { Bootstrap: [] } }
13+
options.spawnOptions = options.spawnOptions || {
14+
initOptions: { bits: 512 },
15+
config: {
16+
Bootstrap: [],
17+
Discovery: {
18+
MDNS: {
19+
Enabled: false
20+
},
21+
webRTCStar: {
22+
Enabled: false
23+
}
24+
}
25+
}
26+
}
1427

1528
if (options.factoryOptions.type !== 'proc') {
1629
options.factoryOptions.IpfsClient = options.factoryOptions.IpfsClient || ipfsClient

0 commit comments

Comments
 (0)