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

Commit 0287a6c

Browse files
hugomrdiasAlan Shaw
authored and
Alan Shaw
committed
chore: prepare for new aegir major version (#2110)
* feat: fix tests timeouts * chore: fix linting errors from new rules * chore: add electron tests and node 12 * chore: fix package.json linting and use "files" instead of npmignore * fix: test fix for travis ci electron * fix: test fix for travis ci electron 2 * fix: fix cli daemon print test timeout * fix: electron travis config and update deps * chore: upgrade aegir * chore: fix CI * chore: fix CI * chore: fix ci tests * chore: fix ci tests * chore: update circuit-relay example * fix: electron ci config, update dep * fix: daemon print test timeout * chore: update dep to use ^
1 parent 6c72e5c commit 0287a6c

File tree

21 files changed

+93
-118
lines changed

21 files changed

+93
-118
lines changed

.npmignore

Lines changed: 0 additions & 36 deletions
This file was deleted.

.travis.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ stages:
1111

1212
node_js:
1313
- '10'
14+
- '12'
1415

1516
os:
1617
- linux
1718
- osx
1819
- windows
1920

20-
script: npx nyc -s npm run test:node -- --bail
21+
script: npx nyc -s npm run test:node --timeout=10000 -- --bail
2122
after_success: npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov
2223

2324
jobs:
@@ -43,5 +44,15 @@ jobs:
4344
- npx aegir test -t browser -- --browsers FirefoxHeadless
4445
- npx aegir test -t webworker -- --browsers FirefoxHeadless
4546

47+
- stage: test
48+
name: electron-main
49+
script:
50+
- xvfb-run npx aegir test -t electron-main -- --bail
51+
52+
- stage: test
53+
name: electron-renderer
54+
script:
55+
- xvfb-run npx aegir test -t electron-renderer -- --bail
56+
4657
notifications:
4758
email: false

examples/circuit-relaying/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"ipfs-pubsub-room": "^1.4.0"
1919
},
2020
"devDependencies": {
21-
"aegir": "^18.0.3",
21+
"aegir": "^19.0.3",
2222
"ipfs-css": "~0.12.0",
2323
"parcel-bundler": "^1.6.2",
2424
"tachyons": "^4.9.1"

examples/circuit-relaying/src/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-console */
12
'use strict'
23

34
const IPFS = require('ipfs')

examples/circuit-relaying/src/helpers.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-console */
12
'use strict'
23

34
const Room = require('ipfs-pubsub-room')

package.json

Lines changed: 48 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@
22
"name": "ipfs",
33
"version": "0.36.3",
44
"description": "JavaScript implementation of the IPFS specification",
5+
"keywords": [
6+
"IPFS"
7+
],
8+
"homepage": "https://js.ipfs.io",
9+
"bugs": "https://github.com/ipfs/js-ipfs/issues",
10+
"license": "MIT",
511
"leadMaintainer": "Alan Shaw <[email protected]>",
6-
"bin": {
7-
"jsipfs": "src/cli/bin.js"
8-
},
12+
"files": [
13+
"src",
14+
"dist"
15+
],
916
"main": "src/core/index.js",
1017
"browser": {
1118
"./src/core/components/init-assets.js": false,
@@ -23,23 +30,23 @@
2330
"browser-all-ipld-formats": {
2431
"./src/core/runtime/ipld-browser.js": "./src/core/runtime/ipld-browser-all.js"
2532
},
26-
"engines": {
27-
"node": ">=10.0.0",
28-
"npm": ">=6.0.0"
33+
"bin": {
34+
"jsipfs": "src/cli/bin.js"
2935
},
36+
"repository": "github:ipfs/js-ipfs",
3037
"scripts": {
3138
"lint": "aegir lint",
3239
"build": "aegir build",
33-
"test": "aegir test -t node -t browser -t webworker --no-cors --timeout=10000",
34-
"test:node": "aegir test -t node --timeout=10000",
35-
"test:browser": "aegir test -t browser --no-cors --timeout=10000",
36-
"test:webworker": "aegir test -t webworker --no-cors --timeout=10000",
37-
"test:node:core": "aegir test -t node -f test/core/**/*.js --timeout=10000",
38-
"test:node:http": "aegir test -t node -f test/http-api/index.js --timeout=10000",
39-
"test:node:gateway": "aegir test -t node -f test/gateway/index.js --timeout=10000",
40-
"test:node:cli": "aegir test -t node -f test/cli/index.js --timeout=10000",
41-
"test:node:interface": "aegir test -t node -f test/core/interface.spec.js --timeout=10000",
42-
"test:bootstrapers": "IPFS_TEST=bootstrapers aegir test -t browser -f test/bootstrapers.js --timeout=10000",
40+
"test": "aegir test",
41+
"test:node": "aegir test -t node",
42+
"test:browser": "aegir test -t browser",
43+
"test:webworker": "aegir test -t webworker",
44+
"test:node:core": "aegir test -t node -f test/core/**/*.js",
45+
"test:node:http": "aegir test -t node -f test/http-api/index.js",
46+
"test:node:gateway": "aegir test -t node -f test/gateway/index.js",
47+
"test:node:cli": "aegir test -t node -f test/cli/index.js",
48+
"test:node:interface": "aegir test -t node -f test/core/interface.spec.js",
49+
"test:bootstrapers": "IPFS_TEST=bootstrapers aegir test -t browser -f test/bootstrapers.js",
4350
"benchmark": "echo \"Error: no benchmarks yet\" && exit 1",
4451
"benchmark:node": "echo \"Error: no benchmarks yet\" && exit 1",
4552
"benchmark:node:core": "echo \"Error: no benchmarks yet\" && exit 1",
@@ -49,47 +56,12 @@
4956
"release-minor": "aegir release --type minor -t node -t browser",
5057
"release-major": "aegir release --type major -t node -t browser"
5158
},
52-
"repository": {
53-
"type": "git",
54-
"url": "git+https://github.com/ipfs/js-ipfs.git"
55-
},
56-
"keywords": [
57-
"IPFS"
58-
],
59-
"license": "MIT",
60-
"bugs": {
61-
"url": "https://github.com/ipfs/js-ipfs/issues"
62-
},
63-
"homepage": "https://github.com/ipfs/js-ipfs#readme",
64-
"pre-push": [
65-
"lint"
66-
],
67-
"devDependencies": {
68-
"aegir": "^18.1.0",
69-
"base64url": "^3.0.1",
70-
"chai": "^4.2.0",
71-
"delay": "^4.1.0",
72-
"detect-node": "^2.0.4",
73-
"dir-compare": "^1.4.0",
74-
"dirty-chai": "^2.0.1",
75-
"execa": "^1.0.0",
76-
"form-data": "^2.3.3",
77-
"hat": "0.0.3",
78-
"interface-ipfs-core": "~0.104.0",
79-
"ipfsd-ctl": "~0.42.0",
80-
"libp2p-websocket-star": "~0.10.2",
81-
"ncp": "^2.0.0",
82-
"qs": "^6.5.2",
83-
"rimraf": "^2.6.2",
84-
"sinon": "^7.3.1",
85-
"stream-to-promise": "^2.2.0"
86-
},
8759
"dependencies": {
8860
"@hapi/ammo": "^3.1.0",
8961
"@hapi/hapi": "^18.3.1",
9062
"@hapi/joi": "^15.0.1",
9163
"async": "^2.6.1",
92-
"async-iterator-all": "0.0.2",
64+
"async-iterator-all": "^1.0.0",
9365
"async-iterator-to-pull-stream": "^1.1.0",
9466
"async-iterator-to-stream": "^1.1.0",
9567
"base32.js": "~0.1.0",
@@ -200,10 +172,34 @@
200172
"yargs": "^13.2.4",
201173
"yargs-promise": "^1.1.0"
202174
},
175+
"devDependencies": {
176+
"aegir": "^19.0.3",
177+
"base64url": "^3.0.1",
178+
"chai": "^4.2.0",
179+
"delay": "^4.1.0",
180+
"detect-node": "^2.0.4",
181+
"dir-compare": "^1.4.0",
182+
"dirty-chai": "^2.0.1",
183+
"execa": "^1.0.0",
184+
"form-data": "^2.3.3",
185+
"hat": "0.0.3",
186+
"interface-ipfs-core": "~0.104.0",
187+
"ipfsd-ctl": "~0.42.0",
188+
"libp2p-websocket-star": "~0.10.2",
189+
"ncp": "^2.0.0",
190+
"qs": "^6.5.2",
191+
"rimraf": "^2.6.2",
192+
"sinon": "^7.3.1",
193+
"stream-to-promise": "^2.2.0"
194+
},
203195
"optionalDependencies": {
204196
"prom-client": "^11.1.3",
205197
"prometheus-gc-stats": "~0.6.0"
206198
},
199+
"engines": {
200+
"node": ">=10.0.0",
201+
"npm": ">=6.0.0"
202+
},
207203
"contributors": [
208204
"0xflotus <[email protected]>",
209205

src/cli/bin.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#! /usr/bin/env node
22

3+
/* eslint-disable no-console */
34
'use strict'
45

56
process.on('uncaughtException', (err) => {
@@ -31,7 +32,7 @@ const debug = require('debug')('ipfs:cli')
3132
const parser = require('./parser')
3233
const commandAlias = require('./command-alias')
3334

34-
async function main (args) {
35+
function main (args) {
3536
const oneWeek = 1000 * 60 * 60 * 24 * 7
3637
updateNotifier({ pkg, updateCheckInterval: oneWeek }).notify()
3738

src/http/api/resources/bootstrap.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ exports.add = {
2525
}
2626
}
2727

28-
console.log('parseArgs', { default: def })
29-
3028
return { default: def }
3129
},
3230
async handler (request, h) {

src/http/api/resources/stats.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ exports.bitswap = require('./bitswap').stat
1515

1616
exports.repo = require('./repo').stat
1717

18-
exports.bw = async (request, h) => {
18+
exports.bw = (request, h) => {
1919
const { ipfs } = request.server.app
2020
const options = {
2121
peer: request.query.peer,

test/cli/daemon.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ describe('daemon', () => {
213213
})
214214
})
215215

216-
it('should print version info', async () => {
216+
it('should print version info', async function () {
217+
this.timeout(100 * 1000)
217218
await ipfs('init')
218219

219220
const out = await new Promise(resolve => {

test/cli/object.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ describe('object', () => runOnAndOff((thing) => {
7979
})
8080
})
8181

82-
it('should get and print CIDs encoded in specified base', () => {
82+
it('should get and print CIDs encoded in specified base', function () {
83+
this.timeout(15 * 1000)
8384
return ipfs(`add ${path.resolve(path.join(__dirname, '..'))}/fixtures/planets -r --cid-version=1`)
8485
.then(out => {
8586
const lines = out.trim().split('\n')

test/core/create-node.spec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,9 @@ describe('create node', function () {
143143
})
144144

145145
ipfs.on('ready', () => {
146+
// eslint-disable-next-line no-console
146147
expect(console.log.called).to.be.false()
148+
// eslint-disable-next-line no-console
147149
console.log.restore()
148150
ipfs.stop(done)
149151
})

test/core/dag.spec.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ chai.use(dirtyChai)
1010
const IPFSFactory = require('ipfsd-ctl')
1111
const IPFS = require('../../src/core')
1212

13-
describe('dag', () => {
13+
describe('dag', function () {
14+
this.timeout(10 * 1000)
1415
let ipfsd, ipfs
1516

1617
before(function (done) {
17-
this.timeout(20 * 1000)
18-
1918
const factory = IPFSFactory.create({ type: 'proc' })
2019

2120
factory.spawn({
@@ -30,7 +29,7 @@ describe('dag', () => {
3029
})
3130
})
3231

33-
after((done) => {
32+
after(function (done) {
3433
if (ipfsd) {
3534
ipfsd.stop(done)
3635
} else {

test/core/files.spec.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ const pull = require('pull-stream')
1111
const IPFSFactory = require('ipfsd-ctl')
1212
const IPFS = require('../../src/core')
1313

14-
describe('files', () => {
14+
describe('files', function () {
15+
this.timeout(10 * 1000)
1516
let ipfsd, ipfs
1617

1718
before(function (done) {
18-
this.timeout(20 * 1000)
19-
2019
const factory = IPFSFactory.create({ type: 'proc' })
2120

2221
factory.spawn({

test/core/libp2p.spec.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ describe('libp2p customization', function () {
7474
},
7575
_peerInfo: peerInfo,
7676
_peerBook: peerBook,
77+
// eslint-disable-next-line no-console
7778
_print: console.log,
7879
_options: {
7980
libp2p: (opts) => {
@@ -123,6 +124,7 @@ describe('libp2p customization', function () {
123124
},
124125
_peerInfo: peerInfo,
125126
_peerBook: peerBook,
127+
// eslint-disable-next-line no-console
126128
_print: console.log
127129
}
128130

@@ -165,6 +167,7 @@ describe('libp2p customization', function () {
165167
},
166168
_peerInfo: peerInfo,
167169
_peerBook: peerBook,
170+
// eslint-disable-next-line no-console
168171
_print: console.log,
169172
_options: {
170173
config: {

test/core/object.spec.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ const auto = require('async/auto')
1212
const waterfall = require('async/waterfall')
1313
const IPFS = require('../../src/core')
1414

15-
describe('object', () => {
15+
describe('object', function () {
16+
this.timeout(10 * 1000)
1617
let ipfsd, ipfs
1718

1819
before(function (done) {
19-
this.timeout(50 * 1000)
20-
2120
const factory = IPFSFactory.create({ type: 'proc' })
2221

2322
factory.spawn({

test/core/pin.spec.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ chai.use(dirtyChai)
1010
const IPFSFactory = require('ipfsd-ctl')
1111
const IPFS = require('../../src/core')
1212

13-
describe('pin', () => {
13+
describe('pin', function () {
14+
this.timeout(10 * 1000)
1415
let ipfsd, ipfs
1516

1617
before(function (done) {
17-
this.timeout(20 * 1000)
18-
1918
const factory = IPFSFactory.create({ type: 'proc' })
2019

2120
factory.spawn({

0 commit comments

Comments
 (0)