Browse Source

Merge pull request #17 from flabbet/dev

Azure pipelines codecov support
Krzysztof Krysiński 5 years ago
parent
commit
ee9a0d85b1
2 changed files with 19 additions and 14 deletions
  1. 9 12
      PixiEditorTests/PixiEditorTests.csproj
  2. 10 2
      azure-pipelines.yml

+ 9 - 12
PixiEditorTests/PixiEditorTests.csproj

@@ -6,26 +6,23 @@
     <IsPackable>false</IsPackable>
   </PropertyGroup>
 
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
-    <DebugType>full</DebugType>
-    <DebugSymbols>true</DebugSymbols>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
+    <DebugType>full</DebugType>
+    <DebugSymbols>true</DebugSymbols>
   </PropertyGroup>
 
   <ItemGroup>
     <PackageReference Include="Codecov" Version="1.12.0" />
-    <PackageReference Include="coverlet.msbuild" Version="2.9.0">
-      <PrivateAssets>all</PrivateAssets>
-      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
-    </PackageReference>
     <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8">
       <PrivateAssets>all</PrivateAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
     </PackageReference>
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
+    <PackageReference Include="OpenCover" Version="4.7.922" />
     <PackageReference Include="xunit" Version="2.4.1" />
-    <PackageReference Include="xunit.runner.visualstudio" Version="2.4.2">
-      <PrivateAssets>all</PrivateAssets>
-      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+    <PackageReference Include="xunit.runner.visualstudio" Version="2.4.2">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
     </PackageReference>
     <PackageReference Include="Xunit.StaFact" Version="0.3.18" />
   </ItemGroup>
@@ -35,8 +32,8 @@
     <Folder Include="ViewModelsTests\" />
   </ItemGroup>
 
-  <ItemGroup>
-    <ProjectReference Include="..\PixiEditor\PixiEditor.csproj" />
+  <ItemGroup>
+    <ProjectReference Include="..\PixiEditor\PixiEditor.csproj" />
   </ItemGroup>
 
 </Project>

+ 10 - 2
azure-pipelines.yml

@@ -30,11 +30,19 @@ steps:
     projects: '**/*.csproj'
     arguments: '--configuration Release'
 
+- task: DotNetCoreCLI@2
+  displayName: Tests
+  inputs:
+    command: test
+    projects: '**/*Tests/*.csproj'
+    arguments: '--configuration $(buildConfiguration)'
+
 - task: PowerShell@2
   inputs:
-    filePath: '$env:userprofile\.nuget\packages\opencover\4.7.922\tools\OpenCover.Console.exe'
-    arguments: '-register:user -target:"$env:programfiles/dotnet/dotnet.exe" -targetargs:test -filter:"+[*]*" -output:".\PixiEditor_coverage.xml" -oldstyle'
+    targetType: 'inline'
+    script: '& "$env:userprofile\.nuget\packages\opencover\4.7.922\tools\OpenCover.Console.exe" -register -target:"$env:programfiles/dotnet/dotnet.exe" -targetargs:test -filter:"+[*]*" -output:".\PixiEditor_coverage.xml" -oldstyle'
     workingDirectory: 'PixiEditorTests\'
+  displayName: Collect code coverage
 
 - task: CmdLine@2
   inputs: