From 2c28945ad71caf82e3a88e583147ea5c91a4c8f5 Mon Sep 17 00:00:00 2001 From: Daniel Scott-Raynsford Date: Sat, 25 Jan 2020 11:03:25 +1300 Subject: [PATCH] Change CI pipeline images - fixes #69 --- CHANGELOG.md | 9 +++++ azure-pipelines.yml | 96 +++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 97 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 370c014..89a2bcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Changed CI pipeline HQRM Test image to use `windows-2019` Azure DevOps hosted + image - fixes [issue #69](https://github.com/dsccommunity/WSManDsc/issues/69) +- Changed CI pipeline Unit Test image to use `vs2017-win2016` Azure + DevOps hosted image - fixes [issue #69](https://github.com/dsccommunity/WSManDsc/issues/69) +- Added CI pipeline stages for running Integration and Unit tests on + Windows Server 2016 and Windows Server 2019 respectively. + ## [3.1.0] - 2020-01-15 ### Added diff --git a/azure-pipelines.yml b/azure-pipelines.yml index cf3cbfc..5711452 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -50,7 +50,7 @@ stages: - job: Test_HQRM displayName: 'HQRM' pool: - vmImage: 'win1803' + vmImage: 'windows-2019' timeoutInMinutes: 0 steps: - task: DownloadBuildArtifacts@0 @@ -77,10 +77,90 @@ stages: testRunTitle: 'HQRM' condition: succeededOrFailed() - - job: Test_Unit - displayName: 'Unit' + - job: Test_Unit_2016 + displayName: 'Unit (Windows Server 2016)' + pool: + vmImage: 'vs2017-win2016' + timeoutInMinutes: 0 + steps: + - powershell: | + $repositoryOwner,$repositoryName = $env:BUILD_REPOSITORY_NAME -split '/' + echo "##vso[task.setvariable variable=RepositoryOwner;isOutput=true]$repositoryOwner" + echo "##vso[task.setvariable variable=RepositoryName;isOutput=true]$repositoryName" + name: dscBuildVariable + - task: DownloadBuildArtifacts@0 + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: 'output' + downloadPath: '$(Build.SourcesDirectory)' + + - task: PowerShell@2 + name: test + displayName: 'Run Unit Test' + inputs: + filePath: './build.ps1' + arguments: "-Tasks test -PesterScript 'tests/Unit'" + pwsh: false + + - task: PublishTestResults@2 + displayName: 'Publish Test Results' + inputs: + testResultsFormat: 'NUnit' + testResultsFiles: 'output/testResults/NUnit*.xml' + testRunTitle: 'Unit (Windows Server 2016)' + condition: succeededOrFailed() + + - task: PublishCodeCoverageResults@1 + displayName: 'Publish Code Coverage' + condition: succeededOrFailed() + inputs: + codeCoverageTool: 'JaCoCo' + summaryFileLocation: 'output/testResults/CodeCov*.xml' + pathToSources: '$(Build.SourcesDirectory)/output/$(dscBuildVariable.RepositoryName)' + + - job: Test_Integration_2016 + displayName: 'Integration (Windows Server 2016)' + pool: + vmImage: 'vs2017-win2016' + timeoutInMinutes: 0 + steps: + - task: DownloadBuildArtifacts@0 + displayName: 'Download Build Artifact' + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: 'output' + downloadPath: '$(Build.SourcesDirectory)' + + - task: PowerShell@2 + name: configureWinRM + displayName: 'Configure WinRM' + inputs: + targetType: 'inline' + script: 'winrm quickconfig -quiet' + pwsh: false + + - task: PowerShell@2 + name: test + displayName: 'Run Integration Test' + inputs: + filePath: './build.ps1' + arguments: "-Tasks test -PesterScript 'tests/Integration' -CodeCoverageThreshold 0" + pwsh: false + + - task: PublishTestResults@2 + displayName: 'Publish Test Results' + inputs: + testResultsFormat: 'NUnit' + testResultsFiles: 'output/testResults/NUnit*.xml' + testRunTitle: 'Integration (Windows Server 2016)' + condition: succeededOrFailed() + + - job: Test_Unit_2019 + displayName: 'Unit (Windows Server 2019)' pool: - vmImage: 'win1803' + vmImage: 'windows-2019' timeoutInMinutes: 0 steps: - powershell: | @@ -108,7 +188,7 @@ stages: inputs: testResultsFormat: 'NUnit' testResultsFiles: 'output/testResults/NUnit*.xml' - testRunTitle: 'Unit' + testRunTitle: 'Unit (Windows Server 2019)' condition: succeededOrFailed() - task: PublishCodeCoverageResults@1 @@ -119,8 +199,8 @@ stages: summaryFileLocation: 'output/testResults/CodeCov*.xml' pathToSources: '$(Build.SourcesDirectory)/output/$(dscBuildVariable.RepositoryName)' - - job: Test_Integration - displayName: 'Integration' + - job: Test_Integration_2019 + displayName: 'Integration (Windows Server 2019)' pool: vmImage: 'windows-2019' timeoutInMinutes: 0 @@ -154,7 +234,7 @@ stages: inputs: testResultsFormat: 'NUnit' testResultsFiles: 'output/testResults/NUnit*.xml' - testRunTitle: 'Integration' + testRunTitle: 'Integration (Windows Server 2019)' condition: succeededOrFailed() - stage: Deploy