From cc3110f2432ea738011a8e6552cd7856a04c365d Mon Sep 17 00:00:00 2001 From: Spencer T Brody Date: Thu, 22 Feb 2024 09:28:07 -0500 Subject: [PATCH] chore: Remove unused Ceramic nodes from test --- src/__tests__/ceramic_integration.test.ts | 41 ++++------------------- 1 file changed, 6 insertions(+), 35 deletions(-) diff --git a/src/__tests__/ceramic_integration.test.ts b/src/__tests__/ceramic_integration.test.ts index c11f44a20..17dc7d2f4 100644 --- a/src/__tests__/ceramic_integration.test.ts +++ b/src/__tests__/ceramic_integration.test.ts @@ -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 @@ -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(), @@ -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) { @@ -320,8 +310,6 @@ describe('Ceramic Integration Test', () => { ipfs2.stop(), ipfs3.stop(), ipfs4.stop(), - ipfs5.stop(), - ipfs6.stop(), ]) await ganacheServer.close() await anchorLauncher.stop() @@ -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 @@ -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(),