Skip to content

Commit

Permalink
Run tests with .NET 9
Browse files Browse the repository at this point in the history
Update the dependencies to be able to compile on 9.0
  • Loading branch information
julienp committed Nov 13, 2024
1 parent 2d8c9f5 commit ec41de9
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 39 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup dotnet SDK v6.0
- name: Setup dotnet SDK
uses: actions/setup-dotnet@v4
- name: Format Pulumi SDK
run: dotnet run format-sdk verify
Expand All @@ -39,13 +39,13 @@ jobs:
strategy:
matrix:
os: ${{ fromJson(needs.setup_matrix.outputs.matrix).os }}
dotnet-version: [6.0.x, 8.0.x]
dotnet-version: [6.0.x, 8.0.x, 9.0.x]

runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup dotnet SDK v6.0
- name: Setup dotnet SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
Expand All @@ -71,12 +71,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-12]
dotnet-version: [6.0.x, 8.0.x]
dotnet-version: [6.0.x, 8.0.x, 9.0.x]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup dotnet SDK v6.0
- name: Setup dotnet SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Set up DotNet 6.0.x
- name: Set up DotNet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x
dotnet-quality: ga
- name: Install Pulumi CLI
uses: pulumi/actions@v5
Expand All @@ -56,4 +56,4 @@ jobs:
- name: Test Pulumi Automation SDK
run: dotnet run test-automation-sdk
- name: Publish Packages
run: dotnet run publish-sdks
run: dotnet run publish-sdks
6 changes: 3 additions & 3 deletions sdk/Pulumi.Automation.Tests/LocalWorkspaceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ public async Task StackReferenceDestroyDiscardsWithTwoInlinePrograms()
var upResult = await stackA.UpAsync();
Assert.Equal(UpdateKind.Update, upResult.Summary.Kind);
Assert.Equal(UpdateState.Succeeded, upResult.Summary.Result);
Assert.Equal(1, upResult.Outputs.Count);
Assert.Single(upResult.Outputs);

// exp_static
Assert.True(upResult.Outputs.TryGetValue("exp_static", out var expStaticValue));
Expand All @@ -857,7 +857,7 @@ public async Task StackReferenceDestroyDiscardsWithTwoInlinePrograms()
var upResult = await stackB.UpAsync();
Assert.Equal(UpdateKind.Update, upResult.Summary.Kind);
Assert.Equal(UpdateState.Succeeded, upResult.Summary.Result);
Assert.Equal(1, upResult.Outputs.Count);
Assert.Single(upResult.Outputs);

// exp_static
Assert.True(upResult.Outputs.TryGetValue("exp_static", out var expStaticValue));
Expand Down Expand Up @@ -1688,7 +1688,7 @@ public async Task WorkspaceStackSupportsCancel()

