From d80eb8d9f7b4c45773c87050edba526331890816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20Holm=20Gj=C3=B8rup?= Date: Mon, 23 Sep 2024 10:44:26 +0200 Subject: [PATCH] Fix CI issue caused by docker-compose not being available --- .github/workflows/ci.yml | 10 +++++++--- backend/Tests/TestUtilities/DatabaseFixture.cs | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f12eb76c..4f34d5798 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,12 +21,16 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: 6.0.x - + - name: Restore dependencies run: dotnet restore ./backend/CcScan.Backend.sln - + - name: Build run: dotnet build ./backend/CcScan.Backend.sln -c Release --no-restore - name: Test - run: dotnet test ./backend/CcScan.Backend.sln --filter Category!=IntegrationTests -c Release --no-build --verbosity normal + run: | + # Tests depend on docker-compose being available due to this issue https://github.com/mariotoffia/FluentDocker/issues/312. + # The soft linking should be remove when a fix is released. + ln -s /usr/libexec/docker/cli-plugins/docker-compose /usr/local/bin/docker-compose + dotnet test ./backend/CcScan.Backend.sln --filter Category!=IntegrationTests -c Release --no-build --verbosity normal diff --git a/backend/Tests/TestUtilities/DatabaseFixture.cs b/backend/Tests/TestUtilities/DatabaseFixture.cs index 9ace61304..0403e4212 100644 --- a/backend/Tests/TestUtilities/DatabaseFixture.cs +++ b/backend/Tests/TestUtilities/DatabaseFixture.cs @@ -3,6 +3,7 @@ using Application.Api.GraphQL.EfCore; using Application.Database; using Dapper; +using Ductus.FluentDocker.Model.Compose; using Ductus.FluentDocker.Builders; using Ductus.FluentDocker.Services; using Microsoft.EntityFrameworkCore; @@ -32,6 +33,7 @@ public DatabaseFixture() _service = new Builder() .UseContainer() .UseCompose() + .AssumeComposeVersion(ComposeVersion.V2) .FromFile(file) .RemoveOrphans() .WaitForPort("timescaledb-test", "5432/tcp", 30_000)