Skip to content

Revision of tests that fail #136

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 77 commits into from
May 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
9f68254
BulkOperation tests improvements to work correctly
alex-kulakov Mar 15, 2021
fbd28b7
Make test work not for SQL Server but for all RDBMSs
alex-kulakov Mar 15, 2021
653b9fe
Add new error codes for UniqueConstraintViolation
alex-kulakov Mar 15, 2021
f7c4d6e
Change Chinook model based tests
alex-kulakov Mar 15, 2021
d4064aa
Fix DateTime connected tests
alex-kulakov Mar 15, 2021
a9496b8
Fix domain building for IssueJira0778
alex-kulakov Mar 15, 2021
44d7c3e
Issue0624 test improvements
alex-kulakov Mar 15, 2021
b17cce6
Fix DateTime.DayOfWeek compiler
alex-kulakov Mar 15, 2021
52482dd
Dynamically remove DefaultValue declaration
alex-kulakov Mar 16, 2021
4915a1a
Mysql: Remove some types from cast-required list
alex-kulakov Mar 16, 2021
1bb8a25
Change test name to Frank
alex-kulakov Mar 16, 2021
225c865
Change length of indexed string fields
alex-kulakov Mar 16, 2021
45af1aa
Improve DateTime resolution cut down for tests
alex-kulakov Mar 16, 2021
4668693
Switch extensions tests to Tests.Framework
alex-kulakov Mar 17, 2021
64d6f32
Correct FK extraction for SQLite
alex-kulakov Mar 17, 2021
fa64da0
Tests improvements for SQLite
alex-kulakov Mar 17, 2021
fd80137
Make test work with all RDBMSs
alex-kulakov Mar 18, 2021
86a072b
Much informative exception for unsupported types
alex-kulakov Mar 18, 2021
5cd76c2
Remove useless white spaces or tabs
alex-kulakov Mar 18, 2021
c53a0cf
Merge remote-tracking branch 'origin/6.0' into 6.0-test-fixes
alex-kulakov Mar 18, 2021
8df99b7
Make test to be applicable to all storages
alex-kulakov Mar 18, 2021
c642f05
Fix format for float and double literal values
alex-kulakov Mar 18, 2021
e437d37
RoundingTest: SQLite no Power support handled
alex-kulakov Mar 19, 2021
e175754
Make test to be up to made changes
alex-kulakov Mar 19, 2021
d654142
Copyright for file
alex-kulakov Mar 19, 2021
ce81090
Session: Remove check for incomple asyncronous operations
alex-kulakov Mar 19, 2021
c434a38
Fix accidentally broken build
alex-kulakov Mar 19, 2021
34af791
AsAsyncExtensionTest improvements
alex-kulakov Mar 19, 2021
f562e87
Change unreal check in test
alex-kulakov Mar 19, 2021
ccf3ce6
Tests improvements
alex-kulakov Mar 19, 2021
d0d3a5f
Sqlite: use string parameter with formatter instead datetime
alex-kulakov Mar 22, 2021
8c8ea56
Oracle: interval precision increse for literal values
alex-kulakov Mar 22, 2021
fc60c25
Workaround for oracle specifig begining of queries + missing requirement
alex-kulakov Mar 23, 2021
2edb542
Sqlite: increase fractions in datetime format
alex-kulakov Mar 23, 2021
3c6f503
FirstSingleTest: Separate test case for SQLite
alex-kulakov Mar 23, 2021
c2fab55
Firebird improvements
alex-kulakov Mar 24, 2021
30b9329
Workaround for firebird sequence behavior in test
alex-kulakov Mar 24, 2021
52f82f0
Firebird: Fix tests in Issues group
alex-kulakov Mar 26, 2021
e960e3b
Ignore Firebird for test
alex-kulakov Mar 26, 2021
4987eef
Fix test for some storages
alex-kulakov Mar 29, 2021
09ec311
Firebird: wierd reader behavior workaround
alex-kulakov Mar 30, 2021
e844c99
More tests fixed for Firebird
alex-kulakov Mar 30, 2021
db675ed
Less items for groupby over expression
alex-kulakov Apr 1, 2021
910f12c
Chinook-based tests: Use cached enumerables instead of query + enumer…
alex-kulakov Mar 31, 2021
c8cae25
Workaround for Firebird
alex-kulakov Apr 6, 2021
12e2de9
Some tests fixed for Postgres
alex-kulakov Apr 7, 2021
5446d60
PgSQL connection: skip commit/rollback operations when TX is already …
alex-kulakov Apr 8, 2021
4ed0c37
PrefetchTest: Exclude PostgreSQL from test storages for PrefetchSingl…
alex-kulakov Apr 9, 2021
4941021
Merge remote-tracking branch 'origin/6.0' into 6.0-test-fixes
alex-kulakov Apr 14, 2021
cc0286d
Merge branch '6.0' into 6.0-test-fixes
alex-kulakov Apr 27, 2021
b42f150
Unify test schemas
alex-kulakov Apr 28, 2021
d384205
Introduce WellKnownSchemas and WellKnownDatabases
alex-kulakov Apr 29, 2021
01c668e
Fixed incorrect database setup appeared in 'd384205'
alex-kulakov Apr 29, 2021
687d18b
Oracle v11 and newer: No schema name convertion to Upper case
alex-kulakov Apr 30, 2021
dc569c2
Oracle: Attempt to fix transaction serialization error
alex-kulakov Apr 30, 2021
e0b2103
Even more parallel transactions allowed for Oracle Tables and Indexes
alex-kulakov May 4, 2021
766d45f
Apply Oracle behavior workarounds to some tests
alex-kulakov May 4, 2021
155980f
Math Opertions: Cast to result type to get real scale for certain ope…
alex-kulakov May 4, 2021
ac97538
Move IgnoreRulesTest to Storage namespace
alex-kulakov May 4, 2021
9dfb09d
Apply workaround for Oracle lack of native Int support
alex-kulakov May 4, 2021
bd0dbfa
No multiple domain building
alex-kulakov May 4, 2021
328f039
Make some tests be compatible with Oracle
alex-kulakov May 5, 2021
93b4245
Important! Change NULLs behavior in ORDER BY clause
alex-kulakov May 5, 2021
3114ccb
Oracle now correctly handles equality operator for byte[] fields
alex-kulakov May 6, 2021
1f2f16f
Ignore test for Oracle due to lack of resolution needed
alex-kulakov May 6, 2021
59b8ba8
Oracle: simlplify some DateTimeOffset operations
alex-kulakov May 6, 2021
894ac25
Fix tests that fail on Oracle
alex-kulakov May 6, 2021
4536066
Revert some requirements
alex-kulakov May 7, 2021
632d086
Fix TimeSpan negation compiler for Oracle
alex-kulakov May 7, 2021
01b288c
Oracle is included to spectial check of test results + distinct by Bl…
alex-kulakov May 11, 2021
404615e
Merge branch '6.0' into 6.0-test-fixes
alex-kulakov May 11, 2021
f4e49cc
Oracle is excluded from test storages for test
alex-kulakov May 12, 2021
b4d8340
Reverts commit dc569c2
alex-kulakov May 12, 2021
b0ee53d
Improve changelog
alex-kulakov May 13, 2021
a80dc77
Improve changelog
alex-kulakov May 13, 2021
2bd3969
Merge branch '6.0' into 6.0-test-fixes
alex-kulakov May 17, 2021
037a542
Merge branch '6.0' into 6.0-test-fixes
alex-kulakov May 18, 2021
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
24 changes: 20 additions & 4 deletions ChangeLog/6.0.6_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,25 @@
[main] Obsolete ServerFeatures property is removed
[main] Fixed possible cases of broken serialization due to comparers
[main] Fixed rare cases of insert wrong data into some table columns for SingleTable hierarchies
[sqlserver] Fixed incorrect DateTimeOffset.Date part extraction
[sqlserver] Improved translation of DateTimeOffset.LocalDateTime and DateTimeOffset.TimeOfDay parts extraction
[main] Exception message about unsupported by storage type became more informative
[firebird] Another error code that means unique contraint violation is treated correctly
[firebird] Improved formatting for Float and Double constants within queries
[firebird] Improved work with DateTime query parameters
[firebird] Fixed columns' default value extraction
[mysql] Another error code that means unique contraint violation is treated correctly
[mysql] Fixed DateTime.DayOfWeek translation
[oracle] Changed NULLs ordering settings. Now order is the same as in .NET
[oracle] Improved resolution of TimeSpan literal values on translation
[oracle] Starting from v11 schema names don't have to be in upper-case as storage allowes names in any case
[oracle] Improved translation of Math.Ceiling(), Math.Truncate() and Math.Floor()
[oracle] Fixed byte array fields comparison translation e.g. in Where statements
[oracle] Improved translation of DateTimeOffset's LocalDateTime, ToLocalTime() and ToUniversalTime() members
[postgresql] Improved performance of First(), FirstOrDefault() being subqueries
[postgresql] Improved translation of Math.Ceiling(), Math.Truncate() and Math.Floor()
[postgresql] Improved translation of Math.Ceiling(), Math.Truncate() and Math.Floor() methods
[postgresql] Skip Commit/Rollback operations for already completed transaction to prevent exception overlaping
[sqlite] Fixed some foreign key extraction issues
[sqlite] Improved work with DateTime query parameters
[sqlserver] Fixed incorrect DateTimeOffset.Date part extraction
[sqlserver] Improved translation of DateTimeOffset's LocalDateTime and TimeOfDay members
[reprocessing] ExecuteActionStrategy.Execute doesn't get external session though Session.Current at all
[reprocessing] Introduced DomainExtension.WithSession and IExecuteConfiguration WithSession methods to pass external session
[reprocessing] Introduced DomainExtension.WithSession() and IExecuteConfiguration.WithSession() methods to pass external session
55 changes: 11 additions & 44 deletions Extensions/TestCommon/CommonModelTest.cs
Original file line number Diff line number Diff line change
@@ -1,68 +1,35 @@
// Copyright (C) 2019-2020 Xtensive LLC.
// This code is distributed under MIT license terms.
// See the License.txt file in the project root for more information.

