Skip to content
Merged
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
8 changes: 7 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,10 @@ csharp_space_between_square_brackets = false
dotnet_diagnostic.IDE0290.severity = none

# Namespace style.
csharp_style_namespace_declarations = block_scoped
csharp_style_namespace_declarations = block_scoped
dotnet_diagnostic.IDE0290.severity = none

# Target-typed new expressions
# We will probably adopt these at some point, but for some reason the IDE only just started complaining about them,
# and I don't want to deal with all these while in the middle of the Slight Deunification.
dotnet_diagnostic.IDE0090.severity = none
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ protected async Task SequenceIdentity<T>(IAsyncEnumerable<T> enumerable)
var res1 = await enumerable.ToListAsync();
var res2 = await enumerable.ToListAsync();

res1.Should().BeEquivalentTo(res2);
Assert.Equivalent(res1, res2, strict: true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected async Task SequenceIdentity<T>(IAsyncEnumerable<T> enumerable)
var res1 = await enumerable.ToListAsync();
var res2 = await enumerable.ToListAsync();

res1.Should().BeEquivalentTo(res2);
Assert.Equivalent(res1, res2, strict: true);
}

protected static IAsyncEnumerable<TValue> Throw<TValue>(Exception exception)
Expand Down
3 changes: 2 additions & 1 deletion Rx.NET/Source/CodeCoverage.runsettings
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
Workaround for failure to run tests on .NET FX on v3.3.1 MSTest packages
-->
<RunConfiguration>
<DisableAppDomain>True</DisableAppDomain>
<DisableAppDomain>True</DisableAppDomain>
<ExecutionThreadApartmentState>STA</ExecutionThreadApartmentState>
</RunConfiguration>

<DataCollectionRunSettings>
Expand Down
8 changes: 2 additions & 6 deletions Rx.NET/Source/Directory.build.props
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>

<!--
Nerdbank.GitVersioning 3.6.128 injects a reference to a .proj file that doesn't work inside the
UWP test runner project. We don't ship that as a NuGet package, so it doesn't matter what its
version number is.
-->
<PackageReference
Include="Nerdbank.GitVersioning"
Version="3.8.118"
Expand Down Expand Up @@ -119,9 +114,10 @@
[.. x]. To me, this is less readable, and it doesn't improve performance, as far as we know.

CA1510 - use ArgumentNullException.ThrowIf (not available on all targets)
CA1512 - use ArgumentOutOfRangeException.ThrowIfXxx (not available on all targets)
CA1513 - use ObjectDisposedException.ThrowIf (not available on all targets)
-->
<NoWarn>$(NoWarn);CA1001;CA2213;CA1510;CA1513;IDE0028;IDE0056;IDE0057;IDE0130;IDE0290;IDE0305;IDE0306</NoWarn>
<NoWarn>$(NoWarn);CA1001;CA2213;CA1510;CA1512;CA1513;IDE0028;IDE0056;IDE0057;IDE0130;IDE0290;IDE0305;IDE0306</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Rx.NET/Source/Directory.build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<PropertyGroup>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net472'">
<DefineConstants>$(DefineConstants);HAS_WINFORMS;HAS_WPF;HAS_WINRT;HAS_DISPATCHER;HAS_REMOTING;DESKTOPCLR;NO_NULLABLE_ATTRIBUTES</DefineConstants>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
using System.Reactive.Linq;
using BenchmarkDotNet.Running;

using Microsoft.VisualStudio.TestTools.UnitTesting;

[assembly:DoNotParallelize] // Not really a test project, but the build tools think we are, and complain if we don't state our parallelization policy.

