From 9cf06d3a15f0af8193cbfd91fceb5708d2a8d742 Mon Sep 17 00:00:00 2001 From: mjc Date: Tue, 27 Aug 2024 10:04:14 -0500 Subject: [PATCH] Adding SSLMode None for MySQL in CI tests --- src/DapperMatic/Models/Table.cs | 2 +- .../DapperMatic.Tests/ProviderTests/MySqlDatabaseTests.cs | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/DapperMatic/Models/Table.cs b/src/DapperMatic/Models/Table.cs index 0f385f0..5a9b891 100644 --- a/src/DapperMatic/Models/Table.cs +++ b/src/DapperMatic/Models/Table.cs @@ -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; } = []; diff --git a/tests/DapperMatic.Tests/ProviderTests/MySqlDatabaseTests.cs b/tests/DapperMatic.Tests/ProviderTests/MySqlDatabaseTests.cs index 8885c32..430229c 100644 --- a/tests/DapperMatic.Tests/ProviderTests/MySqlDatabaseTests.cs +++ b/tests/DapperMatic.Tests/ProviderTests/MySqlDatabaseTests.cs @@ -51,7 +51,13 @@ ITestOutputHelper output { public override async Task 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; }