diff --git a/.circleci/run-tests.sh b/.circleci/run-tests.sh index ba34c262b..f31cc6674 100755 --- a/.circleci/run-tests.sh +++ b/.circleci/run-tests.sh @@ -3,7 +3,7 @@ set -e cd ../BTCPayServer.Tests docker-compose -v -docker-compose down --v -docker-compose pull -docker-compose build -docker-compose run -e "TEST_FILTERS=$1" tests +docker-compose -f "docker-compose.altcoins.yml" down --v +docker-compose -f "docker-compose.altcoins.yml" pull +docker-compose -f "docker-compose.altcoins.yml" build +docker-compose -f "docker-compose.altcoins.yml" run -e "TEST_FILTERS=$1" tests diff --git a/BTCPayServer.Tests/AltcoinTests/AltcoinTests.cs b/BTCPayServer.Tests/AltcoinTests/AltcoinTests.cs index 5b84bd9c2..8d4cc2769 100644 --- a/BTCPayServer.Tests/AltcoinTests/AltcoinTests.cs +++ b/BTCPayServer.Tests/AltcoinTests/AltcoinTests.cs @@ -61,6 +61,11 @@ namespace BTCPayServer.Tests public class AltcoinTests { public const int TestTimeout = 60_000; + public AltcoinTests(ITestOutputHelper helper) + { + Logs.Tester = new XUnitLog(helper) { Name = "Tests" }; + Logs.LogProvider = new XUnitLogProvider(helper); + } [Fact] [Trait("Integration", "Integration")] diff --git a/BTCPayServer.Tests/Dockerfile b/BTCPayServer.Tests/Dockerfile index ea37b47b6..436a25906 100644 --- a/BTCPayServer.Tests/Dockerfile +++ b/BTCPayServer.Tests/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/core/sdk:3.1.101 AS builder +FROM mcr.microsoft.com/dotnet/core/sdk:3.1.202 AS builder RUN apt-get update && apt-get install -y --no-install-recommends chromium-driver \ && rm -rf /var/lib/apt/lists/* @@ -21,6 +21,9 @@ ENV SCREEN_HEIGHT 600 \ SCREEN_WIDTH 1200 COPY . . -RUN cd BTCPayServer.Tests && dotnet build /p:CI_TESTS=true /p:RazorCompileOnBuild=true + +ARG CONFIGURATION_NAME=Release +RUN cd BTCPayServer.Tests && dotnet build --configuration ${CONFIGURATION_NAME} /p:CI_TESTS=true /p:RazorCompileOnBuild=true WORKDIR /source/BTCPayServer.Tests +ENV CONFIGURATION_NAME=${CONFIGURATION_NAME} ENTRYPOINT ["./docker-entrypoint.sh"] diff --git a/BTCPayServer.Tests/docker-compose.altcoins.yml b/BTCPayServer.Tests/docker-compose.altcoins.yml index dd9986bbf..326b1e9f2 100644 --- a/BTCPayServer.Tests/docker-compose.altcoins.yml +++ b/BTCPayServer.Tests/docker-compose.altcoins.yml @@ -9,6 +9,8 @@ services: build: context: .. dockerfile: BTCPayServer.Tests/Dockerfile + args: + CONFIGURATION_NAME: Altcoins-Release environment: TESTS_BTCRPCCONNECTION: server=http://bitcoind:43782;ceiwHEbqWI83:DwubwWsoo3 TESTS_LTCRPCCONNECTION: server=http://litecoind:43782;ceiwHEbqWI83:DwubwWsoo3 diff --git a/BTCPayServer.Tests/docker-compose.yml b/BTCPayServer.Tests/docker-compose.yml index 0c93189bb..41304de96 100644 --- a/BTCPayServer.Tests/docker-compose.yml +++ b/BTCPayServer.Tests/docker-compose.yml @@ -9,6 +9,8 @@ services: build: context: .. dockerfile: BTCPayServer.Tests/Dockerfile + args: + CONFIGURATION_NAME: Release environment: TESTS_BTCRPCCONNECTION: server=http://bitcoind:43782;ceiwHEbqWI83:DwubwWsoo3 TESTS_BTCNBXPLORERURL: http://nbxplorer:32838/ diff --git a/BTCPayServer.Tests/docker-entrypoint.sh b/BTCPayServer.Tests/docker-entrypoint.sh index 5f11b488c..a73e5f7be 100755 --- a/BTCPayServer.Tests/docker-entrypoint.sh +++ b/BTCPayServer.Tests/docker-entrypoint.sh @@ -6,4 +6,4 @@ if [ ! -z "$TEST_FILTERS" ]; then FILTERS="--filter $TEST_FILTERS" fi -dotnet test $FILTERS --no-build -v n < /dev/null +dotnet test -c ${CONFIGURATION_NAME} $FILTERS --no-build -v n < /dev/null