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

Commit 7cb08c2

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 7cb08c2

File tree

4 files changed

+61
-6
lines changed

4 files changed

+61
-6
lines changed

.aegir.js

+1-1
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

+50-2
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,47 @@ 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: test
70+
if: branch =~ /^\release\/.*$/
71+
name: ipfs-companion
72+
script:
73+
- npm run test:external -- ipfs-companion https://github.com./ipfs-shipyard/ipfs-companion.git
74+
75+
- stage: test
76+
if: branch =~ /^\release\/.*$/
77+
name: npm-on-ipfs
78+
script:
79+
- npm run test:external -- npm-on-ipfs https://github.com./ipfs-shipyard/npm-on-ipfs.git
80+
81+
- stage: test
82+
if: branch =~ /^\release\/.*$/
83+
name: ipfs-pubsub-room
84+
script:
85+
- npm run test:external -- ipfs-pubsub-room https://github.com./ipfs-shipyard/ipfs-pubsub-room.git
86+
87+
- stage: test
88+
if: branch =~ /^\release\/.*$/
89+
name: peer-base
90+
script:
91+
- npm run test:external -- peer-base https://github.com./peer-base/peer-base.git
92+
93+
- stage: test
94+
if: branch =~ /^\release\/.*$/
95+
name: service-worker-gateway
96+
script:
97+
- npm run test:external -- service-worker-gateway https://github.com./ipfs-shipyard/service-worker-gateway.git
98+
99+
- stage: tag
100+
# only run on changes to master
101+
if: branch = master AND type = push AND fork = false
102+
name: update-last-successful-build
103+
script:
104+
- npx aegir update-last-successful-build
105+
58106
notifications:
59107
email: false

package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
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",
51+
"test:external": "aegir test-external",
5052
"coverage": "nyc --reporter=text --reporter=lcov npm run test:node",
5153
"benchmark": "echo \"Error: no benchmarks yet\" && exit 1",
5254
"benchmark:node": "echo \"Error: no benchmarks yet\" && exit 1",
@@ -141,7 +143,7 @@
141143
"libp2p-websocket-star-multi": "~0.4.3",
142144
"libp2p-websockets": "~0.12.3",
143145
"lodash": "^4.17.15",
144-
"mafmt": "^6.0.2",
146+
"mafmt": "^6.0.10",
145147
"merge-options": "^1.0.1",
146148
"mime-types": "^2.1.21",
147149
"mkdirp": "~0.5.1",
@@ -186,7 +188,7 @@
186188
"yargs-promise": "^1.1.0"
187189
},
188190
"devDependencies": {
189-
"aegir": "^20.0.0",
191+
"aegir": "^20.1.0",
190192
"base64url": "^3.0.1",
191193
"chai": "^4.2.0",
192194
"clear-module": "^4.0.0",
@@ -198,6 +200,7 @@
198200
"form-data": "^2.5.1",
199201
"hat": "0.0.3",
200202
"interface-ipfs-core": "^0.113.0",
203+
"ipfs-interop": "~0.1.0",
201204
"ipfsd-ctl": "~0.46.0",
202205
"libp2p-websocket-star": "~0.10.2",
203206
"ncp": "^2.0.0",

src/core/components/libp2p.js

+5-1
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)