Skip to content

Add Oracle to GitHub Actions #2848

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 8 commits into from
Jul 17, 2021
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
7 changes: 7 additions & 0 deletions .github/workflows/NetCoreTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
CONNECTION_STRING: "DataSource=localhost;Database=nhibernate;User=SYSDBA;Password=nhibernate;charset=utf8;"
- DB: MySQL
CONNECTION_STRING: "Server=localhost;Uid=root;Password=nhibernate;Database=nhibernate;Old Guids=True;"
- DB: Oracle
CONNECTION_STRING: "User ID=nhibernate;Password=nhibernate;Metadata Pooling=false;Self Tuning=false;Data Source=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XEPDB1)))"
- DB: SQLite
runs-on: ubuntu-latest
continue-on-error: ${{matrix.ALLOW_FAILURE == true}}
Expand Down Expand Up @@ -45,6 +47,11 @@ jobs:
run: |
docker run --name firebird -e EnableWireCrypt=true -e FIREBIRD_USER=nhibernate -e FIREBIRD_PASSWORD=nhibernate -e ISC_PASSWORD=nhibernate -e FIREBIRD_DATABASE=nhibernate -p 3050:3050 -d jacobalberty/firebird:v3.0

- name: Set up Oracle
if: matrix.DB == 'Oracle'
run: |
docker run -d -p 1521:1521 -e APP_USER=nhibernate -e APP_USER_PASSWORD=nhibernate -e ORACLE_PASSWORD=nhibernate gvenzl/oracle-xe:18-slim

- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1.8.0
Expand Down
5 changes: 5 additions & 0 deletions psake.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ Task Set-Configuration {
'SqlServer2012' = @{
'connection.connection_string' = 'Server=(local)\SQL2017;User ID=sa;Password=Password12!;initial catalog=nhibernate;';
'dialect' = 'NHibernate.Dialect.MsSql2012Dialect'
};
'Oracle' = @{
'connection.connection_string' = 'User ID=nhibernate;Password=nhibernate;Metadata Pooling=false;Self Tuning=false;Data Source=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XEPDB1)))';
'connection.driver_class' = 'NHibernate.Driver.OracleManagedDataClientDriver';
'dialect' = 'NHibernate.Dialect.Oracle10gDialect'
}
}
#Settings for current build
Expand Down
7 changes: 5 additions & 2 deletions src/NHibernate.Test/Async/NHSpecificTest/NH1171/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ public class FixtureAsync : BugTestCase
{
protected override bool AppliesTo(Dialect.Dialect dialect)
{
// Firebird has issues with comments containing apostrophes
return !(dialect is FirebirdDialect);
return
// Firebird has issues with comments containing apostrophes
!(dialect is FirebirdDialect)
// GH-2853: Oracle client bug: throws Oracle.ManagedDataAccess.Client.OracleException : ORA-01008: not all variables bound
&& !(dialect is Oracle8iDialect);
}

protected override void Configure(NHibernate.Cfg.Configuration configuration)
Expand Down
4 changes: 2 additions & 2 deletions src/NHibernate.Test/Async/NHSpecificTest/NH1693/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public async Task without_filterAsync()
using (var tx = session.BeginTransaction())
{
var q1 =
"from Invoice i where i.Mode='a' and i.Category=:cat and not exists (from Invoice i2 where i2.Mode='a' and i2.Category=:cat and i2.Num=i.Num+1)";
"from Invoice i where i.Mode='a' and i.Category=:cat and not exists (from Invoice i2 where i2.Mode='a' and i2.Category=:cat and i2.Num=i.Num+1) order by i.Num";
var list = await (session.CreateQuery(q1)
.SetParameter("cat", 10)
.ListAsync<Invoice>());
Expand All @@ -70,7 +70,7 @@ public async Task with_filterAsync()
session.EnableFilter("modeFilter").SetParameter("currentMode", "a");

var q1 =
"from Invoice i where i.Category=:cat and not exists (from Invoice i2 where i2.Category=:cat and i2.Num=i.Num+1)";
"from Invoice i where i.Category=:cat and not exists (from Invoice i2 where i2.Category=:cat and i2.Num=i.Num+1) order by i.Num";
var list = await (session.CreateQuery(q1)
.SetParameter("cat", 10)
.ListAsync<Invoice>());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ public async Task WhenConfiguredOnlyExplicitAutoQuoteAsync()
// Test uses the default dialect driver, which will not accept Odbc or OleDb connection strings.
if (typeof(OdbcDriver).IsAssignableFrom(driverClass) || typeof(OleDbDriver).IsAssignableFrom(driverClass))
Assert.Ignore("Test is not compatible with OleDb or ODBC driver connection strings");
var configuredDialect = Dialect.Dialect.GetDialect();
var configuredDialect = Dialect.Dialect.GetDialect(configuration.Properties);
if(!configuredDialect.DefaultProperties.ContainsKey(Environment.ConnectionDriver))
{
Assert.Ignore(GetType() + " does not apply to " + configuredDialect);
Expand Down
7 changes: 5 additions & 2 deletions src/NHibernate.Test/NHSpecificTest/NH1171/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ public class Fixture : BugTestCase
{
protected override bool AppliesTo(Dialect.Dialect dialect)
{
// Firebird has issues with comments containing apostrophes
return !(dialect is FirebirdDialect);
return
// Firebird has issues with comments containing apostrophes
!(dialect is FirebirdDialect)
// GH-2853: Oracle client bug: throws Oracle.ManagedDataAccess.Client.OracleException : ORA-01008: not all variables bound
&& !(dialect is Oracle8iDialect);
}

protected override void Configure(NHibernate.Cfg.Configuration configuration)
Expand Down
4 changes: 2 additions & 2 deletions src/NHibernate.Test/NHSpecificTest/NH1693/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void without_filter()
using (var tx = session.BeginTransaction())
{
var q1 =
"from Invoice i where i.Mode='a' and i.Category=:cat and not exists (from Invoice i2 where i2.Mode='a' and i2.Category=:cat and i2.Num=i.Num+1)";
"from Invoice i where i.Mode='a' and i.Category=:cat and not exists (from Invoice i2 where i2.Mode='a' and i2.Category=:cat and i2.Num=i.Num+1) order by i.Num";
var list = session.CreateQuery(q1)
.SetParameter("cat", 10)
.List<Invoice>();
Expand All @@ -59,7 +59,7 @@ public void with_filter()
session.EnableFilter("modeFilter").SetParameter("currentMode", "a");

var q1 =
"from Invoice i where i.Category=:cat and not exists (from Invoice i2 where i2.Category=:cat and i2.Num=i.Num+1)";
"from Invoice i where i.Category=:cat and not exists (from Invoice i2 where i2.Category=:cat and i2.Num=i.Num+1) order by i.Num";
var list = session.CreateQuery(q1)
.SetParameter("cat", 10)
.List<Invoice>();
Expand Down
3 changes: 2 additions & 1 deletion src/NHibernate.Test/NHibernate.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,13 @@
<Reference Include="System.Threading.Tasks" />
<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="Oracle.ManagedDataAccess" Version="19.11.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='netcoreapp2.0'">
<PackageReference Include="System.CodeDom" Version="4.7.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.2" />
<PackageReference Include="System.Data.OracleClient" Version="1.0.8" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="2.19.110" />
<PackageReference Include="System.Data.Odbc" Version="4.7.0" />
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
<PackageReference Include="NUnitLite" Version="3.13.2" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public void WhenConfiguredOnlyExplicitAutoQuote()
// Test uses the default dialect driver, which will not accept Odbc or OleDb connection strings.
if (typeof(OdbcDriver).IsAssignableFrom(driverClass) || typeof(OleDbDriver).IsAssignableFrom(driverClass))
Assert.Ignore("Test is not compatible with OleDb or ODBC driver connection strings");
var configuredDialect = Dialect.Dialect.GetDialect();
var configuredDialect = Dialect.Dialect.GetDialect(configuration.Properties);
if(!configuredDialect.DefaultProperties.ContainsKey(Environment.ConnectionDriver))
{
Assert.Ignore(GetType() + " does not apply to " + configuredDialect);
Expand Down