Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit cee9a3d

Browse files
dryajovdaviddias
authored andcommitted
test: use reduced keysize for faster tests (#698)
1 parent 78ba320 commit cee9a3d

30 files changed

+43
-41
lines changed

package.json

+12-10
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@
1212
"ipfs": false
1313
},
1414
"scripts": {
15-
"test": "aegir test",
15+
"test": "cross-env NODE_OPTIONS='--max-old-space-size=8192' aegir test",
1616
"test:node": "aegir test -t node",
17-
"test:browser": "node --max-old-space-size=8192 $(npm bin)/aegir test -t browser",
18-
"test:webworker": "node --max-old-space-size=8192 $(npm bin)/aegir test -t webworker",
17+
"test:browser": "cross-env NODE_OPTIONS='--max-old-space-size=8192' aegir test -t browser",
18+
"test:webworker": "cross-env NODE_OPTIONS='--max-old-space-size=8192' aegir test -t webworker",
1919
"lint": "aegir lint",
2020
"build": "aegir build",
21-
"release": "node --max-old-space-size=8192 $(npm bin)/aegir release ",
22-
"release-minor": "node --max-old-space-size=8192 $(npm bin)/aegir release --type minor ",
23-
"release-major": "node --max-old-space-size=8192 $(npm bin)/aegir release --type major ",
24-
"coverage": "node --max-old-space-size=8192 $(npm bin)/aegir coverage --timeout 100000",
25-
"coverage-publish": "node --max-old-space-size=8192 $(npm bin)/aegir coverage --provider coveralls --timeout 100000"
21+
"release": "cross-env NODE_OPTIONS='--max-old-space-size=8192' aegir release ",
22+
"release-minor": "cross-env NODE_OPTIONS='--max-old-space-size=8192' aegir release --type minor ",
23+
"release-major": "cross-env NODE_OPTIONS='--max-old-space-size=8192' aegir release --type major ",
24+
"coverage": "cross-env NODE_OPTIONS='--max-old-space-size=8192' aegir coverage --timeout 100000",
25+
"coverage-publish": "cross-env NODE_OPTIONS='--max-old-space-size=8192' aegir coverage --provider coveralls --timeout 100000"
2626
},
2727
"dependencies": {
2828
"async": "^2.6.0",
@@ -67,13 +67,15 @@
6767
"devDependencies": {
6868
"aegir": "^13.0.0",
6969
"chai": "^4.1.2",
70+
"cross-env": "^5.1.3",
7071
"dirty-chai": "^2.0.1",
7172
"eslint-plugin-react": "^7.6.1",
7273
"go-ipfs-dep": "^0.4.13",
7374
"gulp": "^3.9.1",
74-
"interface-ipfs-core": "~0.51.0",
7575
"hapi": "^17.2.0",
76-
"ipfsd-ctl": "~0.28.0",
76+
"interface-ipfs-core": "~0.51.0",
77+
"ipfs": "~0.28.0",
78+
"ipfsd-ctl": "~0.29.0",
7779
"pre-commit": "^1.2.2",
7880
"socket.io": "^2.0.4",
7981
"socket.io-client": "^2.0.4",

test/bitswap.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('.bitswap', function () {
1919
before(function (done) {
2020
this.timeout(20 * 1000) // slow CI
2121

22-
f.spawn((err, _ipfsd) => {
22+
f.spawn({ initOptions: { bits: 1024 } }, (err, _ipfsd) => {
2323
expect(err).to.not.exist()
2424
ipfsd = _ipfsd
2525
ipfs = IPFSApi(_ipfsd.apiAddr)

test/commands.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('.commands', function () {
1717
let ipfs
1818

1919
before((done) => {
20-
f.spawn((err, _ipfsd) => {
20+
f.spawn({ initOptions: { bits: 1024 } }, (err, _ipfsd) => {
2121
expect(err).to.not.exist()
2222
ipfsd = _ipfsd
2323
ipfs = IPFSApi(_ipfsd.apiAddr)

test/constructor.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('ipfs-api constructor tests', () => {
2727
before(function (done) {
2828
this.timeout(20 * 1000) // slow CI
2929

30-
f.spawn((err, node) => {
30+
f.spawn({ initOptions: { bits: 1024 } }, (err, node) => {
3131
expect(err).to.not.exist()
3232
ipfsd = node
3333
apiAddr = node.apiAddr.toString()

test/diag.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('.diag', function () {
2020
let ipfs
2121

2222
before((done) => {
23-
f.spawn((err, _ipfsd) => {
23+
f.spawn({ initOptions: { bits: 1024 } }, (err, _ipfsd) => {
2424
expect(err).to.not.exist()
2525
ipfsd = _ipfsd
2626
ipfs = IPFSApi(_ipfsd.apiAddr)

test/files.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ describe('.files (the MFS API part)', function () {
3737
const expectedMultihash = 'Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP'
3838

3939
before((done) => {
40-
f.spawn((err, _ipfsd) => {
40+
f.spawn({ initOptions: { bits: 1024 } }, (err, _ipfsd) => {
4141
expect(err).to.not.exist()
4242
ipfsd = _ipfsd
4343
ipfs = IPFSApi(_ipfsd.apiAddr)

test/get.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe('.get (specific go-ipfs features)', function () {
3131

3232
before((done) => {
3333
series([
34-
(cb) => f.spawn((err, _ipfsd) => {
34+
(cb) => f.spawn({ initOptions: { bits: 1024 } }, (err, _ipfsd) => {
3535
expect(err).to.not.exist()
3636
ipfsd = _ipfsd
3737
ipfs = IPFSApi(_ipfsd.apiAddr)

test/interface/block.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const common = {
1313
setup: function (callback) {
1414
callback(null, {
1515
spawnNode: (cb) => {
16-
f.spawn((err, _ipfsd) => {
16+
f.spawn({ initOptions: { bits: 1024 } }, (err, _ipfsd) => {
1717
if (err) {
1818
return cb(err)
1919
}

test/interface/bootstrap.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const common = {
1313
setup: function (callback) {
1414
callback(null, {
1515
spawnNode: (cb) => {
16-
f.spawn((err, _ipfsd) => {
16+
f.spawn({ initOptions: { bits: 1024 } }, (err, _ipfsd) => {
1717
if (err) {
1818
return cb(err)
1919
}

test/interface/config.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const common = {
1313
setup: function (callback) {
1414
callback(null, {
1515
spawnNode: (cb) => {
16-
f.spawn((err, _ipfsd) => {
16+
f.spawn({ initOptions: { bits: 1024 } }, (err, _ipfsd) => {
1717
if (err) {
1818
return cb(err)
1919
}

test/interface/dht.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const common = {
1212
setup: function (callback) {
1313
callback(null, {
1414
spawnNode: (cb) => {
15-
f.spawn((err, _ipfsd) => {
15+
f.spawn({ initOptions: { bits: 1024 } }, (err, _ipfsd) => {
1616
if (err) {
1717
return cb(err)
1818
}

test/interface/files-mfs.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const common = {
1313
setup: function (callback) {
1414
callback(null, {
1515
spawnNode: (cb) => {
16-
f.spawn((err, _ipfsd) => {
16+
f.spawn({ initOptions: { bits: 1024 } }, (err, _ipfsd) => {
1717
if (err) {
1818
return cb(err)
1919
}

test/interface/files.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const common = {
1313
setup: function (callback) {
1414
callback(null, {
1515
spawnNode: (cb) => {
16-
f.spawn((err, _ipfsd) => {
16+
f.spawn({ initOptions: { bits: 1024 } }, (err, _ipfsd) => {
1717
if (err) {
1818
return cb(err)
1919
}

test/interface/key.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const common = {
1313
setup: function (callback) {
1414
callback(null, {
1515
spawnNode: (cb) => {
16-
f.spawn((err, _ipfsd) => {
16+
f.spawn({ initOptions: { bits: 1024 } }, (err, _ipfsd) => {
1717
if (err) {
1818
return cb(err)
1919
}

test/interface/miscellaneous.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const common = {
1212
setup: function (callback) {
1313
callback(null, {
1414
spawnNode: (cb) => {
15-
f.spawn((err, _ipfsd) => {
15+
f.spawn({ initOptions: { bits: 1024 } }, (err, _ipfsd) => {
1616
if (err) {
1717
return cb(err)
1818
}

test/interface/object.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const common = {
1313
setup: function (callback) {
1414
callback(null, {
1515
spawnNode: (cb) => {
16-
f.spawn((err, _ipfsd) => {
16+
f.spawn({ initOptions: { bits: 1024 } }, (err, _ipfsd) => {
1717
if (err) {
1818
return cb(err)
1919
}

test/interface/pin.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const common = {
1313
setup: function (callback) {
1414
callback(null, {
1515
spawnNode: (cb) => {
16-
f.spawn((err, _ipfsd) => {
16+
f.spawn({ initOptions: { bits: 1024 } }, (err, _ipfsd) => {
1717
if (err) {
1818
return cb(err)
1919
}

test/interface/pubsub.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if (isNode) {
1616
setup: function (callback) {
1717
callback(null, {
1818
spawnNode: (cb) => {
19-
f.spawn({ args: ['--enable-pubsub-experiment'] },
19+
f.spawn({ initOptions: { bits: 1024 }, args: ['--enable-pubsub-experiment'] },
2020
(err, _ipfsd) => {
2121
if (err) {
2222
return cb(err)

test/interface/repo.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const common = {
1313
setup: function (callback) {
1414
callback(null, {
1515
spawnNode: (cb) => {
16-
f.spawn((err, _ipfsd) => {
16+
f.spawn({ initOptions: { bits: 1024 } }, (err, _ipfsd) => {
1717
if (err) {
1818
return cb(err)
1919
}

test/interface/stats.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const common = {
1313
setup: function (callback) {
1414
callback(null, {
1515
spawnNode: (cb) => {
16-
f.spawn((err, _ipfsd) => {
16+
f.spawn({ initOptions: { bits: 1024 } }, (err, _ipfsd) => {
1717
if (err) {
1818
return cb(err)
1919
}

test/interface/swarm.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const common = {
2323
config = undefined
2424
}
2525

26-
f.spawn({ repoPath, config }, (err, _ipfsd) => {
26+
f.spawn({ repoPath, config, initOptions: { bits: 1024 } }, (err, _ipfsd) => {
2727
if (err) {
2828
return cb(err)
2929
}

test/key.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('.key', function () {
1717
let ipfs
1818

1919
before((done) => {
20-
f.spawn((err, _ipfsd) => {
20+
f.spawn({ initOptions: { bits: 1024 } }, (err, _ipfsd) => {
2121
expect(err).to.not.exist()
2222
ipfsd = _ipfsd
2323
ipfs = IPFSApi(_ipfsd.apiAddr)

test/log.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('.log', function () {
1717
let ipfs
1818

1919
before((done) => {
20-
f.spawn((err, _ipfsd) => {
20+
f.spawn({ initOptions: { bits: 1024 } }, (err, _ipfsd) => {
2121
expect(err).to.not.exist()
2222
ipfsd = _ipfsd
2323
ipfs = IPFSApi(_ipfsd.apiAddr)

test/name.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ describe('.name', () => {
2727

2828
series([
2929
(cb) => {
30-
f.spawn((err, _ipfsd) => {
30+
f.spawn({ initOptions: { bits: 1024 } }, (err, _ipfsd) => {
3131
expect(err).to.not.exist()
3232
ipfsd = _ipfsd
3333
ipfs = IPFSApi(_ipfsd.apiAddr)
3434
cb()
3535
})
3636
},
3737
(cb) => {
38-
f.spawn((err, node) => {
38+
f.spawn({ initOptions: { bits: 1024 } }, (err, node) => {
3939
expect(err).to.not.exist()
4040
other = node.api
4141
otherd = node

test/ping.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe.skip('.ping', () => {
2323

2424
series([
2525
(cb) => {
26-
f.spawn((err, _ipfsd) => {
26+
f.spawn({ initOptions: { bits: 1024 } }, (err, _ipfsd) => {
2727
expect(err).to.not.exist()
2828
ipfsd = _ipfsd
2929
ipfs = IPFSApi(_ipfsd.apiAddr)
@@ -32,7 +32,7 @@ describe.skip('.ping', () => {
3232
},
3333
(cb) => {
3434
console.log('going to spawn second node')
35-
f.spawn((err, node) => {
35+
f.spawn({ initOptions: { bits: 1024 } }, (err, node) => {
3636
expect(err).to.not.exist()
3737
other = node.api
3838
otherd = node

test/pubsub-in-browser.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe('.pubsub is not supported in the browser, yet!', function () {
4747
let ipfsd
4848

4949
before((done) => {
50-
f.spawn((err, _ipfsd) => {
50+
f.spawn({ initOptions: { bits: 1024 } }, (err, _ipfsd) => {
5151
expect(err).to.not.exist()
5252
ipfsd = _ipfsd
5353
ipfs = IPFSApi(_ipfsd.apiAddr)

test/refs.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe('.refs', function () {
3535
}
3636

3737
waterfall([
38-
(cb) => f.spawn(cb),
38+
(cb) => f.spawn({ initOptions: { bits: 1024 } }, cb),
3939
(_ipfsd, cb) => {
4040
ipfsd = _ipfsd
4141
ipfs = IPFSApi(_ipfsd.apiAddr)

test/repo.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('.repo', function () {
1616
let ipfsd
1717

1818
before((done) => {
19-
f.spawn((err, _ipfsd) => {
19+
f.spawn({ initOptions: { bits: 1024 } }, (err, _ipfsd) => {
2020
expect(err).to.not.exist()
2121
ipfsd = _ipfsd
2222
ipfs = IPFSApi(_ipfsd.apiAddr)

test/stats.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('stats', function () {
1616
let ipfsd
1717

1818
before((done) => {
19-
f.spawn((err, _ipfsd) => {
19+
f.spawn({ initOptions: { bits: 1024 } }, (err, _ipfsd) => {
2020
expect(err).to.not.exist()
2121
ipfsd = _ipfsd
2222
ipfs = IPFSApi(_ipfsd.apiAddr)

test/util.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('.util', () => {
2222
before(function (done) {
2323
this.timeout(20 * 1000) // slow CI
2424

25-
f.spawn((err, _ipfsd) => {
25+
f.spawn({ initOptions: { bits: 1024 } }, (err, _ipfsd) => {
2626
expect(err).to.not.exist()
2727
ipfsd = _ipfsd
2828
ipfs = IPFSApi(_ipfsd.apiAddr)

0 commit comments

Comments
 (0)