From 3c7be7d9027e370a0de8c398061b8847ec7bce4b Mon Sep 17 00:00:00 2001 From: Darren Kelly Date: Tue, 17 Dec 2024 12:11:27 +0000 Subject: [PATCH] chore(test): make thor version configurable --- test/helpers/compose/docker-compose.yaml | 2 ++ test/helpers/compose/testContainer.ts | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/test/helpers/compose/docker-compose.yaml b/test/helpers/compose/docker-compose.yaml index 085e545..eabd17e 100644 --- a/test/helpers/compose/docker-compose.yaml +++ b/test/helpers/compose/docker-compose.yaml @@ -3,6 +3,8 @@ services: container_name: rosetta build: context: ../../.. + args: + - THOR_VERSION=${THOR_VERSION:-v2.1.4} ports: - "8080:8080" - "8669:8669" diff --git a/test/helpers/compose/testContainer.ts b/test/helpers/compose/testContainer.ts index 8ba03ab..428ca79 100644 --- a/test/helpers/compose/testContainer.ts +++ b/test/helpers/compose/testContainer.ts @@ -9,8 +9,15 @@ const composeFilePath = path.join(__dirname); const composeFile = "docker-compose.yaml"; export function dockerCompose(): Promise { - return new DockerComposeEnvironment(composeFilePath, composeFile) + const compose = new DockerComposeEnvironment(composeFilePath, composeFile) .withWaitStrategy("rosetta", Wait.forLogMessage("http://localhost:8669")) .withBuild() - .up(); + + if (process.env["THOR_VERSION"]){ + compose.withEnvironment({ + THOR_VERSION: process.env["THOR_VERSION"] + }) + } + + return compose.up(); }