Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ipfs/interop
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4ebecb743231daf3f2ab5d7a6cb3fa5108f2f050
Choose a base ref
...
head repository: ipfs/interop
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: dd43a59b621dd3fb6f3fe199f5ff9e4b14590b3f
Choose a head ref
Loading
19 changes: 11 additions & 8 deletions .aegir.js → .aegir.cjs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

const path = require('path')
const createServer = require('ipfsd-ctl').createServer
const signaler = require('libp2p-webrtc-star/src/sig-server')
const signaller = require('libp2p-webrtc-star-signalling-server')

/** @type {import('aegir').Options["build"]["config"]} */
const esbuild = {
@@ -26,6 +26,9 @@ const esbuild = {
]
}

const ipfsHttpModule = require(process.env.IPFS_JS_HTTP_MODULE || 'ipfs-http-client')
const ipfsModule = require(process.env.IPFS_JS_MODULE || 'ipfs')

/** @type {import('aegir').PartialOptions} */
module.exports = {
test: {
@@ -42,10 +45,10 @@ module.exports = {
}, {
type: 'go',
test: true,
ipfsHttpModule: require(process.env.IPFS_JS_HTTP_MODULE || 'ipfs-http-client')
ipfsHttpModule
}, {
go: {
ipfsBin: process.env.IPFS_GO_EXEC || require('go-ipfs').path()
ipfsBin: process.env.IPFS_GO_EXEC || require(process.env.IPFS_GO_IPFS_MODULE || 'go-ipfs').path()
},
js: {
ipfsOptions: {
@@ -57,26 +60,26 @@ module.exports = {
}
}
},
ipfsModule: require(process.env.IPFS_JS_MODULE || 'ipfs'),
ipfsBin: process.env.IPFS_JS_EXEC || require.resolve(`${process.env.IPFS_JS_MODULE || 'ipfs'}/src/cli.js`)
ipfsModule,
ipfsBin: process.env.IPFS_JS_EXEC || ipfsModule.path()
}
}).start()

const signalingServer = await signaler.start({
const signallingServer = await signaller.start({
port: 24642,
host: '0.0.0.0',
metrics: false
})
return {
ipfsdServer,
signalingServer
signallingServer
}
}
},
async after (options, before) {
if (options.runner !== 'node') {
await before.ipfsdServer.stop()
await before.signalingServer.stop()
await before.signallingServer.stop()
}
}
}
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
time: "11:00"
open-pull-requests-limit: 10
169 changes: 169 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
name: Test
on:
pull_request:
branches:
- master

# To run CI against unrelased go-ipfs or js-ipfs-* code (eg. wip PR),
# uncomment env below and define git revisions in ./scripts/custom-runtime.sh

