-
-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #431 from phnx47/ci-services
improve infra for unit tests
- Loading branch information
Showing
12 changed files
with
79 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
TEST_DB_PASS=Password12! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.IO; | ||
|
||
namespace Repositories.Base; | ||
|
||
public static class DotEnv | ||
{ | ||
private const string _fileName = ".env"; | ||
|
||
static DotEnv() | ||
{ | ||
if (!File.Exists(_fileName)) | ||
return; | ||
|
||
foreach (var line in File.ReadAllLines(_fileName)) | ||
{ | ||
var parts = line.Split( | ||
'=', | ||
StringSplitOptions.RemoveEmptyEntries); | ||
|
||
if (parts.Length != 2) | ||
continue; | ||
|
||
Environment.SetEnvironmentVariable(parts[0].Trim(), parts[1].Trim()); | ||
} | ||
} | ||
|
||
public static string GetTestDbPass() => Environment.GetEnvironmentVariable("TEST_DB_PASS"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,26 @@ | ||
services: | ||
mysql: | ||
image: mysql:8.0-debian | ||
environment: | ||
MYSQL_ROOT_PASSWORD: ${TEST_DB_PASS} | ||
ports: | ||
- "3306:3306" | ||
restart: always | ||
environment: | ||
MYSQL_ROOT_PASSWORD: "Password12!" | ||
|
||
mssql: | ||
image: mcr.microsoft.com/mssql/server:2022-latest | ||
environment: | ||
ACCEPT_EULA: "Y" | ||
SA_PASSWORD: "Password12!" | ||
SA_PASSWORD: ${TEST_DB_PASS} | ||
ports: | ||
- "1433:1433" | ||
restart: always | ||
|
||
oracle: | ||
image: gvenzl/oracle-xe:21-slim-faststart | ||
environment: | ||
ORACLE_PASSWORD: ${TEST_DB_PASS} | ||
ports: | ||
- "1521:1521" | ||
restart: always | ||
environment: | ||
ORACLE_PASSWORD: "Password12!" | ||
|
||
postgres: | ||
image: postgres:17.2-alpine | ||
ports: | ||
- "5432:5432" | ||
restart: always | ||
environment: | ||
POSTGRES_PASSWORD: "Password12!" | ||
POSTGRES_PASSWORD: ${TEST_DB_PASS} |