Skip to content

Commit

Permalink
Prepare RTM (#1297)
Browse files Browse the repository at this point in the history
* Remove Preview from workflows

* Update NSB references to 9.0.0

* Remove Guard

* Code cleanup

* Change to ArgumentOutOfRangeException

* Remove purge on startup for transport tests

* Bump to preview SqlClient

* Move token and circuit breaker initialization to StartReceive

* Tweaks

---------

Co-authored-by: Brandon Ording <[email protected]>
  • Loading branch information
kentdr and bording authored Feb 29, 2024
1 parent 089a511 commit 7054177
Show file tree
Hide file tree
Showing 53 changed files with 109 additions and 299 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
uses: actions/[email protected]
with:
dotnet-version: 8.0.x
dotnet-quality: 'preview'
- name: Build
run: dotnet build src --configuration Release
- name: Upload packages
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
uses: actions/[email protected]
with:
dotnet-version: 8.0.x
dotnet-quality: 'preview'
- name: Build
run: dotnet build src --configuration Release
- name: Sign NuGet packages
Expand Down
Empty file removed nugets/.gitkeep
Empty file.
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
using System;
#if SYSTEMDATASQLCLIENT
using System.Data.SqlClient;
#else
using Microsoft.Data.SqlClient;
#endif
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Data.SqlClient;
using NServiceBus;
using NServiceBus.AcceptanceTesting.Support;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
namespace NServiceBus.Transport.SqlServer.AcceptanceTests.MultiCatalog
{
using System;
#if SYSTEMDATASQLCLIENT
using System.Data.SqlClient;
#else
using Microsoft.Data.SqlClient;
#endif
using NServiceBus.AcceptanceTests;

public class MultiCatalogAcceptanceTest : NServiceBusAcceptanceTest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
namespace NServiceBus.Transport.SqlServer.AcceptanceTests.MultiCatalog
{
#if SYSTEMDATASQLCLIENT
using System.Data.SqlClient;
#else
using Microsoft.Data.SqlClient;
#endif
using System;
using System.Threading.Tasks;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Data.SqlClient;

public static class SqlUtilities
{
public static Task<bool> CheckIfTableExists(string catalogName, string schemaName, string tableName, SqlConnection connection, CancellationToken cancellationToken = default)
{
Guard.AgainstNull("catalogName", catalogName);
Guard.AgainstNull("schemaName", schemaName);
Guard.AgainstNull("tableName", tableName);
Guard.AgainstNull("connection", connection);
ArgumentNullException.ThrowIfNull(catalogName);
ArgumentNullException.ThrowIfNull(schemaName);
ArgumentNullException.ThrowIfNull(tableName);
ArgumentNullException.ThrowIfNull(connection);

return RunCommand(connection, async (command, token) =>
{
Expand All @@ -31,10 +27,10 @@ public static Task<bool> CheckIfTableExists(string catalogName, string schemaNam

public static Task DropTable(string catalogName, string schemaName, string tableName, SqlConnection connection, CancellationToken cancellationToken = default)
{
Guard.AgainstNull("catalogName", catalogName);
Guard.AgainstNull("schemaName", schemaName);
Guard.AgainstNull("tableName", tableName);
Guard.AgainstNull("connection", connection);
ArgumentNullException.ThrowIfNull(catalogName);
ArgumentNullException.ThrowIfNull(schemaName);
ArgumentNullException.ThrowIfNull(tableName);
ArgumentNullException.ThrowIfNull(connection);

return RunCommand(connection, async (command, token) =>
{
Expand All @@ -49,8 +45,8 @@ public static Task DropTable(string catalogName, string schemaName, string table

static async Task<T> RunCommand<T>(SqlConnection connection, Func<SqlCommand, CancellationToken, Task<T>> action, CancellationToken cancellationToken)
{
Guard.AgainstNull("connetion", connection);
Guard.AgainstNull("action", action);
ArgumentNullException.ThrowIfNull(connection);
ArgumentNullException.ThrowIfNull(action);

bool weOpenedTheConnection = false;

Expand All @@ -62,10 +58,9 @@ static async Task<T> RunCommand<T>(SqlConnection connection, Func<SqlCommand, Ca
weOpenedTheConnection = true;
}

using (var command = connection.CreateCommand())
{
return await action(command, cancellationToken);
}
using var command = connection.CreateCommand();

return await action(command, cancellationToken);
}
finally
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
namespace NServiceBus.Transport.SqlServer.AcceptanceTests.MultiCatalog
{
#if SYSTEMDATASQLCLIENT
using System.Data.SqlClient;
#else
using Microsoft.Data.SqlClient;
#endif
using System.Threading.Tasks;
using AcceptanceTesting;
using Microsoft.Data.SqlClient;
using NServiceBus.AcceptanceTests.EndpointTemplates;
using NUnit.Framework;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="9.0.0-alpha.9" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="9.0.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
using System.Collections.Generic;
using System.Data.Common;
using System.Threading.Tasks;
#if SYSTEMDATASQLCLIENT
using System.Data.SqlClient;
#else
using Microsoft.Data.SqlClient;
#endif
using NServiceBus.AcceptanceTesting;
using NServiceBus.AcceptanceTesting.Customization;
using NServiceBus.AcceptanceTests;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
namespace NServiceBus.Transport.SqlServer.AcceptanceTests.TimeToBeReceived
{
using System;
#if SYSTEMDATASQLCLIENT
using System.Data.SqlClient;
#else
using Microsoft.Data.SqlClient;
#endif
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.Customization;
using Configuration.AdvancedExtensibility;
using Microsoft.Data.SqlClient;
using NServiceBus.AcceptanceTests;
using NServiceBus.AcceptanceTests.EndpointTemplates;
using NUnit.Framework;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@
{
using System;
using System.Data;
#if SYSTEMDATASQLCLIENT
using System.Data.SqlClient;
#else
using Microsoft.Data.SqlClient;
#endif
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.Customization;
using Logging;
using Microsoft.Data.SqlClient;
using NServiceBus.AcceptanceTests;
using NServiceBus.AcceptanceTests.EndpointTemplates;
using NUnit.Framework;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
namespace NServiceBus.Transport.SqlServer.AcceptanceTests
{
using System;
#if SYSTEMDATASQLCLIENT
using System.Data.SqlClient;
#else
using Microsoft.Data.SqlClient;
#endif
using System.Threading.Tasks;
using System.Transactions;
using AcceptanceTesting;
using Microsoft.Data.SqlClient;
using NServiceBus.AcceptanceTests;
using NServiceBus.AcceptanceTests.EndpointTemplates;
using NUnit.Framework;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
namespace NServiceBus.Transport.SqlServer.AcceptanceTests
{
using System;
#if SYSTEMDATASQLCLIENT
using System.Data.SqlClient;
#else
using Microsoft.Data.SqlClient;
#endif
using System.Threading.Tasks;
using System.Transactions;
using AcceptanceTesting;
using Microsoft.Data.SqlClient;
using NServiceBus.AcceptanceTests;
using NServiceBus.AcceptanceTests.EndpointTemplates;
using NUnit.Framework;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
namespace NServiceBus.Transport.SqlServer.AcceptanceTests
{
using System;
#if SYSTEMDATASQLCLIENT
using System.Data.SqlClient;
#else
using Microsoft.Data.SqlClient;
#endif
using System.Threading.Tasks;
using System.Transactions;
using AcceptanceTesting;
using Microsoft.Data.SqlClient;
using NServiceBus.AcceptanceTests;
using NServiceBus.AcceptanceTests.EndpointTemplates;
using NUnit.Framework;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
namespace NServiceBus.Transport.SqlServer.AcceptanceTests
{
using System;
#if SYSTEMDATASQLCLIENT
using System.Data.SqlClient;
#else
using Microsoft.Data.SqlClient;
#endif
using System.Threading.Tasks;
using AcceptanceTesting;
using Microsoft.Data.SqlClient;
using NServiceBus.AcceptanceTests;
using NServiceBus.AcceptanceTests.EndpointTemplates;
using NUnit.Framework;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
namespace NServiceBus.Transport.SqlServer.AcceptanceTests
{
using System;
#if SYSTEMDATASQLCLIENT
using System.Data.SqlClient;
#else
using Microsoft.Data.SqlClient;
#endif
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.Customization;
using Microsoft.Data.SqlClient;
using NServiceBus.AcceptanceTests;
using NUnit.Framework;

Expand All @@ -17,9 +13,6 @@ public class When_using_column_encrypted_connection : NServiceBusAcceptanceTest
[Test]
public async Task Should_work()
{
#if SYSTEMDATASQLCLIENT && NET
Assert.Ignore("System.Data.SqlClient doesn't support this setting on .NET (works on .NET Framework)");
#endif
var ctx = await Scenario.Define<Context>()
.WithEndpoint<Endpoint>(b => b.When((bus, c) => bus.SendLocal(new Message())))
.Done(c => c.MessageReceived)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
namespace NServiceBus.Transport.SqlServer.AcceptanceTests
{
using System;
#if SYSTEMDATASQLCLIENT
using System.Data.SqlClient;
#else
using Microsoft.Data.SqlClient;
#endif
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.Customization;
using Microsoft.Data.SqlClient;
using NServiceBus.AcceptanceTests;
using NUnit.Framework;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NServiceBus" Version="9.0.0-alpha.9" />
<PackageReference Include="NServiceBus" Version="9.0.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@
{
using System;
using System.Collections.Generic;
#if SYSTEMDATASQLCLIENT
using System.Data.SqlClient;
#else
using Microsoft.Data.SqlClient;
#endif
using System.Threading;
using System.Threading.Tasks;
using Extensibility;
using Microsoft.Data.SqlClient;
using NUnit.Framework;
using Routing;
using Transport;
using SqlServer;
using Transport;
using Unicast.Queuing;
using System.Threading;

public class When_dispatching_messages
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@
{
using System;
using System.Linq;
#if SYSTEMDATASQLCLIENT
using System.Data.SqlClient;
#else
using Microsoft.Data.SqlClient;
#endif
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Data.SqlClient;
using NUnit.Framework;
using Transport;
using SqlServer;
using Transport;

public class When_receiving_messages
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@
{
using System;
using System.Collections.Generic;
#if SYSTEMDATASQLCLIENT
using System.Data.SqlClient;
#else
using Microsoft.Data.SqlClient;
#endif
using System.Threading;
using System.Threading.Tasks;
using Extensibility;
using Microsoft.Data.SqlClient;
using NUnit.Framework;
using Routing;
using Transport;
using SqlServer;
using System.Threading;
using Transport;

public class When_recoverable_column_is_removed
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
using System;
using System.Threading;
#if SYSTEMDATASQLCLIENT
using System.Data.SqlClient;
#else
using Microsoft.Data.SqlClient;
#endif
using System.Threading.Tasks;
using Microsoft.Data.SqlClient;
using NServiceBus;
using NServiceBus.Transport;
using NServiceBus.TransportTests;
Expand Down Expand Up @@ -41,7 +37,7 @@ public async Task<TransportInfrastructure> Configure(TransportDefinition transpo
"mainReceiver",
queueAddress,
transportDefinition.SupportsPublishSubscribe,
true,
false,
errorQueueName)
};

Expand Down
Loading

0 comments on commit 7054177

Please sign in to comment.