#env:
#IPFS_GO_EXEC: /tmp/go-ipfs/cmd/ipfs/ipfs
#IPFS_JS_EXEC: /tmp/js-ipfs/packages/ipfs/src/cli.js
#IPFS_JS_MODULE: /tmp/js-ipfs/packages/ipfs/dist/cjs/src/index.js
#IPFS_JS_HTTP_MODULE: /tmp/js-ipfs/packages/ipfs-http-client/dist/cjs/src/index.js

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.16'
- uses: actions/setup-node@v2
with:
node-version: 16
- uses: actions/cache@v2
env:
CACHE_NAME: cache-node-modules
with:
path: |
/tmp/*-ipfs/**
./scripts/libp2p-relay-daemon
~/.npm
./node_modules
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
- name: Install Dependencies
run: |
npm install
./scripts/custom-runtime.sh
npm run build
check:
name: Check
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- uses: actions/cache@v2
id: cache
env:
CACHE_NAME: cache-node-modules
with:
path: |
/tmp/*-ipfs/**
./scripts/libp2p-relay-daemon
~/.npm
./node_modules
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install
npm run build
- run: |
npm run lint
npm run dep-check
test-node:
needs: build
runs-on: ubuntu-latest
name: test node ${{ matrix.node }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- uses: actions/cache@v2
id: cache
env:
CACHE_NAME: cache-node-modules
with:
path: |
/tmp/*-ipfs/**
./scripts/libp2p-relay-daemon
~/.npm
./node_modules
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install
npm run build
- run: npm run test -- -t node

test-browser:
needs: build
runs-on: ubuntu-latest
name: test ${{ matrix.browser }} ${{ matrix.type }}
strategy:
matrix:
browser:
- chromium
- firefox
type:
- browser
- webworker
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- uses: actions/cache@v2
id: cache
env:
CACHE_NAME: cache-node-modules
with:
path: |
/tmp/*-ipfs/**
./scripts/libp2p-relay-daemon
~/.npm
./node_modules
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install
npm run build
- run: npm run test -- -t ${{ matrix.type }} -- --browser ${{ matrix.browser }}

test-electron:
needs: check
runs-on: ubuntu-latest
name: test ${{ matrix.type }}
strategy:
matrix:
type:
- electron-main
- electron-renderer
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- uses: actions/cache@v2
id: cache
env:
CACHE_NAME: cache-node-modules
with:
path: |
/tmp/*-ipfs/**
./scripts/libp2p-relay-daemon
~/.npm
./node_modules
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install
npm run build
- uses: GabrielBB/xvfb-action@v1
with:
run: npm run test -- -t ${{ matrix.type }} --bail -f dist/cjs/node-test/*js
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -37,3 +37,7 @@ dist
test/test-data/go-ipfs-repo/LOCK
test/test-data/go-ipfs-repo/LOG
test/test-data/go-ipfs-repo/LOG.old
types
go-libp2p-relay-daemon
scripts/libp2p-relay-daemon
*.identity
44 changes: 0 additions & 44 deletions .travis.yml

This file was deleted.

9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## [7.0.4](https://github.com/ipfs/interop/compare/v7.0.3...v7.0.4) (2021-10-25)


### Bug Fixes

* disable pubsub due to wire format changes ([#388](https://github.com/ipfs/interop/issues/388)) ([344f692](https://github.com/ipfs/interop/commit/344f692d8cdc68fabe424814214dfb43c716edac))



<a name="2.0.1"></a>
## [2.0.1](https://github.com/ipfs/interop/compare/v2.0.0...v2.0.1) (2020-07-30)

38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -24,6 +24,12 @@ $ npm install -g ipfs-interop
$ ipfs-interop
```

### Run a particular test locally

```console
$ node bin/ipfs-interop.js -- -t node --grep {substring-test-name}
```

## Testing with different versions of go/js IPFS

### As a project
@@ -67,6 +73,38 @@ $ npm install -g ipfs-interop
$ IPFS_GO_EXEC=/path IPFS_JS_EXEC=/path IPFS_JS_MODULE=/path IPFS_JS_HTTP_MODULE=/path ipfs-interop
```

### As a custom runtime

If you want to run interop on CI against specific repo and git revision of
go-ipfs or js-ipfs* then set everything up in `./scripts/custom-runtime.sh`
and enable it by uncommenting `env:` `IPFS_(..)` definitions in `.github/workflows/test.yml`

If you want to test against unrelased things locally, make sure the same env
variables are set on your machine.

For example, to run pubsub tests against go-ipfs and js-ipfs revision defined
in `./scripts/custom-runtime.sh`, one can:

```
export IPFS_GO_EXEC=/tmp/go-ipfs/cmd/ipfs/ipfs
export IPFS_JS_EXEC=/tmp/js-ipfs/packages/ipfs/src/cli.js
export IPFS_JS_MODULE=/tmp/js-ipfs/packages/ipfs/dist/cjs/src/index.js
export IPFS_JS_HTTP_MODULE=/tmp/js-ipfs/packages/ipfs-http-client/dist/cjs/src/index.js
./scripts/custom-runtime.sh
node bin/ipfs-interop.js -- -t node --grep "pubsub"
```

## Releasing a new version

This repo does not use aegir for releases.
Use `npm` directly and publish entire root (CI in go-ipfs requires it).

```
npm version [major|minor|patch]
npm publish
npm push origin && npm push origin v[N.N.N]
```

## Contribute

Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/ipfs-interop/issues)!
6 changes: 4 additions & 2 deletions bin/ipfs-interop.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/usr/bin/env node

'use strict'
import { spawn } from 'child_process'
import { dirname } from 'path'
import { fileURLToPath } from 'url'

const { spawn } = require('child_process')
const __dirname = dirname(fileURLToPath(import.meta.url))

const proc = spawn('npm', ['test'].concat(process.argv.slice(2)), {
cwd: __dirname
Loading