From df473d29f9967a88e749a1dd5510eb85d218f9db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20L=C3=B3pez?= Date: Sun, 20 Feb 2022 19:42:36 +0100 Subject: [PATCH] CI unit tests (#417) * CI to run unit tests * fixed CI * fixed ci * fixed ci * Upgraded MSTestTestAdapter and MSTestTestFramework * Changed MSBuild configuration (Unit Tests building) to Debug * Fixed "Run Unit Tests" .appxrecipe path Co-authored-by: Etienne BAUDOUX --- ci/azure-pipelines.yml | 26 +++++++++++++++++++++++++- src/Directory.Build.props | 4 ++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/ci/azure-pipelines.yml b/ci/azure-pipelines.yml index 21e4268f05..4b86e71d4c 100644 --- a/ci/azure-pipelines.yml +++ b/ci/azure-pipelines.yml @@ -7,11 +7,12 @@ trigger: - main pool: - vmImage: 'windows-2019' + vmImage: 'windows-2022' variables: group: BuildPipelineVariables uwpProject: '**/*.wapproj' + testProject: '**/*.Tests.csproj' buildPlatform: 'x86|x64|arm64' buildConfiguration: 'Release' appxPackageDir: '$(build.artifactStagingDirectory)\AppxPackages\\' @@ -51,6 +52,29 @@ jobs: /p:UapAppxPackageBuildMode=StoreUpload' maximumCpuCount: true + # Builds unit tests + - task: MSBuild@1 + displayName: 'Build Unit Tests' + inputs: + solution: '$(testProject)' + configuration: 'Debug' + msbuildArguments: '/t:build /restore' + maximumCpuCount: true + + - task: VSTest@2 + displayName: 'Run Unit Tests' + inputs: + testSelector: 'testAssemblies' + testAssemblyVer2: | + **\Debug\**\*.Tests.build.appxrecipe + !**\obj\** + searchFolder: '$(System.DefaultWorkingDirectory)' + otherConsoleOptions: '/Framework:FrameworkUap10' + platform: '$(BuildPlatform)' + configuration: '$(BuildConfiguration)' + diagnosticsEnabled: True + collectDumpOn: always + - task: PublishBuildArtifacts@1 displayName: 'Publish Artifact: drop' inputs: diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 8ec519fae8..e660305aa6 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -28,8 +28,8 @@ 4.4.2 2.6.2 1.3.5 - 2.1.1 - 2.1.1 + 2.2.8 + 2.2.8 12.0.3 2.1.0 1.26.0