Skip to content

Commit

Permalink
Adding SSLMode None for MySQL in CI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjcowan committed Aug 27, 2024
1 parent 0955225 commit 9cf06d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/DapperMatic/Models/Table.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public Table(string name, string? schema)
}

public string Name { get; set; }
public string? Schema { get; set; }
public string? Schema { get; set; }
public PrimaryKey? PrimaryKey { get; set; }
public Column[] Columns { get; set; } = [];
public UniqueConstraint[] UniqueConstraints { get; set; } = [];
Expand Down
8 changes: 7 additions & 1 deletion tests/DapperMatic.Tests/ProviderTests/MySqlDatabaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ ITestOutputHelper output
{
public override async Task<IDbConnection> OpenConnectionAsync()
{
var connection = new MySqlConnection(fixture.ConnectionString);
var connectionString = fixture.ConnectionString;
// Disable SSL for local testing and CI environments
if (!connectionString.Contains("SSL Mode", StringComparison.OrdinalIgnoreCase))
{
connectionString += ";SSL Mode=None";
}
var connection = new MySqlConnection(connectionString);
await connection.OpenAsync();
return connection;
}
Expand Down

0 comments on commit 9cf06d3

Please sign in to comment.