Skip to content

Run tests for SQLite on .NET Core #1823

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

Merged
merged 2 commits into from
Oct 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:
- DB=PostgreSQL CONNECTION_STRING="Host=localhost;Port=5432;Username=postgres;Database=nhibernate;Enlist=true;"
- DB=Firebird
- DB=MySQL CONNECTION_STRING="Server=127.0.0.1;Uid=root;Database=nhibernate;Old Guids=True;"
- DB=SQLite
matrix:
allow_failures:
- env: DB=MySQL CONNECTION_STRING="Server=127.0.0.1;Uid=root;Database=nhibernate;Old Guids=True;"
Expand Down
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ environment:
- DB: Firebird
- DB: MySQL
CONNECTION_STRING: Server=127.0.0.1;Uid=root;Pwd=Password12!;Database=nhibernate;Old Guids=True;
- DB: SQLite
init:
# Required for having windows endlines in sources zip
- git config --global core.autocrlf true
Expand Down Expand Up @@ -54,6 +55,7 @@ before_test:
}
'SqlServer2008' { Start-Service 'MSSQL$SQL2017' }
'SqlServer2012' { Start-Service 'MSSQL$SQL2017' }
'SQLite' { }
}
test_script:
- cmd: powershell -noprofile -command "& ./build.ps1 -TaskList Set-Configuration,Test -properties @{\"Database\" = \"%DB%\";\"ConnectionString\"=\"%CONNECTION_STRING%\"}"
Expand Down
14 changes: 4 additions & 10 deletions src/NHibernate.Test/NHibernate.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<TargetFrameworks>$(NhAppTargetFrameworks)</TargetFrameworks>
<IsTestProject>true</IsTestProject>
<NoWarn>$(NoWarn);3001;3002;3003;3005</NoWarn>
<ContentSQLiteInteropFiles>true</ContentSQLiteInteropFiles>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
<DefineConstants>NETFX;$(DefineConstants)</DefineConstants>
Expand Down Expand Up @@ -48,6 +49,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="log4net" Version="2.0.8" />
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.109.2" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.0.8" />
<PackageReference Include="NSubstitute" Version="3.1.0" />
<PackageReference Include="NUnit" Version="3.10.1" />
Expand All @@ -64,14 +66,13 @@
<Reference Include="System.Data.OracleClient" />
<PackageReference Include="Microsoft.SqlServer.Compact" Version="4.0.8876.1" />
<PackageReference Include="Oracle.ManagedDataAccess" Version="12.1.2400" />
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.106" />
<PackageReference Include="MySql.Data" Version="6.9.11" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='netcoreapp2.0'">
<PackageReference Include="System.CodeDom" Version="4.4.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.4.2" />
<PackageReference Include="System.Data.OracleClient" Version="1.0.8" />
<PackageReference Include="System.Data.Odbc" Version="4.5.0-preview1-25914-04" />
<PackageReference Include="System.Data.Odbc" Version="4.5.0" />

This comment was marked as resolved.

<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
<PackageReference Include="NUnitLite" Version="3.10.1" />
<PackageReference Include="MySql.Data" Version="6.10.6" />
Expand All @@ -83,18 +84,11 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup Condition=" '$(NuGetPackageRoot)' != '' ">
<NativeBinaries Include="$(NuGetPackageRoot)system.data.sqlite.core\1.0.105.2\build\net46\**\*.*" />
<Content Include="@(NativeBinaries)">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NHibernate.DomainModel\NHibernate.DomainModel.csproj" />
<ProjectReference Include="..\NHibernate\NHibernate.csproj" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>
</Project>
6 changes: 2 additions & 4 deletions src/NHibernate.TestDatabaseSetup/TestDatabaseSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
using System.Data.SqlClient;
#if NETFX
using System.Data.SqlServerCe;
using System.Data.SQLite;
#endif
using System.Data.SQLite;
using System.IO;
using FirebirdSql.Data.FirebirdClient;
using NHibernate.Test;
Expand All @@ -28,8 +28,8 @@ public class DatabaseSetup
{"NHibernate.Driver.OracleClientDriver", SetupOracle},
{"NHibernate.Driver.OracleManagedDataClientDriver", SetupOracle},
{"NHibernate.Driver.OdbcDriver", SetupSqlServerOdbc},
#if NETFX
{"NHibernate.Driver.SQLite20Driver", SetupSQLite},
#if NETFX
{"NHibernate.Driver.SqlServerCeDriver", SetupSqlServerCe}
#endif
};
Expand Down Expand Up @@ -190,7 +190,6 @@ RETURNS uuid
}
}

#if NETFX
private static void SetupSQLite(Cfg.Configuration cfg)
{
var connStr = cfg.Properties[Cfg.Environment.ConnectionString];
Expand All @@ -207,7 +206,6 @@ private static void SetupSQLite(Cfg.Configuration cfg)
Console.WriteLine(e);
}
}
#endif

private static void SetupOracle(Cfg.Configuration cfg)
{
Expand Down
1 change: 1 addition & 0 deletions src/NHibernate/Dialect/SQLiteDialect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ protected virtual void RegisterFunctions()
"memo",
"money",
"note",
"nothing",
"notnull",
"ntext",
"nvarchar",
Expand Down