mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-08 10:44:20 -04:00
Loading the test context from environement variables
This commit is contained in:
parent
fdb6386462
commit
5b0ebf39ee
3
Kyoo.Tests/Dockerfile
Normal file
3
Kyoo.Tests/Dockerfile
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
FROM mcr.microsoft.com/dotnet/sdk:5.0
|
||||||
|
COPY ../ .
|
||||||
|
RUN dotnet tests '-p:SkipWebApp=true;SkipTranscoder=true'
|
@ -126,7 +126,11 @@ namespace Kyoo.Tests
|
|||||||
|
|
||||||
public static string GetConnectionString(string database)
|
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()
|
public override void Dispose()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user