Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies and TFMs. #154

Merged
merged 2 commits into from
Jan 20, 2025
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ jobs:
id: test
if: ${{ github.event.inputs.skip-tests != 'true' }}
run: |
./build/invokeDotnetTest.ps1 -p ./tests/Mawosoft.PowerShell.WindowsSearchManager.Tests/Mawosoft.PowerShell.WindowsSearchManager.Tests.csproj -c Debug, Release -f net7.0, net6.0, net48 -v detailed -r ./TestResults/WSearchDisabled -ff:$${{ strategy.fail-fast }} -a '--filter', 'WSearch=IsDisabled'
./build/invokeDotnetTest.ps1 -p ./tests/Mawosoft.PowerShell.WindowsSearchManager.Tests/Mawosoft.PowerShell.WindowsSearchManager.Tests.csproj -c Debug, Release -f net9.0, net8.0, net48 -v detailed -r ./TestResults/WSearchDisabled -ff:$${{ strategy.fail-fast }} -a '--filter', 'WSearch=IsDisabled'
Set-Service wsearch -StartupType Automatic
Start-Service wsearch
./build/invokeDotnetTest.ps1 -p ./tests/Mawosoft.PowerShell.WindowsSearchManager.Tests/Mawosoft.PowerShell.WindowsSearchManager.Tests.csproj -c Debug, Release -f net7.0, net6.0, net48 -v detailed -r ./TestResults/WSearchNotDisabled -ff:$${{ strategy.fail-fast }} -a '--filter', 'WSearch!=IsDisabled'
./build/invokeDotnetTest.ps1 -p ./tests/Mawosoft.PowerShell.WindowsSearchManager.Tests/Mawosoft.PowerShell.WindowsSearchManager.Tests.csproj -c Debug, Release -f net9.0, net8.0, net48 -v detailed -r ./TestResults/WSearchNotDisabled -ff:$${{ strategy.fail-fast }} -a '--filter', 'WSearch!=IsDisabled'
- name: Upload Test results
if: ${{ always() && steps.test.outcome != 'skipped' }}
uses: actions/upload-artifact@v4
Expand Down
29 changes: 11 additions & 18 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,32 @@
</PropertyGroup>

<ItemGroup>
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
<PackageVersion Include="docfx" Version="2.70.4" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="Microsoft.PowerShell.5.1.ReferenceAssemblies" Version="1.0.0" />
<PackageVersion Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageVersion Include="platyPS" Version="0.14.2" />
<PackageVersion Include="PowerShellStandard.Library" Version="5.1.1" />
<PackageVersion Include="System.ServiceProcess.ServiceController" Version="8.0.0" />
<PackageVersion Include="xunit" Version="2.9.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageVersion Include="System.ServiceProcess.ServiceController" Version="9.0.1" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageVersion Include="Microsoft.PowerShell.SDK" Version="7.2.23" />
<PackageVersion Include="System.Management.Automation" Version="7.2.23" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageVersion Include="Microsoft.PowerShell.SDK" Version="7.3.12" />
<PackageVersion Include="System.Management.Automation" Version="7.3.12" />
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageVersion Include="Microsoft.PowerShell.SDK" Version="7.4.6" />
<PackageVersion Include="System.Management.Automation" Version="7.4.6" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageVersion Include="Microsoft.PowerShell.SDK" Version="7.4.5" />
<PackageVersion Include="System.Management.Automation" Version="7.4.5" />
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageVersion Include="Microsoft.PowerShell.SDK" Version="7.5.0-rc.1" />
<PackageVersion Include="System.Management.Automation" Version="7.5.0-rc.1" />
</ItemGroup>

<ItemGroup>
<!-- Transitive pinning for deprecated/vulnerable packages -->
<PackageVersion Condition="'$(TargetFramework)' == 'net6.0'" Include="System.Diagnostics.DiagnosticSource" Version="8.0.1" />
<PackageVersion Include="Microsoft.ApplicationInsights" Version="2.22.0" />
<PackageVersion Condition="'$(TargetFramework)' == 'netstandard2.0'" Include="System.Security.AccessControl" Version="6.0.1" />
<PackageVersion Condition="'$(TargetFramework)' == 'net7.0'" Include="System.Formats.Asn1" Version="8.0.1" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions build/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ steps:
artifact: azp-Binlogs
displayName: Upload Binlogs
- pwsh: |
./build/invokeDotnetTest.ps1 -p ./tests/Mawosoft.PowerShell.WindowsSearchManager.Tests/Mawosoft.PowerShell.WindowsSearchManager.Tests.csproj -c Debug -f net7.0, net6.0, net48 -v detailed -r ./TestResults/WSearchDisabled -s ./tests/Mawosoft.PowerShell.WindowsSearchManager.Tests/coverlet.runsettings -a '--filter', 'WSearch=IsDisabled'
./build/invokeDotnetTest.ps1 -p ./tests/Mawosoft.PowerShell.WindowsSearchManager.Tests/Mawosoft.PowerShell.WindowsSearchManager.Tests.csproj -c Debug -f net9.0, net8.0, net48 -v detailed -r ./TestResults/WSearchDisabled -s ./tests/Mawosoft.PowerShell.WindowsSearchManager.Tests/coverlet.runsettings -a '--filter', 'WSearch=IsDisabled'
Set-Service wsearch -StartupType Automatic
Start-Service wsearch
./build/invokeDotnetTest.ps1 -p ./tests/Mawosoft.PowerShell.WindowsSearchManager.Tests/Mawosoft.PowerShell.WindowsSearchManager.Tests.csproj -c Debug -f net7.0, net6.0, net48 -v detailed -r ./TestResults/WSearchNotDisabled -s ./tests/Mawosoft.PowerShell.WindowsSearchManager.Tests/coverlet.runsettings -a '--filter', 'WSearch!=IsDisabled'
./build/invokeDotnetTest.ps1 -p ./tests/Mawosoft.PowerShell.WindowsSearchManager.Tests/Mawosoft.PowerShell.WindowsSearchManager.Tests.csproj -c Debug -f net9.0, net8.0, net48 -v detailed -r ./TestResults/WSearchNotDisabled -s ./tests/Mawosoft.PowerShell.WindowsSearchManager.Tests/coverlet.runsettings -a '--filter', 'WSearch!=IsDisabled'
displayName: Test
- task: reportgenerator@5
condition: succeededOrFailed()
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.400",
"version": "9.0.102",
"rollForward": "disable"
},
"msbuild-sdks": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ dotnet_diagnostic.CA1861.severity = none
# CA1865: Use char overload [net48 - not available]
dotnet_diagnostic.CA1865.severity = none

