Skip to content
Draft
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
5 changes: 5 additions & 0 deletions src/Particular.LicensingComponent.UnitTests/NUnitSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
using NUnit.Framework;

[assembly: FixtureLifeCycle(LifeCycle.InstancePerTestCase)]
[assembly: Parallelizable(ParallelScope.All)]
[assembly: LevelOfParallelism(4)]
5 changes: 5 additions & 0 deletions src/ServiceControl.AcceptanceTests.RavenDB/NUnitSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
using NUnit.Framework;

[assembly: FixtureLifeCycle(LifeCycle.InstancePerTestCase)]
[assembly: Parallelizable(ParallelScope.All)]
[assembly: LevelOfParallelism(4)]
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@
using NUnit.Framework;
using ServiceControl.MessageFailures;
using ServiceControl.Recoverability;
using TestSupport;

/// <summary>
/// This test gets run first and serially, this is to allow the non-threadsafe onetime setup to
/// happen without lifting it into a setup fixture.
/// </summary>
[Order(1)]
[NonParallelizable]
class When_a_failed_message_is_retried : AcceptanceTest
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using ServiceControl.Operations;

[TestFixture]
[NonParallelizable]
class When_a_critical_error_is_triggered : AcceptanceTest
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace ServiceControl.AcceptanceTests.Security.Cors
/// When AllowAnyOrigin is true (default for backwards compatibility), requests from any origin should be allowed.
/// The Access-Control-Allow-Origin header should be "*".
/// </summary>
[NonParallelizable]
class When_cors_allows_any_origin : AcceptanceTest
{
CorsTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace ServiceControl.AcceptanceTests.Security.Cors
/// When AllowAnyOrigin is false and no AllowedOrigins are configured, CORS is effectively disabled.
/// No Access-Control-Allow-Origin header should be returned for any origin.
/// </summary>
[NonParallelizable]
class When_cors_is_disabled : AcceptanceTest
{
CorsTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace ServiceControl.AcceptanceTests.Security.Cors
/// When a request comes from an origin that is in the AllowedOrigins list,
/// the response should include the Access-Control-Allow-Origin header with that specific origin.
/// </summary>
[NonParallelizable]
class When_request_from_allowed_origin : AcceptanceTest
{
CorsTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace ServiceControl.AcceptanceTests.Security.Cors
/// When a request comes from an origin that is NOT in the AllowedOrigins list,
/// the response should NOT include an Access-Control-Allow-Origin header that matches the request origin.
/// </summary>
[NonParallelizable]
class When_request_from_disallowed_origin : AcceptanceTest
{
CorsTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace ServiceControl.AcceptanceTests.Security.ForwardedHeaders
/// Forwarded Headers Disabled
/// When forwarded headers processing is disabled, headers should be ignored regardless of trust.
/// </summary>
[NonParallelizable]
class When_forwarded_headers_are_disabled : AcceptanceTest
{
ForwardedHeadersTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace ServiceControl.AcceptanceTests.Security.ForwardedHeaders
/// Default Behavior with Headers
/// When forwarded headers are sent and TrustAllProxies is true (default), headers should be applied.
/// </summary>
[NonParallelizable]
class When_forwarded_headers_are_sent : AcceptanceTest
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace ServiceControl.AcceptanceTests.Security.ForwardedHeaders
/// Known Networks (CIDR)
/// When KnownNetworks are configured and the caller IP falls within, headers should be applied.
/// </summary>
[NonParallelizable]
class When_known_networks_are_configured : AcceptanceTest
{
ForwardedHeadersTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace ServiceControl.AcceptanceTests.Security.ForwardedHeaders
/// Known Proxies Only
/// When KnownProxies are configured and the caller IP matches, headers should be applied.
/// </summary>
[NonParallelizable]
class When_known_proxies_are_configured : AcceptanceTest
{
ForwardedHeadersTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace ServiceControl.AcceptanceTests.Security.ForwardedHeaders
/// When TrustAllProxies is true and headers contain multiple values (proxy chain),
/// the original (leftmost) values should be returned.
/// </summary>
[NonParallelizable]
class When_multiple_header_values_are_sent : AcceptanceTest
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace ServiceControl.AcceptanceTests.Security.ForwardedHeaders
/// When TrustAllProxies=false (known proxies configured), ForwardLimit=1,
/// so only the rightmost values are processed.
/// </summary>
[NonParallelizable]
class When_multiple_header_values_are_sent_with_known_proxies : AcceptanceTest
{
ForwardedHeadersTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace ServiceControl.AcceptanceTests.Security.ForwardedHeaders
/// Partial Headers (Proto Only)
/// When only X-Forwarded-Proto is sent, only scheme should change.
/// </summary>
[NonParallelizable]
class When_only_proto_header_is_sent : AcceptanceTest
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace ServiceControl.AcceptanceTests.Security.ForwardedHeaders
/// When TrustAllProxies is true and X-Forwarded-For contains multiple IPs (proxy chain),
/// the original client IP (first in the chain) should be returned.
/// </summary>
[NonParallelizable]
class When_proxy_chain_headers_are_sent : AcceptanceTest
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace ServiceControl.AcceptanceTests.Security.ForwardedHeaders
/// Proxy Chain with Known Proxies (ForwardLimit=1)
/// When TrustAllProxies=false (known proxies configured), ForwardLimit=1, so only the last proxy IP is processed.
/// </summary>
[NonParallelizable]
class When_proxy_chain_headers_are_sent_with_known_proxies : AcceptanceTest
{
ForwardedHeadersTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace ServiceControl.AcceptanceTests.Security.ForwardedHeaders
/// Direct Access (No Proxy)
/// When no forwarded headers are sent, the request values should remain unchanged.
/// </summary>
[NonParallelizable]
class When_request_has_no_forwarded_headers : AcceptanceTest
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace ServiceControl.AcceptanceTests.Security.ForwardedHeaders
/// When TrustAllProxies is explicitly configured via environment variable, headers should be applied.
/// This test verifies the WithTrustAllProxies() configuration method works correctly.
/// </summary>
[NonParallelizable]
class When_trust_all_proxies_is_explicitly_configured : AcceptanceTest
{
ForwardedHeadersTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace ServiceControl.AcceptanceTests.Security.ForwardedHeaders
/// Unknown Network Rejected
/// When KnownNetworks are configured but the caller IP does NOT fall within, headers should be ignored.
/// </summary>
[NonParallelizable]
class When_unknown_network_sends_headers : AcceptanceTest
{
ForwardedHeadersTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace ServiceControl.AcceptanceTests.Security.ForwardedHeaders
/// Unknown Proxy Rejected
/// When KnownProxies are configured but the caller IP does NOT match, headers should be ignored.
/// </summary>
[NonParallelizable]
class When_unknown_proxy_sends_headers : AcceptanceTest
{
ForwardedHeadersTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace ServiceControl.AcceptanceTests.Security.Https
/// In acceptance tests (which run in Development mode), HSTS headers are not sent.
/// This test verifies that HSTS is correctly NOT applied in development mode.
/// </summary>
[NonParallelizable]
class When_hsts_is_configured_in_development_mode : AcceptanceTest
{
HttpsTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace ServiceControl.AcceptanceTests.Security.Https
/// HTTPS Redirect Disabled (Default)
/// When RedirectHttpToHttps is false (default), HTTP requests should not be redirected.
/// </summary>
[NonParallelizable]
class When_https_redirect_is_disabled : AcceptanceTest
{
HttpsTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace ServiceControl.AcceptanceTests.Security.Https
/// HTTPS Redirect Enabled
/// When RedirectHttpToHttps is true, HTTP requests should be redirected to HTTPS.
/// </summary>
[NonParallelizable]
class When_https_redirect_is_enabled : AcceptanceTest
{
HttpsTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace ServiceControl.AcceptanceTests.Security.OpenIdConnect
/// When Authentication.Enabled is false (default), all API endpoints should be accessible
/// without authentication. Requests should not require Bearer tokens.
/// </summary>
[NonParallelizable]
class When_authentication_is_disabled : AcceptanceTest
{
OpenIdConnectTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace ServiceControl.AcceptanceTests.Security.OpenIdConnect
/// This test uses a mock OIDC server to provide discovery endpoints and signing keys,
/// allowing full testing of the JWT Bearer authentication flow.
/// </summary>
[NonParallelizable]
class When_authentication_is_enabled : AcceptanceTest
{
OpenIdConnectTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace ServiceControl.AcceptanceTests.Security.OpenIdConnect;
/// It is the per-instance authorization contract ServicePulse consumes: it gates UI on routes it
/// already calls rather than on the server's internal permission vocabulary.
/// </summary>
[NonParallelizable]
class When_my_routes_are_requested : AcceptanceTest
{
OpenIdConnectTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace ServiceControl.AcceptanceTests.Security.OpenIdConnect
/// endpoint should return the overridden authority for ServicePulse to use instead of the
/// main authority URL.
/// </summary>
[NonParallelizable]
class When_service_pulse_authority_override_is_configured : AcceptanceTest
{
OpenIdConnectTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace ServiceControl.AcceptanceTests.Security.OpenIdConnect
/// string returned by the authentication configuration endpoint should omit offline_access,
/// so ServicePulse does not request a scope the identity provider disallows.
/// </summary>
[NonParallelizable]
class When_service_pulse_offline_access_scope_is_disabled : AcceptanceTest
{
OpenIdConnectTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
<Compile Include="..\ServiceControl.Audit.Persistence.Tests.RavenDB\SharedEmbeddedServer.cs" />
<Compile Include="..\ServiceControl.Audit.Persistence.Tests.RavenDB\StopSharedDatabase.cs" />
<Compile Remove="..\ServiceControl.Audit.AcceptanceTests\TestsFilter.cs" />
<Compile Remove="..\ServiceControl.Audit.AcceptanceTests\NUnitSettings.cs" />
<!-- NUnitSettings.cs is excluded because the embedded RavenDB server does not support concurrent database create/delete/index operations reliably -->
</ItemGroup>

</Project>
5 changes: 5 additions & 0 deletions src/ServiceControl.Audit.AcceptanceTests/NUnitSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
using NUnit.Framework;

[assembly: FixtureLifeCycle(LifeCycle.InstancePerTestCase)]
[assembly: Parallelizable(ParallelScope.All)]
[assembly: LevelOfParallelism(4)]
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace ServiceControl.Audit.AcceptanceTests.Security.Cors
/// When AllowAnyOrigin is true (default for backwards compatibility), requests from any origin should be allowed.
/// The Access-Control-Allow-Origin header should be "*".
/// </summary>
[NonParallelizable]
class When_cors_allows_any_origin : AcceptanceTest
{
CorsTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace ServiceControl.Audit.AcceptanceTests.Security.Cors
/// When AllowAnyOrigin is false and no AllowedOrigins are configured, CORS is effectively disabled.
/// No Access-Control-Allow-Origin header should be returned for any origin.
/// </summary>
[NonParallelizable]
class When_cors_is_disabled : AcceptanceTest
{
CorsTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace ServiceControl.Audit.AcceptanceTests.Security.Cors
/// When a request comes from an origin that is in the AllowedOrigins list,
/// the response should include the Access-Control-Allow-Origin header with that specific origin.
/// </summary>
[NonParallelizable]
class When_request_from_allowed_origin : AcceptanceTest
{
CorsTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace ServiceControl.Audit.AcceptanceTests.Security.Cors
/// When a request comes from an origin that is NOT in the AllowedOrigins list,
/// the response should NOT include an Access-Control-Allow-Origin header that matches the request origin.
/// </summary>
[NonParallelizable]
class When_request_from_disallowed_origin : AcceptanceTest
{
CorsTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace ServiceControl.Audit.AcceptanceTests.Security.ForwardedHeaders
/// Forwarded Headers Disabled
/// When forwarded headers processing is disabled, headers should be ignored regardless of trust.
/// </summary>
[NonParallelizable]
class When_forwarded_headers_are_disabled : AcceptanceTest
{
ForwardedHeadersTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace ServiceControl.Audit.AcceptanceTests.Security.ForwardedHeaders
/// Default Behavior with Headers
/// When forwarded headers are sent and TrustAllProxies is true (default), headers should be applied.
/// </summary>
[NonParallelizable]
class When_forwarded_headers_are_sent : AcceptanceTest
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace ServiceControl.Audit.AcceptanceTests.Security.ForwardedHeaders
/// Known Networks (CIDR)
/// When KnownNetworks are configured and the caller IP falls within, headers should be applied.
/// </summary>
[NonParallelizable]
class When_known_networks_are_configured : AcceptanceTest
{
ForwardedHeadersTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace ServiceControl.Audit.AcceptanceTests.Security.ForwardedHeaders
/// Known Proxies Only
/// When KnownProxies are configured and the caller IP matches, headers should be applied.
/// </summary>
[NonParallelizable]
class When_known_proxies_are_configured : AcceptanceTest
{
ForwardedHeadersTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace ServiceControl.Audit.AcceptanceTests.Security.ForwardedHeaders
/// When TrustAllProxies is true and headers contain multiple values (proxy chain),
/// the original (leftmost) values should be returned.
/// </summary>
[NonParallelizable]
class When_multiple_header_values_are_sent : AcceptanceTest
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace ServiceControl.Audit.AcceptanceTests.Security.ForwardedHeaders
/// When TrustAllProxies=false (known proxies configured), ForwardLimit=1,
/// so only the rightmost values are processed.
/// </summary>
[NonParallelizable]
class When_multiple_header_values_are_sent_with_known_proxies : AcceptanceTest
{
ForwardedHeadersTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace ServiceControl.Audit.AcceptanceTests.Security.ForwardedHeaders
/// Partial Headers (Proto Only)
/// When only X-Forwarded-Proto is sent, only scheme should change.
/// </summary>
[NonParallelizable]
class When_only_proto_header_is_sent : AcceptanceTest
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace ServiceControl.Audit.AcceptanceTests.Security.ForwardedHeaders
/// When TrustAllProxies is true and X-Forwarded-For contains multiple IPs (proxy chain),
/// the original client IP (first in the chain) should be returned.
/// </summary>
[NonParallelizable]
class When_proxy_chain_headers_are_sent : AcceptanceTest
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace ServiceControl.Audit.AcceptanceTests.Security.ForwardedHeaders
/// Proxy Chain with Known Proxies (ForwardLimit=1)
/// When TrustAllProxies=false (known proxies configured), ForwardLimit=1, so only the last proxy IP is processed.
/// </summary>
[NonParallelizable]
class When_proxy_chain_headers_are_sent_with_known_proxies : AcceptanceTest
{
ForwardedHeadersTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace ServiceControl.Audit.AcceptanceTests.Security.ForwardedHeaders
/// Direct Access (No Proxy)
/// When no forwarded headers are sent, the request values should remain unchanged.
/// </summary>
[NonParallelizable]
class When_request_has_no_forwarded_headers : AcceptanceTest
{
[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace ServiceControl.Audit.AcceptanceTests.Security.ForwardedHeaders
/// When TrustAllProxies is explicitly configured via environment variable, headers should be applied.
/// This test verifies the WithTrustAllProxies() configuration method works correctly.
/// </summary>
[NonParallelizable]
class When_trust_all_proxies_is_explicitly_configured : AcceptanceTest
{
ForwardedHeadersTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace ServiceControl.Audit.AcceptanceTests.Security.ForwardedHeaders
/// Unknown Network Rejected
/// When KnownNetworks are configured but the caller IP does NOT fall within, headers should be ignored.
/// </summary>
[NonParallelizable]
class When_unknown_network_sends_headers : AcceptanceTest
{
ForwardedHeadersTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace ServiceControl.Audit.AcceptanceTests.Security.ForwardedHeaders
/// Unknown Proxy Rejected
/// When KnownProxies are configured but the caller IP does NOT match, headers should be ignored.
/// </summary>
[NonParallelizable]
class When_unknown_proxy_sends_headers : AcceptanceTest
{
ForwardedHeadersTestConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace ServiceControl.Audit.AcceptanceTests.Security.Https
/// In acceptance tests (which run in Development mode), HSTS headers are not sent.
/// This test verifies that HSTS is correctly NOT applied in development mode.
/// </summary>
[NonParallelizable]
class When_hsts_is_configured_in_development_mode : AcceptanceTest
{
HttpsTestConfiguration configuration;
Expand Down
Loading