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

chore: run interop tests as part of the build #2440

Merged
merged 1 commit into from
Sep 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
21 changes: 19 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,16 @@ jobs:
script:
- xvfb-run npx aegir test -t electron-renderer -- --bail --timeout 10000

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

- stage: tag
if: branch = master AND type = push AND fork = false
name: update-last-successful-build
script:
- npx aegir update-last-successful-build

notifications:
email: false
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"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",
"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 +142,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 +187,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 +199,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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scary. What happened?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm. Read the commit message

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a nutshell we have too many modules that are written as if they exist independently of each other.

  1. A patch-release of multiformats/mafmt pulled in multiaddr@v7, broke this comparison and caused tests to fail with:
AssertionError: expected '/ip4/127.0.0.1/tcp/45467/ipfs/QmXLcgh85JSbd2v6zsFgu68fjeqsaqGLapFD5MxHLpEwtW/ipfs/QmXLcgh85JSbd2v6zsFgu68fjeqsaqGLapFD5MxHLpEwtW\n' to deeply equal '/ip4/127.0.0.1/tcp/45467/ipfs/QmXLcgh85JSbd2v6zsFgu68fjeqsaqGLapFD5MxHLpEwtW\n'
      + expected - actual
  1. Only forward, so I upgraded js-ipfs and js-ipfs-http-client to multiaddr@v7, tests passed so published ipfs-http-client@35 with the new multiaddr with a view to PRing it into js-ipfs
  2. ipfsd-ctl upgraded ipfs-http-client to 35 in 0.46.1
  3. Lots of the js-ipfs dependency tree has multiaddr@v6, cannot upgrade right now because of the scope of API changes
  4. I asked @vasco-santos to downgrade multiaddr in mafmt instead, published as v0.6.10
  5. Now we need js-ipfs-http-client@34.0.0 which is in ipfsd-ctl@0.46.0 but not ipfsd-ctl@0.46.1 so as a stop gap, pin ipfsd-ctl@0.46.0, so we can run the interop tests on CI and fix the build

This weird js-ipfs, js-ipfs-http-client, js-ipfsd-ctl version dance is what I'm talking about in #2446

Anyway, next steps:

  1. Assuming CI passes on this PR, integrate interop test running with v0.38.x branch (today)
  2. Run tests of webui, desktop, companion, etc as per new release process (tomorrow)
  3. Start community dev testing of v0.38.x (tomorrow/Monday)
  4. Upgrade libp2p, ipfs-repo, etc (Monday/Tuesday/Most of next week)

"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