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

Commit

Permalink
chore: run interop tests as part of the build
Browse files Browse the repository at this point in the history
Also tag last successful build and ensure we do not get stealth multiaddr@v7
  • Loading branch information
achingbrain committed Sep 17, 2019
1 parent e500112 commit 7cb08c2
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .aegir.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const preloadNode = MockPreloadNode.createNode()
const echoServer = EchoServer.createServer()

module.exports = {
bundlesize: { maxSize: '692kB' },
bundlesize: { maxSize: '696kB' },
webpack: {
resolve: {
mainFields: ['browser', 'main'],
Expand Down
52 changes: 50 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cache: false
stages:
- check
- test
- cov
- tag

node_js:
- '10'
Expand All @@ -18,8 +18,14 @@ os:
- osx
- windows

env:
# This stops Windows builds from hanging
# https://travis-ci.community/t/timeout-after-build-finished-and-succeeded/1336
- YARN_GPG=no

script: npx nyc -s npx aegir test -t node --timeout 10000 --bail
after_success: npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov
after_success:
- npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov

jobs:
include:
Expand Down Expand Up @@ -55,5 +61,47 @@ jobs:
script:
- xvfb-run npx aegir test -t electron-renderer -- --bail --timeout 10000

- stage: test
name: interop
script:
- npm run test:interop

- stage: test
if: branch =~ /^\release\/.*$/
name: ipfs-companion
script:
- npm run test:external -- ipfs-companion https://github.com/ipfs-shipyard/ipfs-companion.git

- stage: test
if: branch =~ /^\release\/.*$/
name: npm-on-ipfs
script:
- npm run test:external -- npm-on-ipfs https://github.com/ipfs-shipyard/npm-on-ipfs.git

- stage: test
if: branch =~ /^\release\/.*$/
name: ipfs-pubsub-room
script:
- npm run test:external -- ipfs-pubsub-room https://github.com/ipfs-shipyard/ipfs-pubsub-room.git

- stage: test
if: branch =~ /^\release\/.*$/
name: peer-base
script:
- npm run test:external -- peer-base https://github.com/peer-base/peer-base.git

- stage: test
if: branch =~ /^\release\/.*$/
name: service-worker-gateway
script:
- npm run test:external -- service-worker-gateway https://github.com/ipfs-shipyard/service-worker-gateway.git

- stage: tag
# only run on changes to master
if: branch = master AND type = push AND fork = false
name: update-last-successful-build
script:
- npx aegir update-last-successful-build

notifications:
email: false
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
"test:node:cli": "aegir test -t node -f test/cli/index.js",
"test:node:interface": "aegir test -t node -f test/core/interface.spec.js",
"test:bootstrapers": "IPFS_TEST=bootstrapers aegir test -t browser -f test/bootstrapers.js",
"test:interop": "IPFS_JS_EXEC=$PWD/src/cli/bin.js ipfs-interop",
"test:external": "aegir test-external",
"coverage": "nyc --reporter=text --reporter=lcov npm run test:node",
"benchmark": "echo \"Error: no benchmarks yet\" && exit 1",
"benchmark:node": "echo \"Error: no benchmarks yet\" && exit 1",
Expand Down Expand Up @@ -141,7 +143,7 @@
"libp2p-websocket-star-multi": "~0.4.3",
"libp2p-websockets": "~0.12.3",
"lodash": "^4.17.15",
"mafmt": "^6.0.2",
"mafmt": "^6.0.10",
"merge-options": "^1.0.1",
"mime-types": "^2.1.21",
"mkdirp": "~0.5.1",
Expand Down Expand Up @@ -186,7 +188,7 @@
"yargs-promise": "^1.1.0"
},
"devDependencies": {
"aegir": "^20.0.0",
"aegir": "^20.1.0",
"base64url": "^3.0.1",
"chai": "^4.2.0",
"clear-module": "^4.0.0",
Expand All @@ -198,6 +200,7 @@
"form-data": "^2.5.1",
"hat": "0.0.3",
"interface-ipfs-core": "^0.113.0",
"ipfs-interop": "~0.1.0",
"ipfsd-ctl": "~0.46.0",
"libp2p-websocket-star": "~0.10.2",
"ncp": "^2.0.0",
Expand Down
6 changes: 5 additions & 1 deletion src/core/components/libp2p.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ function defaultBundle ({ datastore, peerInfo, peerBook, options, config }) {
}

const getPubsubRouter = () => {
const router = get(config, 'Pubsub.Router', 'gossipsub')
let router = get(config, 'Pubsub.Router', 'gossipsub')

if (!router) {
router = 'gossipsub'
}

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

0 comments on commit 7cb08c2

Please sign in to comment.