Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.
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
68 changes: 60 additions & 8 deletions .aegir.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
'use strict'

const webpack = require('webpack')
const createServer = require('ipfsd-ctl').createServer
const rendezvous = require('libp2p-websocket-star-rendezvous')
const signaler = require('libp2p-webrtc-star/src/sig-server')
const findBin = require('./test/utils/find-bin')

let signalingServer
let goIpfsdServer
let jsIpfsdServer

let rzserver
const server = createServer()
module.exports = {
webpack: {
plugins: [
new webpack.EnvironmentPlugin(['IPFS_JS_EXEC', 'IPFS_JS_MODULE'])
]
},
karma: {
files: [{
pattern: 'test/fixtures/**/*',
Expand All @@ -19,14 +28,57 @@ module.exports = {
hooks: {
browser: {
pre: async () => {
await server.start()
rzserver = await rendezvous.start({
port: 24642
goIpfsdServer = await createServer({
host: '127.0.0.1',
port: 43134
}, {
type: 'go',
test: true,
ipfsHttpModule: {
path: require.resolve('ipfs-http-client'),
ref: require('ipfs-http-client')
}
}, {
go: { ipfsBin: findBin('go') }
}).start()

jsIpfsdServer = await createServer({
host: '127.0.0.1',
port: 43135
}, {
type: 'js',
test: true,
ipfsModule: {
path: require.resolve(process.env.IPFS_JS_MODULE || 'ipfs'),
ref: require(process.env.IPFS_JS_MODULE || 'ipfs')
},
ipfsHttpModule: {
path: require.resolve('ipfs-http-client'),
ref: require('ipfs-http-client')
},
ipfsOptions: {
config: {
libp2p: {
dialer: {
dialTimeout: 60e3 // increase timeout because travis is slow
}
}
}
}
}, {
js: { ipfsBin: findBin('js') }
}).start()

signalingServer = await signaler.start({
port: 24642,
host: '0.0.0.0',
metrics: false
})
},
post: async () => {
await server.stop()
await rzserver.stop()
await goIpfsdServer.stop()
await jsIpfsdServer.stop()
await signalingServer.stop()
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ os:
- osx

script:
- npm install ipfs go-ipfs-dep
- npm install ipfs@0.41.0-rc.1 go-ipfs-dep ipfs-http-client@42.0.0
- npx nyc -s npm run test:node -- --bail
after_success: npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov

Expand All @@ -39,15 +39,15 @@ jobs:
addons:
chrome: stable
script:
- npm install ipfs go-ipfs-dep
- npm install ipfs@0.41.0-rc.1 go-ipfs-dep ipfs-http-client@42.0.0
- npx aegir test -t browser

- stage: test
name: firefox
addons:
firefox: latest
script:
- npm install ipfs go-ipfs-dep
- npm install ipfs@0.41.0-rc.1 go-ipfs-dep ipfs-http-client@42.0.0
- npx aegir test -t browser -- --browsers FirefoxHeadless

notifications:
Expand Down
2 changes: 1 addition & 1 deletion bin/ipfs-interop.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

const { spawn } = require('child_process')

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