-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Awesome Endeavour: Circuit Relay #830
Changes from 6 commits
9aef6b7
e3957d2
72b6fb6
492fa16
c7fd99a
1742398
50b29e4
aa98ec0
c5c88aa
18f5a9a
983bfd9
61e1266
19d8555
36afc59
bad8232
05e19a0
cba1be2
409a523
ddcca8b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,43 @@ | ||
'use strict' | ||
|
||
const parallel = require('async/parallel') | ||
const spawnTools = require('./test/utils/spawn-tools') | ||
const js = spawnTools.spawnJsNode | ||
// const go = spawnTools.spawnGoNode | ||
const stop = spawnTools.stopNodes | ||
|
||
/* | ||
* spawns a daemon with ports numbers starting in 10 and ending in `num` | ||
*/ | ||
function pre (done) { | ||
const base = '/ip4/127.0.0.1/tcp' | ||
|
||
parallel([ | ||
(cb) => js([`${base}/10007`, `${base}/20007/ws`], true, 31007, 32007, cb), | ||
(cb) => js([`${base}/10008`, `${base}/20008/ws`], true, 31008, 32008, cb), | ||
(cb) => js([`${base}/10012`, `${base}/20012/ws`], true, 31012, 32012, cb), | ||
(cb) => js([`${base}/10013`, `${base}/20013/ws`], true, 31013, 32013, cb), | ||
(cb) => js([`${base}/10014`, `${base}/20014/ws`], true, 31014, 32014, cb), | ||
(cb) => js([`${base}/10015`, `${base}/20015/ws`], true, 31015, 32015, cb) | ||
// (cb) => go([`${base}/10027`, `${base}/20027/ws`], true, 33027, 44027, cb), | ||
// (cb) => go([`${base}/10028`, `${base}/20028/ws`], true, 33028, 44028, cb), | ||
// (cb) => go([`${base}/10031`, `${base}/20031/ws`], true, 33031, 44031, cb), | ||
// (cb) => go([`${base}/10032`, `${base}/20032/ws`], true, 33032, 44032, cb) | ||
], done) | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why can't the "Spawner" use IPFS Factory? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, what are the magic numbers? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The numbers are the preexisting port numbers that this daemons were being started with - I kept them because I believe some other tests might rely on them. |
||
|
||
module.exports = { | ||
karma: { | ||
files: [{ | ||
pattern: 'node_modules/interface-ipfs-core/test/fixtures/**/*', | ||
watched: false, | ||
served: true, | ||
included: false | ||
included: false, | ||
singleRun: false | ||
}] | ||
}, | ||
hooks: { | ||
pre: pre, | ||
post: stop | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dignifiedquire is there a way to select custom .aegir.js for different runs? Goal here is to have one for interop and another for unit There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AFAIK, we can have |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,17 +19,21 @@ | |
"npm": ">=3.0.0" | ||
}, | ||
"scripts": { | ||
"lint": "aegir-lint", | ||
"coverage": "gulp coverage", | ||
"test": "gulp test --dom", | ||
"test:node": "npm run test:unit:node", | ||
"test:browser": "npm run test:unit:browser", | ||
"test:unit:node": "gulp test:node", | ||
"test:unit:node:core": "TEST=core npm run test:unit:node", | ||
"test:unit:node:http": "TEST=http npm run test:unit:node", | ||
"test:unit:node:gateway": "TEST=gateway npm run test:unit:node", | ||
"test:unit:node:cli": "TEST=cli npm run test:unit:node", | ||
"test:unit:browser": "gulp test:browser", | ||
"lint": "aegir lint", | ||
"build": "aegir build", | ||
"test": "aegir test --target node --target browser --no-cors", | ||
"test:node": "aegir test --target node", | ||
"test:browser": "aegir test --target browser --target webworker --no-cors", | ||
"release": "aegir release --target node --target browser", | ||
"release-minor": "aegir release --type minor --target node --target browser", | ||
"release-major": "aegir release --type major --target node --target browser", | ||
"coverage": "aegir coverage", | ||
"test:unit:node": "aegir test --target node", | ||
"test:unit:node:core": "aegir test --target node -f test/core/*.js", | ||
"test:unit:node:http": "aegir test --target node -f test/http-api/index.js", | ||
"test:unit:node:gateway": "aegir test --target node -f test/gateway/index.js", | ||
"test:unit:node:cli": "aegir test --target node -f test/cli/index.js", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Woot! Love this :D There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😜 getting there. baby steps :) |
||
"test:unit:browser": "aegir test --target browser --no-cors", | ||
"test:interop": "npm run test:interop:node", | ||
"test:interop:node": "mocha -t 60000 test/interop/node.js", | ||
"test:interop:browser": "mocha -t 60000 test/interop/browser.js", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs to start using aegir due to https://github.com/ipfs/js-ipfs/pull/830/files#r149579164 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll get those in. |
||
|
@@ -38,10 +42,6 @@ | |
"test:benchmark:node:core": "echo \"Error: no benchmarks yet\" && exit 1", | ||
"test:benchmark:node:http": "echo \"Error: no benchmarks yet\" && exit 1", | ||
"test:benchmark:browser": "echo \"Error: no benchmarks yet\" && exit 1", | ||
"build": "gulp build", | ||
"release": "gulp release", | ||
"release-minor": "gulp release --type minor", | ||
"release-major": "gulp release --type major", | ||
"coverage-publish": "aegir-coverage publish" | ||
}, | ||
"pre-commit": [ | ||
|
@@ -62,7 +62,7 @@ | |
}, | ||
"homepage": "https://github.com/ipfs/js-ipfs#readme", | ||
"devDependencies": { | ||
"aegir": "^11.0.2", | ||
"aegir": "^12.1.3", | ||
"buffer-loader": "0.0.1", | ||
"chai": "^4.1.2", | ||
"delay": "^2.0.0", | ||
|
@@ -74,7 +74,7 @@ | |
"expose-loader": "^0.7.3", | ||
"form-data": "^2.3.1", | ||
"gulp": "^3.9.1", | ||
"interface-ipfs-core": "~0.32.1", | ||
"interface-ipfs-core": "~0.33.1", | ||
"ipfsd-ctl": "~0.24.0", | ||
"left-pad": "^1.1.3", | ||
"lodash": "^4.17.4", | ||
|
@@ -90,9 +90,9 @@ | |
"transform-loader": "^0.2.4" | ||
}, | ||
"dependencies": { | ||
"async": "^2.5.0", | ||
"async": "^2.6.0", | ||
"bl": "^1.2.1", | ||
"boom": "^6.0.0", | ||
"boom": "^7.1.1", | ||
"byteman": "^1.3.5", | ||
"cids": "^0.5.2", | ||
"debug": "^3.1.0", | ||
|
@@ -103,20 +103,21 @@ | |
"glob": "^7.1.2", | ||
"hapi": "^16.6.2", | ||
"hapi-set-header": "^1.0.2", | ||
"hoek": "^5.0.0", | ||
"ipfs-api": "^14.3.7", | ||
"hoek": "^5.0.2", | ||
"ipfs-api": "^15.0.1", | ||
"ipfs-bitswap": "~0.17.2", | ||
"ipfs-block": "~0.6.0", | ||
"ipfs-block-service": "~0.12.0", | ||
"ipfs-block": "~0.6.1", | ||
"ipfs-block-service": "~0.13.0", | ||
"ipfs-multipart": "~0.1.0", | ||
"ipfs-repo": "~0.17.0", | ||
"ipfs-unixfs": "~0.1.13", | ||
"ipfs-unixfs-engine": "~0.22.5", | ||
"ipld-resolver": "~0.13.4", | ||
"ipfs-repo": "~0.18.2", | ||
"ipfs-unixfs": "~0.1.14", | ||
"ipfs-unixfs-engine": "~0.23.0", | ||
"ipld-resolver": "~0.14.1", | ||
"is-ipfs": "^0.3.2", | ||
"is-stream": "^1.1.0", | ||
"joi": "^13.0.1", | ||
"libp2p": "~0.12.4", | ||
"libp2p": "~0.13.0", | ||
"libp2p-circuit": "~0.1.4", | ||
"libp2p-floodsub": "~0.11.1", | ||
"libp2p-kad-dht": "~0.5.1", | ||
"libp2p-mdns": "~0.9.1", | ||
|
@@ -125,12 +126,12 @@ | |
"libp2p-secio": "~0.8.1", | ||
"libp2p-tcp": "~0.11.1", | ||
"libp2p-webrtc-star": "~0.13.2", | ||
"libp2p-websockets": "~0.10.2", | ||
"libp2p-websockets": "~0.10.4", | ||
"lodash.flatmap": "^4.5.0", | ||
"lodash.get": "^4.4.2", | ||
"lodash.sortby": "^4.7.0", | ||
"lodash.values": "^4.3.0", | ||
"mafmt": "^3.0.1", | ||
"mafmt": "^3.0.2", | ||
"mime-types": "^2.1.17", | ||
"mkdirp": "~0.5.1", | ||
"multiaddr": "^3.0.1", | ||
|
@@ -151,18 +152,18 @@ | |
"pull-stream": "^3.6.1", | ||
"pull-stream-to-stream": "^1.3.4", | ||
"pull-zip": "^2.0.1", | ||
"read-pkg-up": "^2.0.0", | ||
"read-pkg-up": "^3.0.0", | ||
"readable-stream": "2.3.3", | ||
"safe-buffer": "^5.1.1", | ||
"stream-to-pull-stream": "^1.7.2", | ||
"tar-stream": "^1.5.4", | ||
"temp": "~0.8.3", | ||
"through2": "^2.0.3", | ||
"update-notifier": "^2.3.0", | ||
"yargs": "9.0.1" | ||
"yargs": "^10.0.3" | ||
}, | ||
"optionalDependencies": { | ||
"prom-client": "^10.2.0", | ||
"prom-client": "^10.2.2", | ||
"prometheus-gc-stats": "^0.5.0" | ||
}, | ||
"contributors": [ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you make these spawn daemon tools part of test/utils? This file should have a very declarative feel and just inform the dev what is going to be spawned for testing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, I'll move them over.