using System.Collections.Generic;
using NUnit.Framework;
using TestCommon.Model;
using Xtensive.Core;
using Xtensive.Orm;
using Xtensive.Orm.Configuration;
using Xtensive.Orm.Tests;

namespace TestCommon
{
[TestFixture]
public abstract class CommonModelTest
public abstract class CommonModelTest : AutoBuildTest
{
private List<Session> notDisposed;

protected Domain Domain { get; private set; }
private bool justBuilt = true;

[SetUp]
public virtual void SetUp()
{
CheckRequirements();
var config = BuildConfiguration();
Domain = BuildDomain(config);
notDisposed = new List<Session>();
Domain.SessionOpen += (sender, args) => {
notDisposed.Add(args.Session);
args.Session.Events.Disposing += (o, eventArgs) => {
lock (notDisposed) {
notDisposed.Remove(args.Session);
}
};
};
PopulateData();
if (justBuilt) {
justBuilt = false;
}
else {
RebuildDomain();
}
}

[TearDown]
public virtual void TearDown()
{
if (notDisposed!=null)
Assert.That(notDisposed, Is.Empty);
Assert.That(SessionScope.CurrentSession, Is.Null);
Domain.DisposeSafely();
}

protected virtual DomainConfiguration BuildConfiguration()
protected override DomainConfiguration BuildConfiguration()
{
var configuration = DomainConfigurationFactory.Create();
var configuration = base.BuildConfiguration();
configuration.Types.Register(typeof (Bar).Assembly);
return configuration;
}

protected virtual Domain BuildDomain(DomainConfiguration configuration)
{
return Domain.Build(configuration);
}

protected virtual void PopulateData()
{
}

protected virtual void CheckRequirements()
{
}
}
}
22 changes: 0 additions & 22 deletions Extensions/TestCommon/DomainConfigurationFactory.cs

