Skip to content

Commit

Permalink
chore: Remove unused Ceramic nodes from test
Browse files Browse the repository at this point in the history
  • Loading branch information
stbrody committed Feb 22, 2024
1 parent a3d9465 commit cc3110f
Showing 1 changed file with 6 additions and 35 deletions.
41 changes: 6 additions & 35 deletions src/__tests__/ceramic_integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,22 +245,12 @@ describe('Ceramic Integration Test', () => {

let ipfs1: IpfsApi // Used by CAS1 directly
let ipfs2: IpfsApi // Used by CAS2 directly
let ipfs3: IpfsApi // Used by CAS1 ceramic
let ipfs4: IpfsApi // Used by CAS2 ceramic
let ipfs5: IpfsApi // Used by main ceramic 1
let ipfs6: IpfsApi // Used by main ceramic 2
let ipfs3: IpfsApi // Used by main ceramic 1
let ipfs4: IpfsApi // Used by main ceramic 2

// let ipfsServer1: HttpApi
// let ipfsServer2: HttpApi

let casCeramic1: Ceramic // Ceramic node used internally by CAS1
let casCeramic2: Ceramic // Ceramic node used internally by CAS2
let ceramic1: Ceramic // First main Ceramic node used by the tests
let ceramic2: Ceramic // Second main Ceramic node used by the tests

let daemon1: CeramicDaemon // CAS1 Ceramic http server
let daemon2: CeramicDaemon // CAS2 Ceramic http server

let dbConnection1: Knex
let dbConnection2: Knex

Expand All @@ -276,7 +266,7 @@ describe('Ceramic Integration Test', () => {
beforeAll(async () => {
ipfsApiPort1 = await getPort()
ipfsApiPort2 = await getPort()
;[ipfs1, ipfs2, ipfs3, ipfs4, ipfs5, ipfs6] = await Promise.all([
;[ipfs1, ipfs2, ipfs3, ipfs4] = await Promise.all([
createIPFS(ipfsApiPort1),
createIPFS(ipfsApiPort2),
createIPFS(),
Expand All @@ -291,7 +281,7 @@ describe('Ceramic Integration Test', () => {
// await ipfsServer2.start()

// Now make sure all ipfs nodes are connected to all other ipfs nodes
const ipfsNodes = [ipfs1, ipfs2, ipfs3, ipfs4, ipfs5, ipfs6]
const ipfsNodes = [ipfs1, ipfs2, ipfs3, ipfs4]
for (const [i] of ipfsNodes.entries()) {
for (const [j] of ipfsNodes.entries()) {
if (i == j) {
Expand Down Expand Up @@ -320,8 +310,6 @@ describe('Ceramic Integration Test', () => {
ipfs2.stop(),
ipfs3.stop(),
ipfs4.stop(),
ipfs5.stop(),
ipfs6.stop(),
])
await ganacheServer.close()
await anchorLauncher.stop()
Expand Down Expand Up @@ -360,25 +348,9 @@ describe('Ceramic Integration Test', () => {
await cas2.start()
anchorService2 = cas2.container.resolve('anchorService')

// Make the Ceramic nodes that will be used by the CAS.
;[casCeramic1, casCeramic2] = await Promise.all([
makeCeramicCore(ipfs3, `http://localhost:${casPort1}`, ganacheServer.url),
makeCeramicCore(ipfs4, `http://localhost:${casPort2}`, ganacheServer.url),
])
daemon1 = new CeramicDaemon(
casCeramic1,
DaemonConfig.fromObject({ 'http-api': { port: daemonPort1 } })
)
daemon2 = new CeramicDaemon(
casCeramic1,
DaemonConfig.fromObject({ 'http-api': { port: daemonPort2 } })
)
await daemon1.listen()
await daemon2.listen()

// Finally make the Ceramic nodes that will be used in the tests.
ceramic1 = await makeCeramicCore(ipfs5, `http://localhost:${casPort1}`, ganacheServer.url)
ceramic2 = await makeCeramicCore(ipfs6, `http://localhost:${casPort2}`, ganacheServer.url)
ceramic1 = await makeCeramicCore(ipfs3, `http://localhost:${casPort1}`, ganacheServer.url)
ceramic2 = await makeCeramicCore(ipfs4, `http://localhost:${casPort2}`, ganacheServer.url)

// Speed up polling interval to speed up test
ceramic1.context.anchorService.pollInterval = 100
Expand All @@ -396,7 +368,6 @@ describe('Ceramic Integration Test', () => {
cas1.stop()
cas2.stop()
await Promise.all([dbConnection1.destroy(), dbConnection2.destroy()])
await Promise.all([daemon1.close(), daemon2.close()])
await Promise.all([
casCeramic1.close(),
casCeramic2.close(),
Expand Down

0 comments on commit cc3110f

Please sign in to comment.