Skip to content

Commit ccab354

Browse files
committed
dotnet build/test precursor
1 parent ff071d7 commit ccab354

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/Get-CodeCoverage.ps1

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
####################################################################################
1111

1212
Param(
13-
[string]$TestProjectFilter = 'Tests.*.csproj',
13+
[string]$TestProjectFilter = '*.Specs.*.csproj',
1414
[switch]$ProdPackagesOnly = $false,
1515
[string[]]$ProductionAssemblies = @(
1616
"Goodtocode.SemanticKernel.Core.Application",
@@ -34,21 +34,27 @@ $reportOutputPath = Join-Path $scriptPath "TestResults\Reports\$timestamp"
3434
New-Item -ItemType Directory -Force -Path $coverageOutputPath
3535
New-Item -ItemType Directory -Force -Path $reportOutputPath
3636

37-
# Find tests for projects with 'Tests.*.csproj'
37+
$solutionFile = Get-ChildItem -Path $scriptPath -Filter *.sln -Recurse | Select-Object -First 1
38+
if ($null -eq $solutionFile) {
39+
Write-Host "No solution file found. Exiting."
40+
exit 1
41+
}
42+
Write-Host "Building solution: $($solutionFile.FullName)"
43+
dotnet build $solutionFile.FullName
44+
3845
$testProjects = Get-ChildItem $scriptPath -Filter $TestProjectFilter -Recurse
3946
Write-Host "Found $($testProjects.Count) test projects."
4047
foreach ($project in $testProjects) {
4148
$testProjectPath = $project.FullName
4249
Write-Host "Running tests for project: $($testProjectPath)"
43-
50+
dotnet test $testProjectPath --no-build
4451
$buildOutput = Join-Path -Path $project.Directory.FullName -ChildPath "bin\Debug\net9.0\$($project.BaseName).dll"
4552
$coverageFile = Join-Path $coverageOutputPath "coverage.cobertura.xml"
4653
Write-Host "Analyzing code coverage for: $buildOutput"
4754
coverlet $buildOutput --target "dotnet" --targetargs "test $($project.FullName) --no-build" --format cobertura --output $coverageFile
4855

4956
}
5057

51-
# Generate HTML report
5258
if ($ProdPackagesOnly) {
5359
$assemblyFilters = ($ProductionAssemblies | ForEach-Object { "+$_" }) -join ";"
5460
$assemblyFilters = ($ProductionAssemblies | ForEach-Object { "+$_" }) -join ";"

src/Presentation.WebApi/Generate-NswagClientCode.ps1

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
param (
1313
[string]$SwaggerJsonPath = 'swagger',
1414
[string]$ApiAssembly = 'bin\Debug\net9.0\Goodtocode.SemanticKernel.Presentation.WebApi.dll',
15-
[string]$ApiVersion = 'v1',
16-
[string]$ClientPathFile = '../Presentation.Blazor/Clients/WebApiClient.g.cs',
17-
[string]$ClientNamespace = 'Goodtocode.SemanticKernel.Presentation.WebApi.Client'
15+
[string]$ApiVersion = 'v1'
1816
)
1917
####################################################################################
2018
Set-ExecutionPolicy Unrestricted -Scope Process -Force

0 commit comments

Comments
 (0)