try
{
Task.WaitAll(destroyTask, cancelTask);
await Task.WhenAll(destroyTask, cancelTask);
}
catch (AggregateException)
{
Expand Down
10 changes: 5 additions & 5 deletions sdk/Pulumi.Automation.Tests/Pulumi.Automation.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
<PackageReference Include="Moq" Version="4.13.1" />
<PackageReference Include="Serilog.Sinks.XUnit" Version="2.0.4" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="Serilog.Sinks.XUnit" Version="3.0.5" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public void CanDeserializeUpdateSummary()
Assert.Equal(UpdateKind.Update, update.Kind);
Assert.Equal(UpdateState.Succeeded, update.Result);
Assert.NotNull(update.ResourceChanges);
Assert.Equal(1, update.ResourceChanges!.Count);
Assert.Single(update.ResourceChanges);
Assert.True(update.ResourceChanges.TryGetValue(OperationType.Create, out var createdCount));
Assert.Equal(3, createdCount);
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/Pulumi.Tests/Provider/ResourceProviderServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Divergic.Logging.Xunit;
using Neovolve.Logging.Xunit;
using FluentAssertions;
using Google.Protobuf.WellKnownTypes;
using Pulumi.Experimental.Provider;
Expand Down
12 changes: 6 additions & 6 deletions sdk/Pulumi.Tests/Pulumi.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Divergic.Logging.Xunit" Version="4.3.1" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
<PackageReference Include="Moq" Version="4.13.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="Neovolve.Logging.Xunit" Version="6.2.0" />
<PackageReference Include="FluentAssertions" Version="6.12.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions sdk/Pulumi.Tests/Resources/ComponentResourceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class ComponentResourceTests
// A ComponentResource cannot use a Provider that was passed in.
// However, it should still propagate the Provider to its children.
[Fact]
public async void PropagatesProviderOption()
public async Task PropagatesProviderOption()
{
var mocks = new MinimalMocks();
var options = new TestOptions();
Expand Down Expand Up @@ -59,7 +59,7 @@ await Deployment.TestAsync(mocks, options, () =>
// A ComponentResource should propagate the bag of Providers
// it receives via the Provider option to its children.
[Fact]
public async void PropagatesProvidersOption()
public async Task PropagatesProvidersOption()
{
var mocks = new MinimalMocks();
var options = new TestOptions();
Expand Down
2 changes: 1 addition & 1 deletion sdk/Pulumi.Tests/Resources/DictionaryInvokeArgsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void ConstructorValidValues()
}
catch
{
Assert.True(false, "DictionaryInvokeArgs constructor should not throw an exception");
Assert.Fail("DictionaryInvokeArgs constructor should not throw an exception");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Pulumi.Tests.Resources
public class StackReferenceOutputDetailsTests
{
[Fact]
public async void SupportsStackReferenceRequiredOutputs()
public async Task SupportsStackReferenceRequiredOutputs()
{
var mocks = new FakeStackOutputMocks("bucket", "my-bucket");
var options = new TestOptions();
Expand All @@ -35,7 +35,7 @@ public async void SupportsStackReferenceRequiredOutputs()
}

[Fact]
public async void SupportsPlainText()
public async Task SupportsPlainText()
{
var mocks = new FakeStackOutputMocks("bucket", "my-bucket");
var options = new TestOptions();
Expand All @@ -57,7 +57,7 @@ public async void SupportsPlainText()
}

[Fact]
public async void SupportsSecrets()
public async Task SupportsSecrets()
{
var mocks = new FakeStackOutputMocks("secret", Output.CreateSecret("my-bucket"));
var options = new TestOptions();
Expand All @@ -79,7 +79,7 @@ public async void SupportsSecrets()
}

[Fact]
public async void Unknowns()
public async Task Unknowns()
{
var mocks = new FakeStackOutputMocks("something", "foo");
var options = new TestOptions();
Expand Down
16 changes: 8 additions & 8 deletions sdk/Pulumi.Tests/Serialization/ResourcePackagesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ public void UnknownNotFound()
{
if (ResourcePackages.TryGetResourceType("test:index/UnknownResource", null, out _))
{
Assert.True(false, "Unknown resource found");
Assert.Fail("Unknown resource found");
}
if (ResourcePackages.TryGetResourceType("test:index/UnknownResource", "", out _))
{
Assert.True(false, "Unknown resource found");
Assert.Fail("Unknown resource found");
}
if (ResourcePackages.TryGetResourceType("unknown:index/TestResource", "0.0.1", out _))
{
Assert.True(false, "Unknown resource found");
Assert.Fail("Unknown resource found");
}
if (ResourcePackages.TryGetResourceType("unknown:index/AnotherResource", "1.0.0", out _))
{
Assert.True(false, "Resource with non-matching assembly version found");
Assert.Fail("Resource with non-matching assembly version found");
}
}

Expand All @@ -36,7 +36,7 @@ public void NullReturnsHighestVersion()
}
else
{
Assert.True(false, "Test resource not found");
Assert.Fail("Test resource not found");
}
}

Expand All @@ -49,7 +49,7 @@ public void BlankReturnsHighestVersion()
}
else
{
Assert.True(false, "Test resource not found");
Assert.Fail("Test resource not found");
}
}

Expand All @@ -62,7 +62,7 @@ public void MajorVersionRespected()
}
else
{
Assert.True(false, "Test resource not found");
Assert.Fail("Test resource not found");
}
}

Expand All @@ -75,7 +75,7 @@ public void WildcardSelectedIfOthersDontMatch()
}
else
{
Assert.True(false, "Test resource not found");
Assert.Fail("Test resource not found");
}
}

Expand Down

0 comments on commit ec41de9

Please sign in to comment.