Skip to content

Commit

Permalink
fix: update to new aegir (#3528)
Browse files Browse the repository at this point in the history
- update aegir
- fix some linting
- enable multiple test runs at the same time (all servers now try to find free ports)

Co-authored-by: achingbrain <[email protected]>
  • Loading branch information
hugomrdias and achingbrain authored Mar 7, 2021
1 parent bf59df6 commit b9db560
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 30 deletions.
43 changes: 26 additions & 17 deletions .aegir.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,35 @@
'use strict'

const { createServer } = require('ipfsd-ctl')
const getPort = require('aegir/utils/get-port')

const server = createServer({
host: '127.0.0.1',
port: 48372
}, {
type: 'go',
ipfsHttpModule: require('./'),
ipfsBin: require('go-ipfs').path()
})

/** @type {import('aegir').PartialOptions} */
module.exports = {
bundlesize: { maxSize: '83kB' },
hooks: {
browser: {
pre: async () => {
await server.start()
},
post: async () => {
await server.stop()
build: {
bundlesizeMax: '110kB'
},
test: {
async before (options) {
const port = await getPort()
const server = createServer({
host: '127.0.0.1',
port: port
}, {
type: 'go',
ipfsHttpModule: require('./'),
ipfsBin: require('go-ipfs').path()
})

await server.start()
return {
server,
env: {
IPFSD_SERVER: `http://${server.host}:${server.port}`
}
}
},
async after (options, before) {
await before.server.stop()
}
}
}
3 changes: 0 additions & 3 deletions .eslintrc

This file was deleted.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"url": "git+https://github.com/ipfs/js-ipfs.git"
},
"scripts": {
"prepublishOnly": "aegir build",
"prepare": "aegir build --no-bundle",
"build": "aegir build",
"test": "aegir test",
"test:node": "aegir test -t node",
"test:browser": "aegir test -t browser",
Expand All @@ -45,15 +46,14 @@
"test:chrome": "aegir test -t browser -t webworker -- --browsers ChromeHeadless",
"test:firefox": "aegir test -t browser -t webworker -- --browsers FirefoxHeadless",
"lint": "aegir lint",
"prepare": "aegir build --no-bundle",
"coverage": "npx nyc -r html npm run test:node -- --bail",
"clean": "rimraf ./dist",
"dep-check": "aegir dep-check -i ipfs-core -i rimraf -i ipfs-core-types -i abort-controller"
},
"dependencies": {
"abort-controller": "^3.0.0",
"any-signal": "^2.1.2",
"bignumber.js": "^9.0.0",
"bignumber.js": "^9.0.1",
"cids": "^1.1.5",
"debug": "^4.1.1",
"form-data": "^3.0.0",
Expand All @@ -70,19 +70,19 @@
"it-to-stream": "^0.1.2",
"merge-options": "^3.0.4",
"multiaddr": "^8.0.0",
"multibase": "^3.0.0",
"multicodec": "^2.0.1",
"multihashes": "^3.0.1",
"multibase": "^4.0.2",
"multicodec": "^3.0.1",
"multihashes": "^4.0.2",
"nanoid": "^3.1.12",
"native-abort-controller": "^1.0.3",
"parse-duration": "^0.4.4",
"stream-to-it": "^0.2.2",
"uint8arrays": "^2.0.5"
"uint8arrays": "^2.1.3"
},
"devDependencies": {
"aegir": "^30.3.0",
"aegir": "^31.0.0",
"delay": "^4.4.0",
"go-ipfs": "0.8.0-rc2",
"go-ipfs": "0.8.0",
"ipfs-core": "^0.5.2",
"ipfsd-ctl": "^7.2.0",
"it-all": "^1.0.4",
Expand Down
2 changes: 1 addition & 1 deletion test/utils/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const commonOptions = {
test: true,
type: 'go',
ipfsHttpModule: require('../../src'),
endpoint: 'http://localhost:48372'
endpoint: process.env.IPFSD_SERVER
}

const commonOverrides = {
Expand Down

0 comments on commit b9db560

Please sign in to comment.