Skip to content

Commit

Permalink
Update PesterTests and devcontainer to .NET 8 (#2430)
Browse files Browse the repository at this point in the history
* Update devcontainer to .NET 8 SDK

* Add extensions for CI to devcontainer

* Update contributing guide

---------

Co-authored-by: Jakub Jareš <[email protected]>
  • Loading branch information
fflaten and nohwnd authored Apr 7, 2024
1 parent 6466ee0 commit abee795
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 949 deletions.
10 changes: 0 additions & 10 deletions .devcontainer/Dockerfile

This file was deleted.

35 changes: 18 additions & 17 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.209.5/containers/dotnet
// For format details, see https://aka.ms/vscode-remote/devcontainer.json
{
"name": "Pester",
"build": {
"dockerfile": "Dockerfile",
"args": {
// Update 'VARIANT' to pick a .NET Core version: 3.1, 5.0, 6.0
// Append -bullseye or -focal to pin to an OS version. Using focal (Ubuntu) for pwsh support
"VARIANT": "6.0-focal"
"image": "mcr.microsoft.com/devcontainers/dotnet:1-8.0-jammy",
"remoteUser": "vscode",
"customizations": {
"codespaces": {
"openFiles": [
"CONTRIBUTING.md"
]
},
"vscode": {
"settings": {},
"extensions": [
"ms-vscode.powershell",
"ms-dotnettools.csharp",
"redhat.vscode-xml",
"ms-azure-devops.azure-pipelines",
"GitHub.vscode-github-actions"
]
}
},
// Set *default* container specific settings.json values on container create.
"settings": {},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-vscode.powershell",
"ms-dotnettools.csharp",
"redhat.vscode-xml"
],
// Use 'postCreateCommand' to run commands after the container is created.
// Restoring the c# projects
"postCreateCommand": "dotnet restore src/csharp"
}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ for more information.

## Building Pester

Pester is written in Powershell and C#. The C# solution requires .Net
Pester is written in Powershell and C#. The C# solution requires .NET
Framework SDKs and Developer Packs in order to compile, see links below
how to install those prior to building.

Expand Down
2 changes: 1 addition & 1 deletion src/csharp/Pester/Pester.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<!-- PowerShell 7.2.x is the oldest supported PowerShell version. That version is built using net6.0.
But there is a bug in 7.2.0 reference assemblies, up to 7.2.10, where the IExtens.File is missing from the reference assembly:
https://github.com/PowerShell/PowerShell/issues/16408
So we use the version released before 7.2.0 which was 7.1.7. We could probably use 7.2.10 safely as well,
-->
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
Expand Down
13 changes: 8 additions & 5 deletions src/csharp/PesterTests/PesterTests.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>latest</LangVersion>
<IsPackable>false</IsPackable>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<!-- Workaround for NETSDK1206 warning about version-specific RIDs in
Microsoft.Management.Infrastructure dependency. Resolved in PowerShell 7.4 SDK -->
<UseRidGraph>true</UseRidGraph>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageReference Include="coverlet.collector" Version="3.1.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7" />
<PackageReference Include="coverlet.collector" Version="6.0.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit abee795

Please sign in to comment.