Skip to content

Commit ff4c41d

Browse files
committed
Test env
1 parent 8e84685 commit ff4c41d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/TestBuildingBlocks/IntegrationTestContext.cs

+9
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ protected override HttpClient CreateClient()
6464

6565
private WebApplicationFactory<TStartup> CreateFactory()
6666
{
67+
var password = Environment.GetEnvironmentVariable("PGPASSWORD");
68+
69+
if (password != null)
70+
{
71+
throw password == string.Empty
72+
? new InvalidOperationException("PGPASSWORD value is empty string.")
73+
: new InvalidOperationException($"PGPASSWORD = '{password}'");
74+
}
75+
6776
string dbConnectionString = $"Host=localhost;Database=JsonApiTest-{Guid.NewGuid():N};User ID=postgres;Password=postgres;Include Error Detail=true";
6877

6978
var factory = new IntegrationTestWebApplicationFactory();

0 commit comments

Comments
 (0)