Skip to content

Commit adf90c9

Browse files
committed
Formatting
1 parent aba1f4e commit adf90c9

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

.github/actions/test-dotnet/Invoke-SolutionOrProjectTests.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,17 @@ if ($SolutionOrProject -imatch '\.slnx?$')
9595
'-getProperty:IsTestingPlatformApplication,IsTestProject'
9696
'-verbosity:quiet'
9797
)
98+
9899
$properties = dotnet msbuild $absolutePath @evaluationSwitches | Out-String
100+
99101
if ($LASTEXITCODE -ne 0)
100102
{
101103
Write-GitHub "Failed to evaluate test project properties for `"$absolutePath`"."
102104
exit 1
103105
}
104106

105107
$properties = ($properties | ConvertFrom-Json).Properties
108+
106109
if ($useMtp)
107110
{
108111
if ($properties.IsTestingPlatformApplication -eq 'true')
@@ -111,7 +114,7 @@ if ($SolutionOrProject -imatch '\.slnx?$')
111114
}
112115
elseif ($properties.IsTestProject -eq 'true')
113116
{
114-
Write-GitHub "The test project `"$absolutePath`" does not support Microsoft.Testing.Platform. Migrate it or use test-platform: VSTest."
117+
Write-GitHub "The test project `"$absolutePath`" does not support Microsoft.Testing.Platform. Migrate it or use test-platform VSTest."
115118
exit 1
116119
}
117120

.github/actions/test-dotnet/Tests/Invoke-Tests.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ $artifactPath = Join-Path $PSScriptRoot "artifacts/$([Guid]::NewGuid().ToString(
55
New-Item -ItemType Directory -Path $artifactPath -Force | Out-Null
66

77
$savedEnvironment = @{}
8+
89
foreach ($name in @('PATH', 'GITHUB_ACTIONS', 'GITHUB_OUTPUT', 'GITHUB_STEP_SUMMARY', 'GITHUB_WORKSPACE', 'LGHA_TEST_FAILURE'))
910
{
1011
$savedEnvironment[$name] = [Environment]::GetEnvironmentVariable($name)
@@ -20,6 +21,7 @@ function Invoke-Scenario($Name, $Target, $Filter, $ExpectedExitCode = 0)
2021
$Env:GITHUB_OUTPUT = Join-Path $artifactPath "$Name-output.txt"
2122
$Env:GITHUB_STEP_SUMMARY = Join-Path $artifactPath "$Name-summary.md"
2223
$logPath = Join-Path $artifactPath "$Name.log"
24+
2325
$arguments = @(
2426
'-NoProfile', '-File', "$actionPath/Invoke-SolutionOrProjectTests.ps1"
2527
'-SolutionOrProject', $Target
@@ -32,6 +34,7 @@ function Invoke-Scenario($Name, $Target, $Filter, $ExpectedExitCode = 0)
3234

3335
# Run in a child process so the action's exit and environment changes don't affect the test harness.
3436
& (Join-Path $PSHOME 'pwsh') @arguments *> $logPath
37+
3538
if ($LASTEXITCODE -ne $ExpectedExitCode)
3639
{
3740
Get-Content $logPath | Write-Output
@@ -40,6 +43,7 @@ function Invoke-Scenario($Name, $Target, $Filter, $ExpectedExitCode = 0)
4043
}
4144

4245
Push-Location $PSScriptRoot
46+
4347
try
4448
{
4549
$Env:PATH = (Join-Path $repositoryPath 'Scripts') + [IO.Path]::PathSeparator + $Env:PATH

0 commit comments

Comments
 (0)