namespace Benchmarks.System.Reactive
{
internal class Program
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,18 @@
</PackageReference>
<PackageReference Include="xunit.assert" Version="2.8.0" />
</ItemGroup>
<ItemGroup>
<!--
Nerdbank.GitVersioning 3.6.128 injects a reference to a .proj file that doesn't work inside the
UWP test runner project. We don't ship that as a NuGet package, so it doesn't matter what its
version number is.
However, this doesn't seem to work. And excluding this project in the Directory.Build.props file
where we add this reference in the first place also doesn't work. I think this is coming in
transitively. So we need to work out exactly how .nuget\packages\nerdbank.gitversioning\3.6.143\build\PrivateP2PCaching.proj
is getting included, and work out how to stop that.
-->
<PackageReference Remove="Nerdbank.GitVersioning" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT License.
// See the LICENSE file in the project root for more information.

using Microsoft.VisualStudio.TestTools.UnitTesting;

[assembly:Parallelize]
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,11 @@
<ProjectReference Include="..\..\src\Microsoft.Reactive.Testing\Microsoft.Reactive.Testing.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
namespace ReactiveTests.Tests
{
[TestClass]
[DoNotParallelize] // We've observed hangs since enabling concurrent test execution.
public class EventLoopSchedulerTest
{
private static readonly TimeSpan MaxWaitTime = TimeSpan.FromSeconds(10);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
namespace ReactiveTests.Tests
{
[TestClass]
[DoNotParallelize] // We've observed hangs since enabling concurrent test execution.
public class ObserveOnTest : TestBase
{
#region + TestBase +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,14 +348,14 @@ public void RefCount_NoDelay_SourceCompletesWithNoValuesInConnect()
var connectable = new SerialSingleNotificationConnectable<int>(Notification.CreateOnCompleted<int>());
var refCount = connectable.RefCount();

var s1 = refCount.Subscribe();
_ = refCount.Subscribe();
Assert.Equal(1, connectable.Connections.Count);

// Since the source immediately completed, the RefCount goes back to zero subscribers
// inside the call to Connect, so we expect to be disconnected.
Assert.True(connectable.Connections[0].Disposed);

var s2 = refCount.Subscribe();
_ = refCount.Subscribe();
Assert.Equal(2, connectable.Connections.Count);
Assert.True(connectable.Connections[1].Disposed);
}
Expand Down Expand Up @@ -384,10 +384,10 @@ public void RefCount_NoDelay_minObservers_SourceCompletesWithNoValuesInConnect()

// We're now back in the initial disconnected state, so nothing more should
// happen until we get up to minObservers.
var s3 = refCount.Subscribe();
_ = refCount.Subscribe();
Assert.Equal(1, connectable.Connections.Count);

var s4 = refCount.Subscribe();
_ = refCount.Subscribe();
Assert.Equal(2, connectable.Connections.Count);
Assert.True(connectable.Connections[1].Disposed);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public async Task ResetExceptionDispatchState_Throw_Consistent_StackTrace_On_Awa
var ts = Observable.Throw<int>(new Exception("Aaargh!")).ResetExceptionDispatchState();

string stackTrace = null;
for (int i = 0; i < 3; i++)
for (var i = 0; i < 3; i++)
{
try
{
Expand Down Expand Up @@ -50,7 +50,7 @@ public async Task ResetExceptionDispatchState_Replay_Consistent_StackTrace_On_Aw
var ts = cts.ResetExceptionDispatchState();

string stackTrace = null;
for (int i = 0; i < 3; i++)
for (var i = 0; i < 3; i++)
{
try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT License.
// See the LICENSE file in the project root for more information.

#pragma warning disable IDE0350 // Simplify lambda - we want to keep the long form for clarity in tests.

using System;
using System.Collections.Generic;
using System.Linq;
Expand Down
5 changes: 3 additions & 2 deletions azure-pipelines.asyncrx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ stages:

steps:
- task: UseDotNet@2
displayName: Use .NET Core 7.0.x SDK
displayName: Use .NET 9.0.x SDK
inputs:
version: 7.0.x
version: 9.0.x
performMultiLevelLookup: true
includePreviewVersions: true

- task: DotNetCoreCLI@2
inputs:
Expand Down
21 changes: 15 additions & 6 deletions azure-pipelines.rx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ stages:
version: '9.0.x'

- task: UseDotNet@2
displayName: Use .NET 8.0 runtime
inputs:
version: 8.0.x
version: '8.0.x'
packageType: runtime

- task: DotNetCoreCLI@2
Expand Down Expand Up @@ -164,8 +165,8 @@ stages:
inputs:
command: test
projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
arguments: -c $(BuildConfiguration) -f net8.0 --filter "TestCategory!=SkipCI"
displayName: Run 8.0 Tests on Linux
arguments: -c $(BuildConfiguration) -f net9.0 --filter "TestCategory!=SkipCI"
displayName: Run 9.0 Tests on Linux

- task: DotNetCoreCLI@2
inputs:
Expand All @@ -174,6 +175,13 @@ stages:
arguments: -c $(BuildConfiguration) -f net9.0 --filter "TestCategory!=SkipCI"
displayName: Run 9.0 Tests on Linux

- task: DotNetCoreCLI@2
inputs:
command: test
projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
arguments: -c $(BuildConfiguration) -f net8.0 --filter "TestCategory!=SkipCI"
displayName: Run 8.0 Tests on Linux

- job: WindowsDesktop
pool:
vmImage: windows-latest
Expand All @@ -185,14 +193,15 @@ stages:

steps:
- task: UseDotNet@2
displayName: Use .NET 9.0 SDK
inputs:
version: 8.0.x
version: 9.0.x
performMultiLevelLookup: true

- task: UseDotNet@2
displayName: Use .NET 9.0 SDK
displayName: Use .NET 8.0 SDK
inputs:
version: '9.0.x'
version: '8.0.x'

- task: DotNetCoreCLI@2
inputs:
Expand Down