# IDE0028: Simplify collection initialization
dotnet_diagnostic.IDE0028.severity = silent

# IDE0056: Use index operator
dotnet_diagnostic.IDE0056.severity = none

Expand All @@ -33,6 +36,9 @@ dotnet_diagnostic.IDE0130.severity = none
# xUnit1042: The member referenced by the MemberData attribute returns untyped data rows
dotnet_diagnostic.xUnit1042.severity = none

# xUnit1044: Avoid using TheoryData type arguments that are not serializable
dotnet_diagnostic.xUnit1044.severity = none

# Common settings for test projects

# CA1034: Nested types should not be visible
Expand All @@ -44,6 +50,9 @@ dotnet_diagnostic.CA1051.severity = none
# CA1062: Validate arguments of public methods
dotnet_diagnostic.CA1062.severity = none

# CA1515: Consider making public types internal
dotnet_diagnostic.CA1515.severity = none

# CA1707: Identifiers should not contain underscores
dotnet_diagnostic.CA1707.severity = none

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ protected ErrorRecord AssertParameterValidation(string script, string? parameter
Assert.Empty(results);
Assert.True(PowerShell.HadErrors);
ErrorRecord errorRecord = Assert.Single(PowerShell.Streams.Error);
ParameterBindingException exception = Assert.IsAssignableFrom<ParameterBindingException>(errorRecord.Exception);
ParameterBindingException exception = Assert.IsType<ParameterBindingException>(errorRecord.Exception, exactMatch: false);
if (parameterName is not null) Assert.Equal(parameterName, exception.ParameterName.Trim());
return errorRecord;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public void AllParameterMetadata_MatchExpected()
private static string GetCommandAndFirstParameter(string script, out string? firstParameter)
{
firstParameter = null;
string[] split = script.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
string[] split = script.Split([' '], StringSplitOptions.RemoveEmptyEntries);
if (split.Length > 1)
{
string first = split[1].Trim();
Expand Down Expand Up @@ -295,7 +295,7 @@ public void ShouldProcess_CallCount_Matches(string script)

public static readonly object?[][] CatalogValidation_TestData = s_CatalogCommands
.Concat(s_CatalogValidationOnlyCommands)
.CrossJoin(new string[] { "", "''", "$null" })
.CrossJoin(["", "''", "$null"])
.ToArray();

[Trait("WSearch", "IsEnabled")]
Expand Down Expand Up @@ -342,7 +342,7 @@ public void CatalogParameter_ParameterValidation_Succeeds(string script, string
@"Add-SearchRule -RuleType Exclude ",
@"Remove-SearchRule ",
@"Test-SearchRule "
}.CrossJoin(new string[] { "", "''", "$null", "@()", @"@('x:\foo', '')", @"@('x:\foo', $null)" })
}.CrossJoin(["", "''", "$null", "@()", @"@('x:\foo', '')", @"@('x:\foo', $null)"])
.ToArray();

[Theory]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net7.0;net6.0;$(NetFxTfm)</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;$(NetFxTfm)</TargetFrameworks>
<IsPackable>false</IsPackable>
<Description>Tests for Mawosoft.PowerShell.WindowsSearchManager</Description>
<!-- MSB3270 Processor architecture mismatch. Reason: interop.searchapi.dll only has processor-specific flavors,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ public static IEnumerable<object[]> FailingInterfaceChainCollection(string inter
Exception_TheoryData exceptions = new();
for (int i = noParents ? chainIndex : 1; i <= chainIndex; i++)
{
foreach (object[] e in exceptions)
foreach (ExceptionParam e in exceptions)
{
yield return new object[] { new MockInterfaceChain().WithException(i, (ExceptionParam)e[0]) };
yield return new object[] { new MockInterfaceChain().WithException(i, e) };
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void Command_NoAdmin_FailsWithCustomMessage()

public static readonly object?[][] HandlesFailures_TestData =
new string[] { "^get_", "^set_|^SetProxy$" }
.CrossJoin(new Exception_TheoryData())
.CrossJoin<string, ExceptionParam>(new Exception_TheoryData())
.ToArray();

[Theory]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ public class TestSearchRuleCommandTests : CommandTestBase
$@"@('{string.Join("', '", s_testInfos.Select(t => t.Path))}') | Test-SearchRule",
$@"@([pscustomobject]@{{ Path = '{string.Join("'}, [pscustomobject]@{ Path = '", s_testInfos.Select(t => t.Path))}' }}) | Test-SearchRule",
}
.CrossJoin(new string[][]
{
.CrossJoin(
[
["", "IsIncluded"],
["-IsIncluded", "IsIncluded"],
["-HasChildScope", "HasChildScope"],
["-HasParentScope", "HasParentScope"],
["-Detailed", ""],
})
])
.ToArray();

[Theory]
Expand Down
Loading