Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker-compose support #279

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/Dommel.IntegrationTests/Databases/MySqlDatabaseDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class MySqlDatabaseDriver : DatabaseDriver
{
public override DbConnection GetConnection(string databaseName)
{
var connectionString = $"Server=localhost;Database={databaseName};Uid=dommeltest;Pwd=test;";
var connectionString = $"Server=localhost;Database={databaseName};Uid=root;Pwd=test;";
if (CI.IsAppVeyor)
{
connectionString = $"Server=localhost;Database={databaseName};Uid=root;Pwd=Password12!;";
Expand Down Expand Up @@ -49,4 +49,4 @@ protected override async Task<bool> CreateTables()
// No result means the tables were just created
return created == null;
}
}
}
15 changes: 11 additions & 4 deletions test/Dommel.IntegrationTests/Databases/SqlServerDatabaseDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@ public class SqlServerDatabaseDriver : DatabaseDriver
{
public override DbConnection GetConnection(string databaseName)
{
var connectionString = CI.IsAppVeyor
? $"Server=(local)\\SQL2019;Database={databaseName};User ID=sa;Password=Password12!"
: $"Server=(LocalDb)\\mssqllocaldb;Database={databaseName};User ID=dommel;Password=dommel";
var connectionString = $"Data Source=.;Initial Catalog={databaseName};Integrated Security=True;TrustServerCertificate=True";
henkmollema marked this conversation as resolved.
Show resolved Hide resolved

if (CI.IsAppVeyor)
{
connectionString = $"Server=(local)\\SQL2019;Database={databaseName};User ID=sa;Password=Password12!";
}
else if(CI.IsTravis)
{
connectionString = $"Server=(LocalDb)\\mssqllocaldb;Database={databaseName};User ID=dommel;Password=dommel";
}

return new SqlConnection(connectionString);
}
Expand Down Expand Up @@ -45,4 +52,4 @@ protected override async Task<bool> CreateTables()
// A result means the tables were just created
return created != null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ public DatabaseTestData()
Add(new MySqlDatabaseDriver());
Add(new PostgresDatabaseDriver());
}
}
}
27 changes: 27 additions & 0 deletions test/Dommel.IntegrationTests/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: "3"
services:
mysql:
image: mysql:8
container_name: mysql
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: test
MYSQL_DATABASE: test
postgres:
image: postgres:alpine
container_name: postgres
ports:
- 5432:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test
sqlserver:
image: mcr.microsoft.com/mssql/server:2019-latest
container_name: sql-server-db
ports:
- 1433:1433
environment:
ACCEPT_EULA: Y
SA_PASSWORD: "Password."