Skip to content

Commit 98a107a

Browse files
committed
Fixed test execution for new project style
1 parent 164a959 commit 98a107a

File tree

17 files changed

+36
-285
lines changed

17 files changed

+36
-285
lines changed

.build/BuildToolkit.ps1

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ function Invoke-CoverTests($SearchPath = $RootPath, $SearchFilter = "*.csproj",
244244
Write-Step "Starting cover tests from $SearchPath with filter $FilterFile."
245245

246246
if (-not (Test-Path $SearchPath)) {
247-
Write-Host "$SearchPath does not exists, ignoring!";
247+
Write-Host-Warning "$SearchPath does not exists, ignoring!";
248248
return;
249249
}
250250

@@ -336,7 +336,7 @@ function Invoke-CoverTests($SearchPath = $RootPath, $SearchFilter = "*.csproj",
336336
$errorText = "FAILED_TESTS ($exitCode)";
337337
}
338338

339-
Write-Host "Nunit exited with $errorText for $projectName";
339+
Write-Host-Error "Nunit exited with $errorText for $projectName";
340340
Invoke-ExitCodeCheck $exitCode;
341341
}
342342
}
@@ -409,13 +409,16 @@ function Invoke-DocFx($Metadata = [System.IO.Path]::Combine($DocumentationDir, "
409409
CopyAndReplaceFolder $docFxDest "$DocumentationArtifcacts\DocFx";
410410
}
411411

412-
function Invoke-PackSdkProject($ProjectPath, [bool]$IsTool = $False, [bool]$IncludeSymbols = $False) {
412+
function Invoke-PackSdkProject($CsprojFile, [bool]$IncludeSymbols = $False) {
413+
Write-Host "Try to pack .NET SDK project: $($CsprojFile.Name) ...";
414+
413415
# Check if the project should be packed
414-
$csprojFullName = $csprojFile.FullName;
416+
$csprojFullName = $CsprojFile.FullName;
415417
[xml]$csprojContent = Get-Content $csprojFullName
416418
$createPackage = $csprojContent.Project.PropertyGroup.CreatePackage;
417419
;
418420
if ($null -eq $createPackage -or "false" -eq $createPackage) {
421+
Write-Host-Warning "... csproj not flagged with <CreatePackage>true</CreatePackage>: $($CsprojFile.Name)";
419422
return;
420423
}
421424

@@ -433,11 +436,13 @@ function Invoke-PackSdkProject($ProjectPath, [bool]$IsTool = $False, [bool]$Incl
433436
Invoke-ExitCodeCheck $LastExitCode;
434437
}
435438

436-
function Invoke-PackFrameworkProject($ProjectPath, [bool]$IsTool = $False, [bool]$IncludeSymbols = $False) {
439+
function Invoke-PackFrameworkProject($CsprojFile, [bool]$IsTool = $False, [bool]$IncludeSymbols = $False) {
440+
Write-Host "Try to pack .NET Framework project: $CsprojFile.Name ...";
437441

438442
# Check if there is a matching nuspec for the proj
439-
$nuspecPath = [IO.Path]::ChangeExtension($ProjectPath, "nuspec")
443+
$nuspecPath = [IO.Path]::ChangeExtension($CsprojFile.FullName, "nuspec")
440444
if(-not (Test-Path $nuspecPath)) {
445+
Write-Host-Warning "Nuspec for project not found: $CsprojFile.Name";
441446
return;
442447
}
443448

@@ -464,7 +469,7 @@ function Invoke-Pack($ProjectPath, [bool]$IsTool = $False, [bool]$IncludeSymbols
464469
CreateFolderIfNotExists $NugetPackageArtifacts;
465470

466471
if (Get-CsprojIsSdkProject($ProjectPath)) {
467-
Invoke-PackSdkProject $ProjectPath $IsTool $IncludeSymbols;
472+
Invoke-PackSdkProject $ProjectPath $IncludeSymbols;
468473
}
469474
else {
470475
Invoke-PackFrameworkProject $ProjectPath $IsTool $IncludeSymbols;
@@ -483,7 +488,7 @@ function Invoke-Publish {
483488
Write-Host "Pushing packages from $NugetPackageArtifacts to $env:MORYX_PACKAGE_TARGET"
484489

485490
if ([string]::IsNullOrEmpty($env:MORYX_PACKAGE_TARGET)) {
486-
Write-Host "There is no package target given. Set the environment varialble MORYX_PACKAGE_TARGET to publish packages.";
491+
Write-Host-Error "There is no package target given. Set the environment varialble MORYX_PACKAGE_TARGET to publish packages.";
487492
Invoke-ExitCodeCheck 1;
488493
}
489494

.build/Common.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
<RepositoryUrl>https://github.com/PHOENIXCONTACT/MORYX-Platform</RepositoryUrl>
2525

2626
<PackageIcon>moryx-logo.png</PackageIcon>
27-
<PackageIconUrl>https://www.phoenixcontact.com/favicon.ico</PackageIconUrl>
2827
<PackageProjectUrl>https://moryx-industry.net/</PackageProjectUrl>
2928
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
3029
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>

.github/workflows/build-and-test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ jobs:
6262
- name: Codecov
6363
uses: codecov/codecov-action@v1
6464
with:
65-
files: './artifacts/Tests/*.OpenCover.xml'
65+
files: ./artifacts/Tests/Moryx.Container.Tests.OpenCover.xml,./artifacts/Tests/Moryx.Model.Tests.OpenCover.xml,./artifacts/Tests/Moryx.Runtime.Kernel.Tests.OpenCover.xml,./artifacts/Tests/Moryx.Runtime.Tests.OpenCover.xml,./artifacts/Tests/Moryx.Tests.OpenCover.xml,./artifacts/Tests/Moryx.Tools.Wcf.Tests.OpenCover.xml,./artifacts/Tests/Moryx.Communication.Sockets.IntegrationTests.OpenCover
66+
6667
Publish:
6768
needs: [Test]
6869
if: ${{ github.event_name == 'push' }}

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"script": "${workspaceRoot}\\Build.ps1",
6060
"args": ["-Pack"],
6161
"cwd": "${workspaceRoot}"
62-
}
62+
},
6363
{
6464
"type": "PowerShell",
6565
"request": "launch",

GlobalAssemblyInfo.cs

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/Tests/Moryx.Communication.Sockets.IntegrationTests/Moryx.Communication.Sockets.IntegrationTests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.0" />
11-
<PackageReference Include="Moq" Version="4.14.5" />
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
11+
<PackageReference Include="Moq" Version="4.14.6" />
1212
<PackageReference Include="NUnit" Version="3.12.0" />
1313
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
1414
</ItemGroup>

src/Tests/Moryx.Container.Tests/Moryx.Container.Tests.csproj

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.0" />
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
1111
<PackageReference Include="NUnit" Version="3.12.0" />
12-
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0">
13-
<PrivateAssets>all</PrivateAssets>
14-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
15-
</PackageReference>
12+
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
1613
</ItemGroup>
1714

1815
<ItemGroup>

src/Tests/Moryx.Model.Tests/Moryx.Model.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.0" />
11-
<PackageReference Include="Moq" Version="4.14.5" />
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
11+
<PackageReference Include="Moq" Version="4.14.6" />
1212
<PackageReference Include="NUnit" Version="3.12.0" />
1313
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
1414
</ItemGroup>

src/Tests/Moryx.Runtime.Kernel.Tests/Moryx.Runtime.Kernel.Tests.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
<PropertyGroup>
44
<OutputType>Library</OutputType>
55
<TargetFramework>netcoreapp3.1</TargetFramework>
6-
<StartupObject />
76
<DebugType>full</DebugType>
87
</PropertyGroup>
98

109
<ItemGroup>
11-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.0" />
12-
<PackageReference Include="Moq" Version="4.14.5" />
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
11+
<PackageReference Include="Moq" Version="4.14.6" />
1312
<PackageReference Include="NUnit" Version="3.12.0" />
1413
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
1514
</ItemGroup>

src/Tests/Moryx.Runtime.SystemTests/Moryx.Runtime.SystemTests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
<PropertyGroup>
44
<TargetFramework>net45</TargetFramework>
5+
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
56
<DebugType>full</DebugType>
67
</PropertyGroup>
78

89
<ItemGroup>
9-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.0" />
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
1011
<PackageReference Include="NUnit" Version="3.12.0" />
1112
</ItemGroup>
1213

src/Tests/Moryx.Runtime.Tests/Moryx.Runtime.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.0" />
11-
<PackageReference Include="Moq" Version="4.14.5" />
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
11+
<PackageReference Include="Moq" Version="4.14.6" />
1212
<PackageReference Include="NUnit" Version="3.12.0" />
1313
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
1414
</ItemGroup>

src/Tests/Moryx.Tests/Moryx.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.0" />
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
1111
<PackageReference Include="NUnit" Version="3.12.0" />
1212
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
1313
</ItemGroup>

0 commit comments

Comments
 (0)