Skip to content

Commit

Permalink
add .net 7 for test pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
Mimetis committed Nov 30, 2022
1 parent 36f481f commit 4520998
Show file tree
Hide file tree
Showing 7 changed files with 990 additions and 980 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,6 @@ public async Task<ClientSyncChanges> GetEstimatedChangesCountAsync(ScopeInfoClie
// get rows inserted / updated elsewhere since the sync is not over
(context, clientTimestamp) = await this.InternalGetLocalTimestampAsync(context, runner.Connection, runner.Transaction, runner.CancellationToken, runner.Progress).ConfigureAwait(false);

var ts = await this.GetLocalTimestampAsync();
Console.WriteLine($"SYNC TS InternalGetChangesAsync InternalGetLocalTimestampAsync:{ts}");
Debug.WriteLine($"SYNC TS InternalGetChangesAsync InternalGetLocalTimestampAsync:{ts}");

// Create a batch info
string info = connection != null && !string.IsNullOrEmpty(connection.Database) ? $"{connection.Database}_LOCAL_GETCHANGES" : "LOCAL_GETCHANGES";
var clientBatchInfo = new BatchInfo(this.Options.BatchDirectory, info: info);
Expand All @@ -223,10 +219,6 @@ public async Task<ClientSyncChanges> GetEstimatedChangesCountAsync(ScopeInfoClie
clientChangesSelected = await this.InternalGetChangesAsync(cScopeInfo,
context, cScopeInfoClient.IsNewScope, cScopeInfoClient.LastSyncTimestamp, clientTimestamp, remoteScopeId, this.Provider.SupportsMultipleActiveResultSets, clientBatchInfo,
runner.Connection, runner.Transaction, runner.CancellationToken, runner.Progress).ConfigureAwait(false);

ts = await this.GetLocalTimestampAsync();
Console.WriteLine($"SYNC TS InternalGetChangesAsync InternalGetChangesAsync:{ts}");
Debug.WriteLine($"SYNC TS InternalGetChangesAsync InternalGetChangesAsync:{ts}");
}

var databaseChangesSelectedArgs = new DatabaseChangesSelectedArgs(context, cScopeInfoClient.LastSyncTimestamp, clientTimestamp,
Expand Down
29 changes: 0 additions & 29 deletions Projects/Dotmim.Sync.Core/SyncAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,26 +279,14 @@ public async Task<SyncResult> SynchronizeAsync(string scopeName, SyncSetup setup
ScopeInfo cScopeInfo;
(context, cScopeInfo) = await this.LocalOrchestrator.InternalEnsureScopeInfoAsync(context, default, default, cancellationToken, progress).ConfigureAwait(false);

var ts = await this.LocalOrchestrator.GetLocalTimestampAsync();
Console.WriteLine($"SYNC TS:{ts}");
Debug.WriteLine($"SYNC TS:{ts}");

ScopeInfoClient cScopeInfoClient;
(context, cScopeInfoClient) = await this.LocalOrchestrator.InternalEnsureScopeInfoClientAsync(context, default, default, cancellationToken, progress).ConfigureAwait(false);

ts = await this.LocalOrchestrator.GetLocalTimestampAsync();
Console.WriteLine($"SYNC TS InternalEnsureScopeInfoClientAsync:{ts}");
Debug.WriteLine($"SYNC TS InternalEnsureScopeInfoClientAsync:{ts}");

// Check if we have a problem with the SyncSetup local and the one coming from server
// Let a chance to the user to update the local setup accordingly to the server one
isConflicting = false;
(context, isConflicting, cScopeInfo, sScopeInfo) = await this.LocalOrchestrator.InternalIsConflictingSetupAsync(context, setup, cScopeInfo, sScopeInfo).ConfigureAwait(false);

ts = await this.LocalOrchestrator.GetLocalTimestampAsync();
Console.WriteLine($"SYNC TS InternalIsConflictingSetupAsync:{ts}");
Debug.WriteLine($"SYNC TS InternalIsConflictingSetupAsync:{ts}");

if (isConflicting)
{
context.ProgressPercentage = 1;
Expand Down Expand Up @@ -382,10 +370,6 @@ public async Task<SyncResult> SynchronizeAsync(string scopeName, SyncSetup setup
(context, cScopeInfo) = await this.LocalOrchestrator.InternalProvisionClientAsync(sScopeInfo, cScopeInfo, context, provision, false, default, default, cancellationToken, progress).ConfigureAwait(false);
}

ts = await this.LocalOrchestrator.GetLocalTimestampAsync();
Console.WriteLine($"SYNC TS InternalProvisionClientAsync:{ts}");
Debug.WriteLine($"SYNC TS InternalProvisionClientAsync:{ts}");

setup ??= cScopeInfo.Setup;

if (cancellationToken.IsCancellationRequested)
Expand All @@ -409,10 +393,6 @@ public async Task<SyncResult> SynchronizeAsync(string scopeName, SyncSetup setup
(context, clientSyncChanges) = await this.LocalOrchestrator.InternalGetChangesAsync(cScopeInfo, context, cScopeInfoClient,
default, default, cancellationToken, progress).ConfigureAwait(false);

ts = await this.LocalOrchestrator.GetLocalTimestampAsync();
Console.WriteLine($"SYNC TS InternalGetChangesAsync:{ts}");
Debug.WriteLine($"SYNC TS InternalGetChangesAsync:{ts}");

if (cancellationToken.IsCancellationRequested)
cancellationToken.ThrowIfCancellationRequested();

Expand Down Expand Up @@ -465,10 +445,6 @@ await this.RemoteOrchestrator.InternalApplyThenGetChangesAsync(
cScopeInfo, cScopeInfoClient, context, serverSyncChanges, clientSyncChanges, reverseConflictResolutionPolicy, snapshotApplied, default, default,
cancellationToken, progress).ConfigureAwait(false);

ts = await this.LocalOrchestrator.GetLocalTimestampAsync();
Console.WriteLine($"SYNC TS InternalApplyChangesAsync:{ts}");
Debug.WriteLine($"SYNC TS InternalApplyChangesAsync:{ts}");

completeTime = DateTime.UtcNow;
this.LocalOrchestrator.CompleteTime = completeTime;
this.RemoteOrchestrator.CompleteTime = completeTime;
Expand Down Expand Up @@ -524,11 +500,6 @@ await this.RemoteOrchestrator.InternalApplyThenGetChangesAsync(
{
context = await this.LocalOrchestrator.InternalEndSessionAsync(context, result, clientSyncChanges, syncException, cancellationToken, progress).ConfigureAwait(false);
context = await this.RemoteOrchestrator.InternalEndSessionAsync(context, result, serverSyncChanges, syncException, cancellationToken, progress).ConfigureAwait(false);

var ts = await this.LocalOrchestrator.GetLocalTimestampAsync();
Console.WriteLine($"SYNC TS InternalEndSessionAsync:{ts}");
Debug.WriteLine($"SYNC TS InternalEndSessionAsync:{ts}");

}
catch { }

Expand Down
8 changes: 4 additions & 4 deletions Tests/Dotmim.Sync.Tests/Dotmim.Sync.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@

<!--Until POMELO has not upgraded to .net 7, we still need to use 6-->
<ItemGroup Condition=" '$(TargetFramework)' == '$(TargetFrameworkNet7)'">
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0" />
<!--<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.0" />-->
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.1" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.2" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0-alpha.1" />
</ItemGroup>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace Dotmim.Sync.Tests.IntegrationTests
public class SqlServerHttpTests : HttpTests
{
public override List<ProviderType> ClientsType => new List<ProviderType>
{ ProviderType.Sql};
{ ProviderType.Sql, ProviderType.MySql, ProviderType.Sqlite, ProviderType.MariaDB};


public SqlServerHttpTests(HelperProvider fixture, ITestOutputHelper output) : base(fixture, output)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace Dotmim.Sync.Tests.IntegrationTests
public class SqlServerTcpConflictsTests : TcpConflictsTests
{
public override List<ProviderType> ClientsType => new List<ProviderType>
{ ProviderType.Sql,ProviderType.Sqlite};
{ ProviderType.Sql, ProviderType.MySql, ProviderType.Sqlite, ProviderType.MariaDB};

public SqlServerTcpConflictsTests(HelperProvider fixture, ITestOutputHelper output) : base(fixture, output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace Dotmim.Sync.Tests.IntegrationTests
public class SqlServerTcpTests : TcpTests
{
public override List<ProviderType> ClientsType => new List<ProviderType>
{ ProviderType.Sqlite };
{ ProviderType.Sql, ProviderType.MySql, ProviderType.Sqlite, ProviderType.MariaDB};

public SqlServerTcpTests(HelperProvider fixture, ITestOutputHelper output) : base(fixture, output)
{
Expand Down
Loading

0 comments on commit 4520998

Please sign in to comment.