diff --git a/Kyoo.Tests/Dockerfile b/Kyoo.Tests/Dockerfile new file mode 100644 index 00000000..423bfe57 --- /dev/null +++ b/Kyoo.Tests/Dockerfile @@ -0,0 +1,3 @@ +FROM mcr.microsoft.com/dotnet/sdk:5.0 +COPY ../ . +RUN dotnet tests '-p:SkipWebApp=true;SkipTranscoder=true' diff --git a/Kyoo.Tests/Library/TestContext.cs b/Kyoo.Tests/Library/TestContext.cs index 61332a8d..68f27012 100644 --- a/Kyoo.Tests/Library/TestContext.cs +++ b/Kyoo.Tests/Library/TestContext.cs @@ -126,7 +126,11 @@ namespace Kyoo.Tests public static string GetConnectionString(string database) { - return $"Server=127.0.0.1;Port=5432;Database={database};User ID=kyoo;Password=kyooPassword;Include Error Detail=true"; + string server = Environment.GetEnvironmentVariable("SERVER") ?? "127.0.0.1"; + string port = Environment.GetEnvironmentVariable("PORT") ?? "5432"; + string username = Environment.GetEnvironmentVariable("USERNAME") ?? "kyoo"; + string password = Environment.GetEnvironmentVariable("PASSWORD") ?? "kyooPassword"; + return $"Server={server};Port={port};Database={database};User ID={username};Password={password};Include Error Detail=true"; } public override void Dispose()