This file was deleted.

22 changes: 0 additions & 22 deletions Extensions/TestCommon/HasAccessToConfigurationTest.cs

This file was deleted.

100 changes: 0 additions & 100 deletions Extensions/TestCommon/TestConfiguration.cs

This file was deleted.

3 changes: 2 additions & 1 deletion Extensions/TestCommon/Tests/TestConfigurationTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System;
using NUnit.Framework;
using Xtensive.Orm.Tests;

namespace TestCommon.Tests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
using NUnit.Framework;
using NUnit.Framework;
using TestCommon;
using TestCommon.Model;
using Xtensive.Orm.Configuration;

namespace Xtensive.Orm.BulkOperations.Tests
{
[TestFixture]
public abstract class AutoBuildTest : CommonModelTest
public abstract class BulkOperationBaseTest : CommonModelTest
{
protected override DomainConfiguration BuildConfiguration()
{
var configuration = base.BuildConfiguration();
configuration.Types.Register(typeof (IUpdatable<>).Assembly);
configuration.Types.Register(typeof (AutoBuildTest).Assembly);
configuration.Types.Register(typeof(IUpdatable<>).Assembly);
configuration.Types.Register(typeof(BulkOperationBaseTest).Assembly);
return configuration;
}
}
Expand Down
12 changes: 7 additions & 5 deletions Extensions/Xtensive.Orm.BulkOperations.Tests/ContainsTest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020 Xtensive LLC.
// Copyright (C) 2020-2021 Xtensive LLC.
// This code is distributed under MIT license terms.
// See the License.txt file in the project root for more information.

Expand Down Expand Up @@ -29,7 +29,7 @@ public TagType(Session session, long id)

namespace Xtensive.Orm.BulkOperations.Tests
{
public class ContainsTest : AutoBuildTest
public class ContainsTest : BulkOperationBaseTest
{
private long[] tagIds;

Expand All @@ -45,8 +45,10 @@ protected override void PopulateData()
tagIds = Enumerable.Range(0, 100).Select(i => (long) i).ToArray();
using (var session = Domain.OpenSession())
using (var transaction = session.OpenTransaction()) {
foreach (var id in tagIds.Concat(Enumerable.Repeat(1000, 1).Select(i => (long) i)))
new TagType(session, id) { ProjectedValueAdjustment = -1 };
foreach (var id in tagIds.Concat(Enumerable.Repeat(1000, 1).Select(i => (long) i))) {
_ = new TagType(session, id) { ProjectedValueAdjustment = -1 };
}

transaction.Complete();
}
}
Expand Down Expand Up @@ -86,7 +88,7 @@ public void Test3()
{
using (var session = Domain.OpenSession())
using (var tx = session.OpenTransaction()) {
Assert.Throws<NotSupportedException>(() => session.Query.All<TagType>()
_ = Assert.Throws<NotSupportedException>(() => session.Query.All<TagType>()
.Where(t => t.Id.In(IncludeAlgorithm.TemporaryTable, tagIds))
.Set(t => t.ProjectedValueAdjustment, 2)
.Update());
Expand Down
2 changes: 1 addition & 1 deletion Extensions/Xtensive.Orm.BulkOperations.Tests/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public static class Extensions
{
public static void AssertCommandCount(this Session session, IResolveConstraint expression, Action action)
{
int count = 0;
var count = 0;
session.Events.DbCommandExecuting += (sender, args) => count++;
action();
Assert.That(count, expression);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@ public abstract class AbstractBaseForServiceMaterial : Entity

namespace Xtensive.Orm.BulkOperations.Tests.Issues
{
public class IssueJira0560_ChangeFieldWhichDefinedInAncestorClassBug : AutoBuildTest
public class IssueJira0560_ChangeFieldWhichDefinedInAncestorClassBug : BulkOperationBaseTest
{
[Test]
public void UpdateTest()
{
List<int> keys = new List<int>();
var keys = new List<int>();
using (var session = Domain.OpenSession())
using (session.Activate())
using (var transaction = session.OpenTransaction()) {
for (int i = 0; i < 10; i++) {
for (var i = 0; i < 10; i++) {
var owner = new PreservedService();
keys.Add(owner.Id);
new ServiceMaterial { Active = false, Owner = owner };
_ = new ServiceMaterial { Active = false, Owner = owner };
}
transaction.Complete();
}
Expand Down
Loading