diff --git a/.aegir.js b/.aegir.js index caa757d76f..da26b81e79 100644 --- a/.aegir.js +++ b/.aegir.js @@ -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'], diff --git a/.travis.yml b/.travis.yml index f7eef6a3ce..06d238e928 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ cache: false stages: - check - test - - cov + - tag node_js: - '10' @@ -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: @@ -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 diff --git a/package.json b/package.json index b406d695a5..92dab96b08 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", @@ -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", @@ -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", diff --git a/src/core/components/libp2p.js b/src/core/components/libp2p.js index b39a035565..35ddce54dc 100644 --- a/src/core/components/libp2p.js +++ b/src/core/components/libp2p.js @@ -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')