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

Commit 9b03f2f

Browse files
committed
chore: run interop tests as part of the build
Also tag last successful build and ensure we do not get stealth multiaddr@v7
1 parent e500112 commit 9b03f2f

File tree

4 files changed

+29
-6
lines changed

4 files changed

+29
-6
lines changed

.aegir.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const preloadNode = MockPreloadNode.createNode()
1010
const echoServer = EchoServer.createServer()
1111

1212
module.exports = {
13-
bundlesize: { maxSize: '692kB' },
13+
bundlesize: { maxSize: '696kB' },
1414
webpack: {
1515
resolve: {
1616
mainFields: ['browser', 'main'],

.travis.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cache: false
77
stages:
88
- check
99
- test
10-
- cov
10+
- tag
1111

1212
node_js:
1313
- '10'
@@ -18,8 +18,14 @@ os:
1818
- osx
1919
- windows
2020

21+
env:
22+
# This stops Windows builds from hanging
23+
# https://travis-ci.community/t/timeout-after-build-finished-and-succeeded/1336
24+
- YARN_GPG=no
25+
2126
script: npx nyc -s npx aegir test -t node --timeout 10000 --bail
22-
after_success: npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov
27+
after_success:
28+
- npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov
2329

2430
jobs:
2531
include:
@@ -55,5 +61,16 @@ jobs:
5561
script:
5662
- xvfb-run npx aegir test -t electron-renderer -- --bail --timeout 10000
5763

64+
- stage: test
65+
name: interop
66+
script:
67+
- npm run test:interop
68+
69+
- stage: tag
70+
if: branch = master AND type = push AND fork = false
71+
name: update-last-successful-build
72+
script:
73+
- npx aegir update-last-successful-build
74+
5875
notifications:
5976
email: false

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"test:node:cli": "aegir test -t node -f test/cli/index.js",
4848
"test:node:interface": "aegir test -t node -f test/core/interface.spec.js",
4949
"test:bootstrapers": "IPFS_TEST=bootstrapers aegir test -t browser -f test/bootstrapers.js",
50+
"test:interop": "IPFS_JS_EXEC=$PWD/src/cli/bin.js ipfs-interop",
5051
"coverage": "nyc --reporter=text --reporter=lcov npm run test:node",
5152
"benchmark": "echo \"Error: no benchmarks yet\" && exit 1",
5253
"benchmark:node": "echo \"Error: no benchmarks yet\" && exit 1",
@@ -141,7 +142,7 @@
141142
"libp2p-websocket-star-multi": "~0.4.3",
142143
"libp2p-websockets": "~0.12.3",
143144
"lodash": "^4.17.15",
144-
"mafmt": "^6.0.2",
145+
"mafmt": "^6.0.10",
145146
"merge-options": "^1.0.1",
146147
"mime-types": "^2.1.21",
147148
"mkdirp": "~0.5.1",
@@ -186,7 +187,7 @@
186187
"yargs-promise": "^1.1.0"
187188
},
188189
"devDependencies": {
189-
"aegir": "^20.0.0",
190+
"aegir": "^20.1.0",
190191
"base64url": "^3.0.1",
191192
"chai": "^4.2.0",
192193
"clear-module": "^4.0.0",
@@ -198,6 +199,7 @@
198199
"form-data": "^2.5.1",
199200
"hat": "0.0.3",
200201
"interface-ipfs-core": "^0.113.0",
202+
"ipfs-interop": "~0.1.0",
201203
"ipfsd-ctl": "~0.46.0",
202204
"libp2p-websocket-star": "~0.10.2",
203205
"ncp": "^2.0.0",

src/core/components/libp2p.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ function defaultBundle ({ datastore, peerInfo, peerBook, options, config }) {
6161
}
6262

6363
const getPubsubRouter = () => {
64-
const router = get(config, 'Pubsub.Router', 'gossipsub')
64+
let router = get(config, 'Pubsub.Router', 'gossipsub')
65+
66+
if (!router) {
67+
router = 'gossipsub'
68+
}
6569

6670
if (!PubsubRouters[router]) {
6771
throw errCode(new Error(`Router unavailable. Configure libp2p.modules.pubsub to use the ${router} router.`), 'ERR_NOT_SUPPORTED')

0 commit comments

Comments
 (0)