Faster builds + use MySqlConnector

MySql.Data is a travesty at this point - moving to something more stable. Really we weren't testing Dapper with previous test failures, we were testing what mood MySql.Data and NuGet extraction are in and which phase of the moon is about.

Also speeds up the builds with 1 restore and 1 build. We can simplify here because everything is relevant (no wasted builds).
This commit is contained in:
Nick Craver
2018-09-03 21:38:27 -04:00
parent ba16b54b4f
commit 522d150e25
5 changed files with 14 additions and 20 deletions
@@ -18,7 +18,7 @@
<ProjectReference Include="..\Dapper.SqlBuilder\Dapper.SqlBuilder.csproj" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="1.1.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="MySql.Data" Version="7.0.7-m61" />
<PackageReference Include="MySqlConnector" Version="0.44.1" />
<PackageReference Include="System.Data.SqlClient" Version="4.4.0" />
<PackageReference Include="xunit" Version="$(xUnitVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(xUnitVersion)" />
+4 -7
View File
@@ -37,7 +37,7 @@ namespace Dapper.Tests.Contrib
using (var connection = new SqlConnection(ConnectionString))
{
// ReSharper disable once AccessToDisposedClosure
Action<string> dropTable = name => connection.Execute($"IF OBJECT_ID('{name}', 'U') IS NOT NULL DROP TABLE [{name}]; ");
void dropTable(string name) => connection.Execute($"IF OBJECT_ID('{name}', 'U') IS NOT NULL DROP TABLE [{name}]; ");
connection.Open();
dropTable("Stuff");
connection.Execute("CREATE TABLE Stuff (TheId int IDENTITY(1,1) not null, Name nvarchar(100) not null, Created DateTime null);");
@@ -65,12 +65,10 @@ namespace Dapper.Tests.Contrib
public class MySqlServerTestSuite : TestSuite
{
private const string DbName = "DapperContribTests";
public static string ConnectionString { get; } =
IsAppVeyor
? "Server=localhost;Uid=root;Pwd=Password12!;"
: "Server=localhost;Uid=test;Pwd=pass;";
? "Server=localhost;Database=test;Uid=root;Pwd=Password12!;UseAffectedRows=false;"
: "Server=localhost;Database=tests;Uid=test;Pwd=pass;UseAffectedRows=false;";
public override IDbConnection GetConnection()
{
@@ -87,9 +85,8 @@ namespace Dapper.Tests.Contrib
using (var connection = new MySqlConnection(ConnectionString))
{
// ReSharper disable once AccessToDisposedClosure
Action<string> dropTable = name => connection.Execute($"DROP TABLE IF EXISTS `{name}`;");
void dropTable(string name) => connection.Execute($"DROP TABLE IF EXISTS `{name}`;");
connection.Open();
connection.Execute($"DROP DATABASE IF EXISTS {DbName}; CREATE DATABASE {DbName}; USE {DbName};");
dropTable("Stuff");
connection.Execute("CREATE TABLE Stuff (TheId int not null AUTO_INCREMENT PRIMARY KEY, Name nvarchar(100) not null, Created DateTime null);");
dropTable("People");
@@ -19,9 +19,8 @@
<PackageReference Include="FirebirdSql.Data.FirebirdClient" Version="5.9.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="1.1.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.2" />
<PackageReference Include="Microsoft.SqlServer.Compact" Version="4.0.8876.1" />
<PackageReference Include="Microsoft.SqlServer.Types" Version="14.0.314.76" />
<PackageReference Include="MySql.Data" Version="7.0.7-m61" />
<PackageReference Include="MySqlConnector" Version="0.44.1" />
<PackageReference Include="NHibernate" Version="4.1.1.4000" />
<PackageReference Include="Iesi.Collections" Version="4.0.2" />
<PackageReference Include="Npgsql" Version="3.2.5" />
@@ -46,6 +45,6 @@
<Compile Update="Benchmarks.*.cs" DependentUpon="Benchmarks.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="SourceLink.Create.GitHub" Version="2.1.2" />
<PackageReference Update="SourceLink.Create.GitHub" Version="2.8.3" />
</ItemGroup>
</Project>
+1 -1
View File
@@ -21,7 +21,7 @@
<ProjectReference Include="..\Dapper.Contrib\Dapper.Contrib.csproj" />
<PackageReference Include="FirebirdSql.Data.FirebirdClient" Version="5.9.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="MySql.Data" Version="8.0.8-dmr" />
<PackageReference Include="MySqlConnector" Version="0.44.1" />
<PackageReference Include="Npgsql" Version="3.2.5" />
<PackageReference Include="System.Data.SqlClient" Version="4.4.0" />
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
+6 -8
View File
@@ -29,17 +29,15 @@ if ($PullRequestNumber) {
$CreatePackages = $false
}
Write-Host "Building projects..." -ForegroundColor "Magenta"
foreach ($project in $projectsToBuild + $testsToRun) {
Write-Host "Building $project (dotnet restore/build)..." -ForegroundColor "Magenta"
dotnet restore ".\$project\$project.csproj" /p:CI=true
dotnet build ".\$project\$project.csproj" -c Release /p:CI=true
Write-Host ""
}
Write-Host "Restoring all projects..." -ForegroundColor "Magenta"
dotnet restore
Write-Host "Done restoring." -ForegroundColor "Green"
Write-Host "Building all projects..." -ForegroundColor "Magenta"
dotnet build -c Release --no-restore /p:CI=true
Write-Host "Done building." -ForegroundColor "Green"
if ($RunTests) {
dotnet restore /ConsoleLoggerParameters:Verbosity=Quiet
foreach ($project in $testsToRun) {
Write-Host "Running tests: $project (all frameworks)" -ForegroundColor "Magenta"
Push-Location ".\$project"