Skip to content

Commit

Permalink
Prepare for RTM (#1253)
Browse files Browse the repository at this point in the history
* Prepare for RTM

* Set serializer

* Set serializer

* Tweaks

* Fix approval file name

---------

Co-authored-by: Brandon Ording <[email protected]>
  • Loading branch information
andreasohlund and bording authored Mar 6, 2024
1 parent 07f09b5 commit b60467c
Show file tree
Hide file tree
Showing 22 changed files with 67 additions and 76 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ jobs:
uses: actions/[email protected]
with:
dotnet-version: 8.0.x
dotnet-quality: 'preview'
- name: Build
run: dotnet build src --configuration Release
- name: Azure login
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
<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.5" GeneratePathProperty="true" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="9.0.0" GeneratePathProperty="true" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="RavenDB.Client" Version="5.4.110" />
<PackageReference Include="RavenDB.Client" Version="5.4.116" />
</ItemGroup>

<ItemGroup Condition="'$(PkgNServiceBus_AcceptanceTests_Sources)' != ''">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@
<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.5" GeneratePathProperty="true" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="9.0.0" GeneratePathProperty="true" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="RavenDB.Client" Version="5.4.110" />
<PackageReference Include="RavenDB.Client" Version="5.4.116" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\NServiceBus.RavenDB.AcceptanceTests\**\*.cs" Exclude="**\obj\**" />
<Compile Remove="..\NServiceBus.RavenDB.AcceptanceTests\When_storing_saga_with_high_contention.cs" />
<Compile Remove="..\NServiceBus.RavenDB.AcceptanceTests\ConfigureEndpointRavenDBPersistence.cs" />
<Compile Remove="..\NServiceBus.RavenDB.AcceptanceTests\TestSuiteConstraints.cs" />
</ItemGroup>

<ItemGroup Condition="'$(PkgNServiceBus_AcceptanceTests_Sources)' != ''">
Expand All @@ -45,10 +48,4 @@
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\Versioning\*.*" />
</ItemGroup>

<ItemGroup>
<Compile Remove="..\NServiceBus.RavenDB.AcceptanceTests\When_storing_saga_with_high_contention.cs" />
<Compile Remove="..\NServiceBus.RavenDB.AcceptanceTests\ConfigureEndpointRavenDBPersistence.cs" />
<Compile Remove="..\NServiceBus.RavenDB.AcceptanceTests\TestSuiteConstraints.cs" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,16 @@
<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.5" />
<PackageReference Include="NServiceBus" Version="9.0.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Particular.Approvals" Version="0.6.0" />
<PackageReference Include="Particular.Approvals" Version="1.0.0" />
<PackageReference Include="PublicApiGenerator" Version="11.1.0" />
<PackageReference Include="RavenDB.Client" Version="5.4.110" />
<PackageReference Include="RavenDB.Client" Version="5.4.116" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\NServiceBus.RavenDB.Tests\**\*.cs" Exclude="**\obj\**" />
</ItemGroup>

<ItemGroup>
<Compile Remove="..\NServiceBus.RavenDB.Tests\API\*.cs" />
<Compile Remove="..\NServiceBus.RavenDB.Tests\ReusableDbConfig.cs" />
<Compile Remove="..\NServiceBus.RavenDB.Tests\TestConstants.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@
<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.5" GeneratePathProperty="true" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="9.0.0" GeneratePathProperty="true" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="RavenDB.Client" Version="5.4.110" />
<PackageReference Include="RavenDB.Client" Version="5.4.116" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\NServiceBus.RavenDB.AcceptanceTests\**\*.cs" Exclude="**\obj\**" />
<!-- The high contention test is only relevant for pessimistic concurrency control -->
<Compile Remove="..\NServiceBus.RavenDB.AcceptanceTests\When_storing_saga_with_high_contention.cs" />
<Compile Remove="..\NServiceBus.RavenDB.AcceptanceTests\ConfigureEndpointRavenDBPersistence.cs" />
<Compile Remove="..\NServiceBus.RavenDB.AcceptanceTests\TestSuiteConstraints.cs" />
</ItemGroup>

<ItemGroup Condition="'$(PkgNServiceBus_AcceptanceTests_Sources)' != ''">
Expand All @@ -45,11 +49,4 @@
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\Versioning\*.*" />
</ItemGroup>

<ItemGroup>
<!-- The high contention test is only relevant for pessimistic concurrency control -->
<Compile Remove="..\NServiceBus.RavenDB.AcceptanceTests\When_storing_saga_with_high_contention.cs" />
<Compile Remove="..\NServiceBus.RavenDB.AcceptanceTests\ConfigureEndpointRavenDBPersistence.cs" />
<Compile Remove="..\NServiceBus.RavenDB.AcceptanceTests\TestSuiteConstraints.cs" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@
<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.5" GeneratePathProperty="true" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="9.0.0" GeneratePathProperty="true" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="RavenDB.Client" Version="5.4.110" />
<PackageReference Include="RavenDB.Client" Version="5.4.116" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\NServiceBus.RavenDB.AcceptanceTests\**\*.cs" Exclude="**\obj\**" />
<!-- The high contention test is only relevant for pessimistic concurrency control -->
<Compile Remove="..\NServiceBus.RavenDB.AcceptanceTests\When_storing_saga_with_high_contention.cs" />
<Compile Remove="..\NServiceBus.RavenDB.AcceptanceTests\ConfigureEndpointRavenDBPersistence.cs" />
<Compile Remove="..\NServiceBus.RavenDB.AcceptanceTests\TestSuiteConstraints.cs" />
</ItemGroup>

<ItemGroup Condition="'$(PkgNServiceBus_AcceptanceTests_Sources)' != ''">
Expand All @@ -45,11 +49,4 @@
<Compile Remove="$(PkgNServiceBus_AcceptanceTests_Sources)\**\Versioning\*.*" />
</ItemGroup>

<ItemGroup>
<!-- The high contention test is only relevant for pessimistic concurrency control -->
<Compile Remove="..\NServiceBus.RavenDB.AcceptanceTests\When_storing_saga_with_high_contention.cs" />
<Compile Remove="..\NServiceBus.RavenDB.AcceptanceTests\ConfigureEndpointRavenDBPersistence.cs" />
<Compile Remove="..\NServiceBus.RavenDB.AcceptanceTests\TestSuiteConstraints.cs" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NServiceBus.PersistenceTests.Sources" Version="9.0.0-alpha.5" GeneratePathProperty="true" />
<PackageReference Include="NServiceBus.PersistenceTests.Sources" Version="9.0.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="RavenDB.Client" Version="5.4.110" />
<PackageReference Include="RavenDB.Client" Version="5.4.116" />
</ItemGroup>

</Project>
3 changes: 1 addition & 2 deletions src/NServiceBus.RavenDB.Tests/API/OutboxApprovals.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
using System;
using System.Collections.Generic;
using NServiceBus.RavenDB.Outbox;
using NUnit.Framework;
using Particular.Approvals;

[TestFixture]
public class OutboxAprovals
public class OutboxApprovals
{
[Test]
public void ApproveOutboxSchema()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
<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.5" />
<PackageReference Include="NServiceBus" Version="9.0.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Particular.Approvals" Version="0.6.0" />
<PackageReference Include="Particular.Approvals" Version="1.0.0" />
<PackageReference Include="PublicApiGenerator" Version="11.1.0" />
<PackageReference Include="RavenDB.Client" Version="5.4.110" />
<PackageReference Include="RavenDB.Client" Version="5.4.116" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public void Should_not_resolve_until_start()
transport.TransportTransactionMode = TransportTransactionMode.ReceiveOnly;
endpointConfiguration.UseTransport(transport);
endpointConfiguration.EnableOutbox();
endpointConfiguration.UseSerialization<SystemJsonSerializer>();

endpointConfiguration.UsePersistence<RavenDBPersistence>()
.SetDefaultDocumentStore((_, __) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,26 @@ namespace NServiceBus.TransactionalSession.AcceptanceTests

public class TransactionSessionDefaultServer : IEndpointSetupTemplate
{
public virtual async Task<EndpointConfiguration> GetConfiguration(RunDescriptor runDescriptor, EndpointCustomizationConfiguration endpointConfiguration,
public virtual async Task<EndpointConfiguration> GetConfiguration(RunDescriptor runDescriptor, EndpointCustomizationConfiguration endpointCustomization,
Func<EndpointConfiguration, Task> configurationBuilderCustomization)
{
var builder = new EndpointConfiguration(endpointConfiguration.EndpointName);
builder.EnableInstallers();
var endpointConfiguration = new EndpointConfiguration(endpointCustomization.EndpointName);

builder.Recoverability()
endpointConfiguration.EnableInstallers();
endpointConfiguration.UseSerialization<SystemJsonSerializer>();
endpointConfiguration.Recoverability()
.Delayed(delayed => delayed.NumberOfRetries(0))
.Immediate(immediate => immediate.NumberOfRetries(0));
builder.SendFailedMessagesTo("error");
endpointConfiguration.SendFailedMessagesTo("error");

var storageDir = Path.Combine(Path.GetTempPath(), "learn", TestContext.CurrentContext.Test.ID);

builder.UseTransport(new AcceptanceTestingTransport
endpointConfiguration.UseTransport(new AcceptanceTestingTransport
{
StorageLocation = storageDir
});

var persistence = builder.UsePersistence<RavenDBPersistence>();
var persistence = endpointConfiguration.UsePersistence<RavenDBPersistence>();
persistence.EnableTransactionalSession();
persistence.SetDefaultDocumentStore(SetupFixture.DocumentStore);
persistence.SetMessageToDatabaseMappingConvention(headers =>
Expand All @@ -41,14 +42,14 @@ public virtual async Task<EndpointConfiguration> GetConfiguration(RunDescriptor
return SetupFixture.DefaultDatabaseName;
});

builder.RegisterStartupTask(sp => new CaptureServiceProviderStartupTask(sp, runDescriptor.ScenarioContext));
endpointConfiguration.RegisterStartupTask(sp => new CaptureServiceProviderStartupTask(sp, runDescriptor.ScenarioContext));

await configurationBuilderCustomization(builder).ConfigureAwait(false);
await configurationBuilderCustomization(endpointConfiguration).ConfigureAwait(false);

// scan types at the end so that all types used by the configuration have been loaded into the AppDomain
builder.TypesToIncludeInScan(endpointConfiguration.GetTypesScopedByTestClass());
endpointConfiguration.TypesToIncludeInScan(endpointCustomization.GetTypesScopedByTestClass());

return builder;
return endpointConfiguration;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,17 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\NServiceBus.RavenDB\NServiceBus.RavenDB.csproj" />
<ProjectReference Include="..\NServiceBus.RavenDB.TransactionalSession\NServiceBus.RavenDB.TransactionalSession.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NServiceBus.AcceptanceTesting" Version="9.0.0-alpha.5" />
<PackageReference Include="NServiceBus.TransactionalSession" Version="3.0.0-alpha.1" />
<PackageReference Include="NServiceBus.AcceptanceTesting" Version="9.0.0" />
<PackageReference Include="NServiceBus.TransactionalSession" Version="3.0.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="RavenDB.Client" Version="5.4.110" />
<PackageReference Include="RavenDB.Client" Version="5.4.116" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
<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.5" />
<PackageReference Include="NServiceBus.TransactionalSession" Version="3.0.0-alpha.1" />
<PackageReference Include="NServiceBus" Version="9.0.0" />
<PackageReference Include="NServiceBus.TransactionalSession" Version="3.0.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Particular.Approvals" Version="0.6.0" />
<PackageReference Include="Particular.Approvals" Version="1.0.0" />
<PackageReference Include="PublicApiGenerator" Version="11.1.0" />
<PackageReference Include="RavenDB.Client" Version="5.4.110" />
<PackageReference Include="RavenDB.Client" Version="5.4.116" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>NServiceBus.TransactionalSession</RootNamespace>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\NServiceBus.snk</AssemblyOriginatorKeyFile>
<Description>Transactional Session for the RavenDB persistence.</Description>
<Description>Transactional Session for the RavenDB persistence</Description>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\NServiceBus.RavenDB\NServiceBus.RavenDB.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="NServiceBus.TransactionalSession" Version="3.0.0-alpha.1" />
<PackageReference Include="NServiceBus.TransactionalSession" Version="[3.0.0, 4.0.0)" />
<PackageReference Include="Particular.Packaging" Version="4.0.0" PrivateAssets="All" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public sealed class RavenDbOpenSessionOptions : OpenSessionOptions
/// <param name="multiTenantConnectionContext">The connection context when multi-tenancy is used.</param>
public RavenDbOpenSessionOptions(IDictionary<string, string> multiTenantConnectionContext = null)
{
var headers = multiTenantConnectionContext != null ? new Dictionary<string, string>(multiTenantConnectionContext) : new Dictionary<string, string>(0);
var headers = multiTenantConnectionContext != null ? new Dictionary<string, string>(multiTenantConnectionContext) : [];

// order matters because instantiating IncomingMessage is modifying the headers
foreach (var header in headers)
Expand Down
8 changes: 5 additions & 3 deletions src/NServiceBus.RavenDB.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NServiceBus.RavenDB.Accepta
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CB700990-944C-4B38-9ABF-D00EC464A5E2}"
ProjectSection(SolutionItems) = preProject
..\.github\workflows\ci.yml = ..\.github\workflows\ci.yml
Custom.Build.props = Custom.Build.props
..\.github\workflows\release.yml = ..\.github\workflows\release.yml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NServiceBus.RavenDB.Optimistic.AcceptanceTests", "NServiceBus.RavenDB.Optimistic.AcceptanceTests\NServiceBus.RavenDB.Optimistic.AcceptanceTests.csproj", "{57785D1B-193C-4B59-86C2-F8E1E6B50A0E}"
Expand All @@ -28,11 +30,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AcceptanceTests", "Acceptan
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EverythingButAcceptanceTests", "EverythingButAcceptanceTests", "{B1AD16CA-050B-4BE6-A25E-DB00A067DE26}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.RavenDB.TransactionalSession", "NServiceBus.RavenDB.TransactionalSession\NServiceBus.RavenDB.TransactionalSession.csproj", "{825E3D62-7AF0-42C6-91F6-A4908FC1BFA6}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NServiceBus.RavenDB.TransactionalSession", "NServiceBus.RavenDB.TransactionalSession\NServiceBus.RavenDB.TransactionalSession.csproj", "{825E3D62-7AF0-42C6-91F6-A4908FC1BFA6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.RavenDB.TransactionalSession.Tests", "NServiceBus.RavenDB.TransactionalSession.Tests\NServiceBus.RavenDB.TransactionalSession.Tests.csproj", "{1E6A7363-BD51-4D54-9A9A-5522F98678F0}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NServiceBus.RavenDB.TransactionalSession.Tests", "NServiceBus.RavenDB.TransactionalSession.Tests\NServiceBus.RavenDB.TransactionalSession.Tests.csproj", "{1E6A7363-BD51-4D54-9A9A-5522F98678F0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.RavenDB.TransactionalSession.AcceptanceTests", "NServiceBus.RavenDB.TransactionalSession.AcceptanceTests\NServiceBus.RavenDB.TransactionalSession.AcceptanceTests.csproj", "{03083C28-E0FA-4B05-BB09-B6D96EC05F74}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NServiceBus.RavenDB.TransactionalSession.AcceptanceTests", "NServiceBus.RavenDB.TransactionalSession.AcceptanceTests\NServiceBus.RavenDB.TransactionalSession.AcceptanceTests.csproj", "{03083C28-E0FA-4B05-BB09-B6D96EC05F74}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
2 changes: 1 addition & 1 deletion src/NServiceBus.RavenDB/Internal/DocumentStoreManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ internal static DocumentStoreInitializer GetUninitializedDocumentStore<TStorageT
// First try to get a document store specific to a storage type (Subscriptions, Gateway, etc.)
var docStoreInitializer = settings.GetOrDefault<DocumentStoreInitializer>(featureSettingsKeys[typeof(TStorageType)]);

// Next try finding a shared DocumentStore
// Next try finding a shared DocumentStore
docStoreInitializer ??= settings.GetOrDefault<DocumentStoreInitializer>(defaultDocStoreSettingsKey);

if (docStoreInitializer == null)
Expand Down
Loading

0 comments on commit b60467c

Please sign in to comment.