mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-10-07 22:57:07 +00:00
Remove obsolete code from tests, speed peering for replication tests
This commit is contained in:
@@ -12,23 +12,19 @@ const ipfsPath = './orbitdb/tests/docstore/ipfs'
|
||||
describe('orbit-db - Document Store', function() {
|
||||
this.timeout(config.timeout)
|
||||
|
||||
let ipfs, orbitdb1, orbitdb2, db
|
||||
let ipfs, orbitdb1, db
|
||||
|
||||
before(async () => {
|
||||
config.daemon1.repo = ipfsPath
|
||||
rmrf.sync(config.daemon1.repo)
|
||||
ipfs = await startIpfs(config.daemon1)
|
||||
orbitdb1 = new OrbitDB(ipfs, dbPath + '/1')
|
||||
orbitdb2 = new OrbitDB(ipfs, dbPath + '/2')
|
||||
})
|
||||
|
||||
after(() => {
|
||||
if(orbitdb1)
|
||||
orbitdb1.disconnect()
|
||||
|
||||
if(orbitdb2)
|
||||
orbitdb2.disconnect()
|
||||
|
||||
if (ipfs)
|
||||
ipfs.stop()
|
||||
})
|
||||
|
||||
@@ -15,7 +15,7 @@ const ipfsPath = './orbitdb/tests/eventlog/ipfs'
|
||||
describe('orbit-db - Eventlog', function() {
|
||||
this.timeout(config.timeout)
|
||||
|
||||
let ipfs, orbitdb1, orbitdb2, db
|
||||
let ipfs, orbitdb1, db
|
||||
|
||||
before(async () => {
|
||||
config.daemon1.repo = ipfsPath
|
||||
@@ -23,16 +23,12 @@ describe('orbit-db - Eventlog', function() {
|
||||
rmrf.sync(dbPath)
|
||||
ipfs = await startIpfs(config.daemon1)
|
||||
orbitdb1 = new OrbitDB(ipfs, dbPath + '/1')
|
||||
orbitdb2 = new OrbitDB(ipfs, dbPath + '/2')
|
||||
})
|
||||
|
||||
after(async () => {
|
||||
if(orbitdb1)
|
||||
orbitdb1.stop()
|
||||
|
||||
if(orbitdb2)
|
||||
orbitdb2.stop()
|
||||
|
||||
if (ipfs)
|
||||
await ipfs.stop()
|
||||
})
|
||||
|
||||
@@ -15,7 +15,7 @@ const ipfsPath = './orbitdb/tests/feed/ipfs'
|
||||
describe('orbit-db - Feed', function() {
|
||||
this.timeout(config.timeout)
|
||||
|
||||
let ipfs, orbitdb1, orbitdb2, db, address
|
||||
let ipfs, orbitdb1, db, address
|
||||
|
||||
before(async () => {
|
||||
config.daemon1.repo = ipfsPath
|
||||
@@ -23,16 +23,12 @@ describe('orbit-db - Feed', function() {
|
||||
rmrf.sync(dbPath)
|
||||
ipfs = await startIpfs(config.daemon1)
|
||||
orbitdb1 = new OrbitDB(ipfs, dbPath + '/1')
|
||||
orbitdb2 = new OrbitDB(ipfs, dbPath + '/2')
|
||||
})
|
||||
|
||||
after(async () => {
|
||||
if(orbitdb1)
|
||||
orbitdb1.stop()
|
||||
|
||||
if(orbitdb2)
|
||||
orbitdb2.stop()
|
||||
|
||||
if (ipfs)
|
||||
await ipfs.stop()
|
||||
})
|
||||
|
||||
@@ -12,7 +12,7 @@ const ipfsPath = './orbitdb/tests/kvstore/ipfs'
|
||||
describe('orbit-db - Key-Value Store', function() {
|
||||
this.timeout(config.timeout)
|
||||
|
||||
let ipfs, orbitdb1, orbitdb2, db
|
||||
let ipfs, orbitdb1, db
|
||||
|
||||
before(async () => {
|
||||
config.daemon1.repo = ipfsPath
|
||||
@@ -20,16 +20,12 @@ describe('orbit-db - Key-Value Store', function() {
|
||||
rmrf.sync(dbPath)
|
||||
ipfs = await startIpfs(config.daemon1)
|
||||
orbitdb1 = new OrbitDB(ipfs, dbPath + '/1')
|
||||
orbitdb2 = new OrbitDB(ipfs, dbPath + '/2')
|
||||
})
|
||||
|
||||
after(async () => {
|
||||
if(orbitdb1)
|
||||
orbitdb1.stop()
|
||||
|
||||
if(orbitdb2)
|
||||
orbitdb2.stop()
|
||||
|
||||
if (ipfs)
|
||||
await ipfs.stop()
|
||||
})
|
||||
|
||||
@@ -28,6 +28,9 @@ describe('orbit-db - Replicate and Load', function() {
|
||||
rmrf.sync(dbPath2)
|
||||
ipfs1 = await startIpfs(config.daemon1)
|
||||
ipfs2 = await startIpfs(config.daemon2)
|
||||
// Connect the peers manually to speed up test times
|
||||
await ipfs2.swarm.connect(ipfs1._peerInfo.multiaddrs._multiaddrs[0].toString())
|
||||
await ipfs1.swarm.connect(ipfs2._peerInfo.multiaddrs._multiaddrs[0].toString())
|
||||
orbitdb1 = new OrbitDB(ipfs1, dbPath1)
|
||||
orbitdb2 = new OrbitDB(ipfs2, dbPath2)
|
||||
})
|
||||
|
||||
@@ -28,6 +28,9 @@ describe('orbit-db - Replication', function() {
|
||||
rmrf.sync(dbPath2)
|
||||
ipfs1 = await startIpfs(config.daemon1)
|
||||
ipfs2 = await startIpfs(config.daemon2)
|
||||
// Connect the peers manually to speed up test times
|
||||
await ipfs2.swarm.connect(ipfs1._peerInfo.multiaddrs._multiaddrs[0].toString())
|
||||
await ipfs1.swarm.connect(ipfs2._peerInfo.multiaddrs._multiaddrs[0].toString())
|
||||
orbitdb1 = new OrbitDB(ipfs1, dbPath1)
|
||||
orbitdb2 = new OrbitDB(ipfs2, dbPath2)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user