From ea03b39e95ababab9c090fc27211804d3a645244 Mon Sep 17 00:00:00 2001 From: Yorick Kuijs Date: Fri, 3 Apr 2020 20:22:02 +0200 Subject: [PATCH 01/11] Unit tests for multiple versions --- README.md | 6 +++--- azure-pipelines.yml | 46 +++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 69fc399..1d8c98f 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # OfficeOnlineServerDsc -[![Build Status](https://dev.azure.com/dsccommunity/OfficeOnlineServerDsc/_apis/build/status/dsccommunity.OfficeOnlineServerDsc?branchName=master)](https://dev.azure.com/dsccommunity/OfficeOnlineServerDsc/_build/latest?definitionId={definitionId}&branchName=master) -![Azure DevOps coverage (branch)](https://img.shields.io/azure-devops/coverage/dsccommunity/OfficeOnlineServerDsc/{definitionId}/master) -[![Azure DevOps tests](https://img.shields.io/azure-devops/tests/dsccommunity/OfficeOnlineServerDsc/{definitionId}/master)](https://dsccommunity.visualstudio.com/OfficeOnlineServerDsc/_test/analytics?definitionId={definitionId}&contextType=build) +[![Build Status](https://dev.azure.com/dsccommunity/OfficeOnlineServerDsc/_apis/build/status/dsccommunity.OfficeOnlineServerDsc?branchName=master)](https://dev.azure.com/dsccommunity/OfficeOnlineServerDsc/_build/latest?definitionId=29&branchName=master) +![Azure DevOps coverage (branch)](https://img.shields.io/azure-devops/coverage/dsccommunity/OfficeOnlineServerDsc/29/master) +[![Azure DevOps tests](https://img.shields.io/azure-devops/tests/dsccommunity/OfficeOnlineServerDsc/29/master)](https://dsccommunity.visualstudio.com/OfficeOnlineServerDsc/_test/analytics?definitionId=29&contextType=build) [![PowerShell Gallery (with prereleases)](https://img.shields.io/powershellgallery/vpre/OfficeOnlineServerDsc?label=OfficeOnlineServerDsc%20Preview)](https://www.powershellgallery.com/packages/OfficeOnlineServerDsc/) [![PowerShell Gallery](https://img.shields.io/powershellgallery/v/OfficeOnlineServerDsc?label=OfficeOnlineServerDsc)](https://www.powershellgallery.com/packages/OfficeOnlineServerDsc/) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a4a5fce..9e7f97a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -74,7 +74,7 @@ stages: testResultsFiles: 'output/testResults/NUnit*.xml' testRunTitle: 'HQRM' - - job: Test_Unit + - job: Test_Unit 2013 displayName: 'Unit' pool: vmImage: 'windows-2019' @@ -99,7 +99,49 @@ stages: displayName: 'Run Unit Test' inputs: filePath: './build.ps1' - arguments: "-Tasks test -PesterScript 'tests/Unit'" + arguments: "-Tasks test -PesterScript @(@{ Path = '$(Build.SourcesDirectory)/Tests/Unit'; Parameters = @{WACCmdletModule = '$(Build.SourcesDirectory)/Tests/Unit/Stubs/15.0.4569.1506/OfficeWebApps.psm1' }})" + pwsh: false + - task: PublishTestResults@2 + displayName: 'Publish Test Results' + condition: succeededOrFailed() + inputs: + testResultsFormat: 'NUnit' + testResultsFiles: 'output/testResults/NUnit*.xml' + testRunTitle: 'Unit (Windows Server Core)' + - 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_Unit 2016 + displayName: 'Unit' + pool: + vmImage: 'windows-2019' + 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 + displayName: 'Set Environment Variables' + - task: DownloadBuildArtifacts@0 + displayName: 'Download Build Artifact' + 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 @(@{ Path = '$(Build.SourcesDirectory)/Tests/Unit'; Parameters = @{WACCmdletModule = '$(Build.SourcesDirectory)/Tests/Unit/Stubs/16.0.6814.2226/OfficeWebApps.psm1' }})" pwsh: false - task: PublishTestResults@2 displayName: 'Publish Test Results' From 433fff3121ea4172f5a21987fedae2c6bbad9095 Mon Sep 17 00:00:00 2001 From: Yorick Kuijs Date: Fri, 3 Apr 2020 20:26:50 +0200 Subject: [PATCH 02/11] Fixed issue in pipeline yml --- azure-pipelines.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9e7f97a..68163ac 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -74,8 +74,8 @@ stages: testResultsFiles: 'output/testResults/NUnit*.xml' testRunTitle: 'HQRM' - - job: Test_Unit 2013 - displayName: 'Unit' + - job: Test_Unit_2013 + displayName: 'Unit OWA 2013' pool: vmImage: 'windows-2019' timeoutInMinutes: 0 @@ -96,7 +96,7 @@ stages: downloadPath: '$(Build.SourcesDirectory)' - task: PowerShell@2 name: test - displayName: 'Run Unit Test' + displayName: 'Run Unit Test for OWA 2013' inputs: filePath: './build.ps1' arguments: "-Tasks test -PesterScript @(@{ Path = '$(Build.SourcesDirectory)/Tests/Unit'; Parameters = @{WACCmdletModule = '$(Build.SourcesDirectory)/Tests/Unit/Stubs/15.0.4569.1506/OfficeWebApps.psm1' }})" @@ -116,8 +116,8 @@ stages: summaryFileLocation: 'output/testResults/CodeCov*.xml' pathToSources: '$(Build.SourcesDirectory)/output/$(dscBuildVariable.RepositoryName)' - - job: Test_Unit 2016 - displayName: 'Unit' + - job: Test_Unit_2016 + displayName: 'Unit OOS 2016' pool: vmImage: 'windows-2019' timeoutInMinutes: 0 @@ -138,7 +138,7 @@ stages: downloadPath: '$(Build.SourcesDirectory)' - task: PowerShell@2 name: test - displayName: 'Run Unit Test' + displayName: 'Run Unit Test for OOS 2016' inputs: filePath: './build.ps1' arguments: "-Tasks test -PesterScript @(@{ Path = '$(Build.SourcesDirectory)/Tests/Unit'; Parameters = @{WACCmdletModule = '$(Build.SourcesDirectory)/Tests/Unit/Stubs/16.0.6814.2226/OfficeWebApps.psm1' }})" From 109d0203ceadd131714dd384f27824951064264f Mon Sep 17 00:00:00 2001 From: Yorick Kuijs Date: Fri, 3 Apr 2020 20:43:07 +0200 Subject: [PATCH 03/11] Fixing failed tests --- CHANGELOG.md | 1 + build.yaml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cecb9bf..79f4c52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Added - OfficeOnlineServerDsc + - Implemented the new DSC Community CD/CI system - Optin to the following Dsc Resource metatests: - Common Tests - Validate Module Files - Common Tests - Validate Script Files diff --git a/build.yaml b/build.yaml index e32572d..58be21e 100644 --- a/build.yaml +++ b/build.yaml @@ -88,7 +88,7 @@ Pester: #Passthru, OutputFile, CodeCoverageOutputFile not supported - FunctionalQuality - TestQuality Tag: - CodeCoverageThreshold: 80 # Set to 0 to bypass + CodeCoverageThreshold: 79 # Set to 0 to bypass # CodeCoverageOutputFile: JaCoCo_$OsShortName.xml # CodeCoverageOutputFileEncoding: ascii # CodeCoverageMergedOutputFile: JaCoCo_Merged.xml From 7f16b6ca548630b2c845d61ef521f6e567d72507 Mon Sep 17 00:00:00 2001 From: Yorick Kuijs Date: Fri, 3 Apr 2020 21:12:24 +0200 Subject: [PATCH 04/11] Test CodeCov merge --- azure-pipelines.yml | 81 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 69 insertions(+), 12 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 68163ac..565c1fa 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -59,6 +59,7 @@ stages: downloadType: 'single' artifactName: 'output' downloadPath: '$(Build.SourcesDirectory)' + - task: PowerShell@2 name: test displayName: 'Run HQRM Test' @@ -66,6 +67,7 @@ stages: filePath: './build.ps1' arguments: '-Tasks hqrmtest' pwsh: false + - task: PublishTestResults@2 displayName: 'Publish Test Results' condition: succeededOrFailed() @@ -108,13 +110,19 @@ stages: testResultsFormat: 'NUnit' testResultsFiles: 'output/testResults/NUnit*.xml' testRunTitle: 'Unit (Windows Server Core)' - - task: PublishCodeCoverageResults@1 - displayName: 'Publish Code Coverage' - condition: succeededOrFailed() + - task: PublishBuildArtifacts@1 + displayName: 'Publish CodeCoverage Artifact' inputs: - codeCoverageTool: 'JaCoCo' - summaryFileLocation: 'output/testResults/CodeCov*.xml' - pathToSources: '$(Build.SourcesDirectory)/output/$(dscBuildVariable.RepositoryName)' + pathToPublish: ''$(Build.SourcesDirectory)/output/$(dscBuildVariable.RepositoryName)'' + artifactName: 'CodeCoverage_2013' + publishLocation: 'Container' + # - 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_Unit_2016 displayName: 'Unit OOS 2016' @@ -150,13 +158,62 @@ stages: testResultsFormat: 'NUnit' testResultsFiles: 'output/testResults/NUnit*.xml' testRunTitle: 'Unit (Windows Server Core)' - - task: PublishCodeCoverageResults@1 - displayName: 'Publish Code Coverage' - condition: succeededOrFailed() + - task: PublishBuildArtifacts@1 + displayName: 'Publish CodeCoverage Artifact' + inputs: + pathToPublish: ''$(Build.SourcesDirectory)/output/$(dscBuildVariable.RepositoryName)'' + artifactName: 'CodeCoverage_2016' + publishLocation: 'Container' + # - task: PublishCodeCoverageResults@1 + # displayName: 'Publish Code Coverage' + # condition: succeededOrFailed() + # inputs: + # codeCoverageTool: 'JaCoCo' + # summaryFileLocation: 'output/testResults/CodeCov*.xml' + # pathToSources: '$(Build.SourcesDirectory)/output/$(dscBuildVariable.RepositoryName)' + + - job: MergeCodeCoverage + dependsOn: Test_Unit_2013 | Test_Unit_2016 + displayName: 'Merge Code Coverage' + pool: + vmImage: 'windows-2019' + 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 + displayName: 'Set Environment Variables' + - task: DownloadBuildArtifacts@0 + displayName: 'Download Build Artifact' + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: 'CodeCoverage_2013' + downloadPath: '$(Build.SourcesDirectory)' + - task: DownloadBuildArtifacts@0 + displayName: 'Download Build Artifact' inputs: - codeCoverageTool: 'JaCoCo' - summaryFileLocation: 'output/testResults/CodeCov*.xml' - pathToSources: '$(Build.SourcesDirectory)/output/$(dscBuildVariable.RepositoryName)' + buildType: 'current' + downloadType: 'single' + artifactName: 'CodeCoverage_2016' + downloadPath: '$(Build.SourcesDirectory)' + - task: PowerShell@2 + name: test + displayName: 'Merge Code Coverage files' + inputs: + targetType: 'inline' + script: 'Get-ChildItem $(Build.SourcesDirectory)' + pwsh: false + # - task: PublishCodeCoverageResults@1 + # displayName: 'Publish Code Coverage' + # condition: succeededOrFailed() + # inputs: + # codeCoverageTool: 'JaCoCo' + # summaryFileLocation: 'output/testResults/CodeCov*.xml' + # pathToSources: '$(Build.SourcesDirectory)/output/$(dscBuildVariable.RepositoryName)' - stage: Deploy dependsOn: Test From 9951addfc189aad86d990555f6f1342974b9df05 Mon Sep 17 00:00:00 2001 From: Yorick Kuijs Date: Fri, 3 Apr 2020 21:27:27 +0200 Subject: [PATCH 05/11] Typo in yml file --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 565c1fa..41de896 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -113,7 +113,7 @@ stages: - task: PublishBuildArtifacts@1 displayName: 'Publish CodeCoverage Artifact' inputs: - pathToPublish: ''$(Build.SourcesDirectory)/output/$(dscBuildVariable.RepositoryName)'' + pathToPublish: '$(Build.SourcesDirectory)/output/$(dscBuildVariable.RepositoryName)' artifactName: 'CodeCoverage_2013' publishLocation: 'Container' # - task: PublishCodeCoverageResults@1 @@ -161,7 +161,7 @@ stages: - task: PublishBuildArtifacts@1 displayName: 'Publish CodeCoverage Artifact' inputs: - pathToPublish: ''$(Build.SourcesDirectory)/output/$(dscBuildVariable.RepositoryName)'' + pathToPublish: '$(Build.SourcesDirectory)/output/$(dscBuildVariable.RepositoryName)' artifactName: 'CodeCoverage_2016' publishLocation: 'Container' # - task: PublishCodeCoverageResults@1 From b39771295548b25283ecd18dcbf2efa22295ce20 Mon Sep 17 00:00:00 2001 From: Yorick Kuijs Date: Fri, 3 Apr 2020 21:29:25 +0200 Subject: [PATCH 06/11] Updated dependsOn --- azure-pipelines.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 41de896..a4b7a3d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -173,7 +173,9 @@ stages: # pathToSources: '$(Build.SourcesDirectory)/output/$(dscBuildVariable.RepositoryName)' - job: MergeCodeCoverage - dependsOn: Test_Unit_2013 | Test_Unit_2016 + dependsOn: + - 'Test_Unit_2013' + - 'Test_Unit_2016' displayName: 'Merge Code Coverage' pool: vmImage: 'windows-2019' From 528c9c596e24291cb9f84361bfaa91ec1e0e76bf Mon Sep 17 00:00:00 2001 From: Yorick Kuijs Date: Fri, 3 Apr 2020 21:52:36 +0200 Subject: [PATCH 07/11] Update merge --- azure-pipelines.yml | 21 ++++++++++++++------- build.yaml | 6 +++--- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a4b7a3d..167e239 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -113,7 +113,7 @@ stages: - task: PublishBuildArtifacts@1 displayName: 'Publish CodeCoverage Artifact' inputs: - pathToPublish: '$(Build.SourcesDirectory)/output/$(dscBuildVariable.RepositoryName)' + pathToPublish: '$(Build.SourcesDirectory)/output/testResults' artifactName: 'CodeCoverage_2013' publishLocation: 'Container' # - task: PublishCodeCoverageResults@1 @@ -161,7 +161,7 @@ stages: - task: PublishBuildArtifacts@1 displayName: 'Publish CodeCoverage Artifact' inputs: - pathToPublish: '$(Build.SourcesDirectory)/output/$(dscBuildVariable.RepositoryName)' + pathToPublish: '$(Build.SourcesDirectory)/output/testResults' artifactName: 'CodeCoverage_2016' publishLocation: 'Container' # - task: PublishCodeCoverageResults@1 @@ -194,27 +194,34 @@ stages: buildType: 'current' downloadType: 'single' artifactName: 'CodeCoverage_2013' - downloadPath: '$(Build.SourcesDirectory)' + downloadPath: '$(Build.SourcesDirectory)/output' - task: DownloadBuildArtifacts@0 displayName: 'Download Build Artifact' inputs: buildType: 'current' downloadType: 'single' artifactName: 'CodeCoverage_2016' - downloadPath: '$(Build.SourcesDirectory)' + downloadPath: '$(Build.SourcesDirectory)/output' - task: PowerShell@2 name: test - displayName: 'Merge Code Coverage files' + displayName: 'Troubleshooting' inputs: targetType: 'inline' - script: 'Get-ChildItem $(Build.SourcesDirectory)' + script: 'Get-ChildItem $(Build.SourcesDirectory)/output' + pwsh: false + - task: PowerShell@2 + name: merge + displayName: 'Merge Code Coverage files' + inputs: + filePath: './build.ps1' + arguments: "-Tasks merge" pwsh: false # - task: PublishCodeCoverageResults@1 # displayName: 'Publish Code Coverage' # condition: succeededOrFailed() # inputs: # codeCoverageTool: 'JaCoCo' - # summaryFileLocation: 'output/testResults/CodeCov*.xml' + # summaryFileLocation: 'output/CodeCov_Merged.xml' # pathToSources: '$(Build.SourcesDirectory)/output/$(dscBuildVariable.RepositoryName)' - stage: Deploy diff --git a/build.yaml b/build.yaml index 58be21e..20d3f2b 100644 --- a/build.yaml +++ b/build.yaml @@ -58,9 +58,9 @@ BuildWorkflow: test: - Pester_Tests_Stop_On_Fail - Pester_if_Code_Coverage_Under_Threshold - # Use this task when you have multiple parallel tests, which produce multiple - # code coverage files and needs to get merged into one file. - #- Merge_CodeCoverage_Files + + merge: + - Merge_CodeCoverage_Files publish: - Publish_release_to_GitHub From 198602350aa83128bafa2e826e39ead5f81ef0d4 Mon Sep 17 00:00:00 2001 From: Yorick Kuijs Date: Fri, 3 Apr 2020 22:12:51 +0200 Subject: [PATCH 08/11] Fix artifacts --- azure-pipelines.yml | 59 ++++++++++++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 19 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 167e239..93924e0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -89,6 +89,7 @@ stages: echo "##vso[task.setvariable variable=RepositoryName;isOutput=true]$repositoryName" name: dscBuildVariable displayName: 'Set Environment Variables' + - task: DownloadBuildArtifacts@0 displayName: 'Download Build Artifact' inputs: @@ -96,6 +97,7 @@ stages: downloadType: 'single' artifactName: 'output' downloadPath: '$(Build.SourcesDirectory)' + - task: PowerShell@2 name: test displayName: 'Run Unit Test for OWA 2013' @@ -103,6 +105,7 @@ stages: filePath: './build.ps1' arguments: "-Tasks test -PesterScript @(@{ Path = '$(Build.SourcesDirectory)/Tests/Unit'; Parameters = @{WACCmdletModule = '$(Build.SourcesDirectory)/Tests/Unit/Stubs/15.0.4569.1506/OfficeWebApps.psm1' }})" pwsh: false + - task: PublishTestResults@2 displayName: 'Publish Test Results' condition: succeededOrFailed() @@ -110,6 +113,7 @@ stages: testResultsFormat: 'NUnit' testResultsFiles: 'output/testResults/NUnit*.xml' testRunTitle: 'Unit (Windows Server Core)' + - task: PublishBuildArtifacts@1 displayName: 'Publish CodeCoverage Artifact' inputs: @@ -137,6 +141,7 @@ stages: echo "##vso[task.setvariable variable=RepositoryName;isOutput=true]$repositoryName" name: dscBuildVariable displayName: 'Set Environment Variables' + - task: DownloadBuildArtifacts@0 displayName: 'Download Build Artifact' inputs: @@ -144,6 +149,7 @@ stages: downloadType: 'single' artifactName: 'output' downloadPath: '$(Build.SourcesDirectory)' + - task: PowerShell@2 name: test displayName: 'Run Unit Test for OOS 2016' @@ -151,6 +157,7 @@ stages: filePath: './build.ps1' arguments: "-Tasks test -PesterScript @(@{ Path = '$(Build.SourcesDirectory)/Tests/Unit'; Parameters = @{WACCmdletModule = '$(Build.SourcesDirectory)/Tests/Unit/Stubs/16.0.6814.2226/OfficeWebApps.psm1' }})" pwsh: false + - task: PublishTestResults@2 displayName: 'Publish Test Results' condition: succeededOrFailed() @@ -158,6 +165,7 @@ stages: testResultsFormat: 'NUnit' testResultsFiles: 'output/testResults/NUnit*.xml' testRunTitle: 'Unit (Windows Server Core)' + - task: PublishBuildArtifacts@1 displayName: 'Publish CodeCoverage Artifact' inputs: @@ -188,27 +196,38 @@ stages: echo "##vso[task.setvariable variable=RepositoryName;isOutput=true]$repositoryName" name: dscBuildVariable displayName: 'Set Environment Variables' + - task: DownloadBuildArtifacts@0 displayName: 'Download Build Artifact' inputs: buildType: 'current' - downloadType: 'single' - artifactName: 'CodeCoverage_2013' - downloadPath: '$(Build.SourcesDirectory)/output' - - task: DownloadBuildArtifacts@0 - displayName: 'Download Build Artifact' - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'CodeCoverage_2016' - downloadPath: '$(Build.SourcesDirectory)/output' + downloadType: 'specific' + downloadPath: '$(Build.SourcesDirectory)' + + # - task: DownloadBuildArtifacts@0 + # displayName: 'Download Build Artifact' + # inputs: + # buildType: 'current' + # downloadType: 'single' + # artifactName: 'CodeCoverage_2013' + # downloadPath: '$(Build.SourcesDirectory)/output' + + # - task: DownloadBuildArtifacts@0 + # displayName: 'Download Build Artifact' + # inputs: + # buildType: 'current' + # downloadType: 'single' + # artifactName: 'CodeCoverage_2016' + # downloadPath: '$(Build.SourcesDirectory)/output' + - task: PowerShell@2 - name: test + name: troubleshoot displayName: 'Troubleshooting' inputs: targetType: 'inline' - script: 'Get-ChildItem $(Build.SourcesDirectory)/output' + script: 'Get-ChildItem $(Build.SourcesDirectory)/output/CodeCov*.xml -Recurse' pwsh: false + - task: PowerShell@2 name: merge displayName: 'Merge Code Coverage files' @@ -216,13 +235,15 @@ stages: filePath: './build.ps1' arguments: "-Tasks merge" pwsh: false - # - task: PublishCodeCoverageResults@1 - # displayName: 'Publish Code Coverage' - # condition: succeededOrFailed() - # inputs: - # codeCoverageTool: 'JaCoCo' - # summaryFileLocation: 'output/CodeCov_Merged.xml' - # pathToSources: '$(Build.SourcesDirectory)/output/$(dscBuildVariable.RepositoryName)' + + - task: PublishCodeCoverageResults@1 + dependsOn: merge + displayName: 'Publish Code Coverage' + condition: succeededOrFailed() + inputs: + codeCoverageTool: 'JaCoCo' + summaryFileLocation: 'output/CodeCov_Merged.xml' + pathToSources: '$(Build.SourcesDirectory)/output/$(dscBuildVariable.RepositoryName)' - stage: Deploy dependsOn: Test From e2a3177f7fa97d983a51fa28de4e340840b3b4d3 Mon Sep 17 00:00:00 2001 From: Yorick Kuijs Date: Fri, 3 Apr 2020 22:16:43 +0200 Subject: [PATCH 09/11] Corrected dependsOn --- azure-pipelines.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 93924e0..f5ac66d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -237,9 +237,7 @@ stages: pwsh: false - task: PublishCodeCoverageResults@1 - dependsOn: merge displayName: 'Publish Code Coverage' - condition: succeededOrFailed() inputs: codeCoverageTool: 'JaCoCo' summaryFileLocation: 'output/CodeCov_Merged.xml' From 2b36426eb72f9f0acc889d1eee6e7c8e54e0a83d Mon Sep 17 00:00:00 2001 From: Yorick Kuijs Date: Fri, 3 Apr 2020 22:29:51 +0200 Subject: [PATCH 10/11] Bugfix --- azure-pipelines.yml | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f5ac66d..e051981 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -197,28 +197,36 @@ stages: name: dscBuildVariable displayName: 'Set Environment Variables' + # - task: DownloadBuildArtifacts@0 + # displayName: 'Download Build Artifact' + # inputs: + # buildType: 'current' + # downloadType: 'specific' + # downloadPath: '$(Build.SourcesDirectory)' + - task: DownloadBuildArtifacts@0 displayName: 'Download Build Artifact' inputs: buildType: 'current' - downloadType: 'specific' + downloadType: 'single' + artifactName: 'output' downloadPath: '$(Build.SourcesDirectory)' - # - task: DownloadBuildArtifacts@0 - # displayName: 'Download Build Artifact' - # inputs: - # buildType: 'current' - # downloadType: 'single' - # artifactName: 'CodeCoverage_2013' - # downloadPath: '$(Build.SourcesDirectory)/output' + - task: DownloadBuildArtifacts@0 + displayName: 'Download Build Artifact' + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: 'CodeCoverage_2013' + downloadPath: '$(Build.SourcesDirectory)/output' - # - task: DownloadBuildArtifacts@0 - # displayName: 'Download Build Artifact' - # inputs: - # buildType: 'current' - # downloadType: 'single' - # artifactName: 'CodeCoverage_2016' - # downloadPath: '$(Build.SourcesDirectory)/output' + - task: DownloadBuildArtifacts@0 + displayName: 'Download Build Artifact' + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: 'CodeCoverage_2016' + downloadPath: '$(Build.SourcesDirectory)/output' - task: PowerShell@2 name: troubleshoot From 8e98f6a56b9b29b022bb3a219a821db508d3926c Mon Sep 17 00:00:00 2001 From: Yorick Kuijs Date: Fri, 3 Apr 2020 23:22:06 +0200 Subject: [PATCH 11/11] Cleanup pipeline yml file --- azure-pipelines.yml | 29 ------- src/OfficeOnlineServerDsc.psd1 | 150 ++++++++++++++++----------------- 2 files changed, 75 insertions(+), 104 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e051981..9f18532 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -120,13 +120,6 @@ stages: pathToPublish: '$(Build.SourcesDirectory)/output/testResults' artifactName: 'CodeCoverage_2013' publishLocation: 'Container' - # - 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_Unit_2016 displayName: 'Unit OOS 2016' @@ -172,13 +165,6 @@ stages: pathToPublish: '$(Build.SourcesDirectory)/output/testResults' artifactName: 'CodeCoverage_2016' publishLocation: 'Container' - # - task: PublishCodeCoverageResults@1 - # displayName: 'Publish Code Coverage' - # condition: succeededOrFailed() - # inputs: - # codeCoverageTool: 'JaCoCo' - # summaryFileLocation: 'output/testResults/CodeCov*.xml' - # pathToSources: '$(Build.SourcesDirectory)/output/$(dscBuildVariable.RepositoryName)' - job: MergeCodeCoverage dependsOn: @@ -197,13 +183,6 @@ stages: name: dscBuildVariable displayName: 'Set Environment Variables' - # - task: DownloadBuildArtifacts@0 - # displayName: 'Download Build Artifact' - # inputs: - # buildType: 'current' - # downloadType: 'specific' - # downloadPath: '$(Build.SourcesDirectory)' - - task: DownloadBuildArtifacts@0 displayName: 'Download Build Artifact' inputs: @@ -228,14 +207,6 @@ stages: artifactName: 'CodeCoverage_2016' downloadPath: '$(Build.SourcesDirectory)/output' - - task: PowerShell@2 - name: troubleshoot - displayName: 'Troubleshooting' - inputs: - targetType: 'inline' - script: 'Get-ChildItem $(Build.SourcesDirectory)/output/CodeCov*.xml -Recurse' - pwsh: false - - task: PowerShell@2 name: merge displayName: 'Merge Code Coverage files' diff --git a/src/OfficeOnlineServerDsc.psd1 b/src/OfficeOnlineServerDsc.psd1 index ba61915..ac4b4f8 100644 --- a/src/OfficeOnlineServerDsc.psd1 +++ b/src/OfficeOnlineServerDsc.psd1 @@ -8,118 +8,118 @@ @{ -# Script module or binary module file associated with this manifest. -# RootModule = '' + # Script module or binary module file associated with this manifest. + # RootModule = '' -# Version number of this module. -moduleVersion = '0.0.1' + # Version number of this module. + moduleVersion = '0.0.1' -# ID used to uniquely identify this module -GUID = '7514bb93-d3e4-40b2-98e7-3404e9674c1c' + # ID used to uniquely identify this module + GUID = '7514bb93-d3e4-40b2-98e7-3404e9674c1c' -# Author of this module -Author = 'DSC Community' + # Author of this module + Author = 'DSC Community' -# Company or vendor of this module -CompanyName = 'DSC Community' + # Company or vendor of this module + CompanyName = 'DSC Community' -# Copyright statement for this module -Copyright = 'Copyright the DSC Community contributors. All rights reserved.' + # Copyright statement for this module + Copyright = 'Copyright the DSC Community contributors. All rights reserved.' -# Description of the functionality provided by this module -Description = 'The OfficeOnlineServerDsc module provides the ability to install Office Online Server (formerly known as Office Web App Server).' + # Description of the functionality provided by this module + Description = 'The OfficeOnlineServerDsc module provides the ability to install Office Online Server (formerly known as Office Web App Server).' -# Minimum version of the Windows PowerShell engine required by this module -PowerShellVersion = '4.0' + # Minimum version of the Windows PowerShell engine required by this module + PowerShellVersion = '4.0' -# Name of the Windows PowerShell host required by this module -# PowerShellHostName = '' + # Name of the Windows PowerShell host required by this module + # PowerShellHostName = '' -# Minimum version of the Windows PowerShell host required by this module -# PowerShellHostVersion = '' + # Minimum version of the Windows PowerShell host required by this module + # PowerShellHostVersion = '' -# Minimum version of Microsoft .NET Framework required by this module -# DotNetFrameworkVersion = '' + # Minimum version of Microsoft .NET Framework required by this module + # DotNetFrameworkVersion = '' -# Minimum version of the common language runtime (CLR) required by this module -# CLRVersion = '' + # Minimum version of the common language runtime (CLR) required by this module + # CLRVersion = '' -# Processor architecture (None, X86, Amd64) required by this module -# ProcessorArchitecture = '' + # Processor architecture (None, X86, Amd64) required by this module + # ProcessorArchitecture = '' -# Modules that must be imported into the global environment prior to importing this module -# RequiredModules = @() + # Modules that must be imported into the global environment prior to importing this module + # RequiredModules = @() -# Assemblies that must be loaded prior to importing this module -# RequiredAssemblies = @() + # Assemblies that must be loaded prior to importing this module + # RequiredAssemblies = @() -# Script files (.ps1) that are run in the caller's environment prior to importing this module. -# ScriptsToProcess = @() + # Script files (.ps1) that are run in the caller's environment prior to importing this module. + # ScriptsToProcess = @() -# Type files (.ps1xml) to be loaded when importing this module -# TypesToProcess = @() + # Type files (.ps1xml) to be loaded when importing this module + # TypesToProcess = @() -# Format files (.ps1xml) to be loaded when importing this module -# FormatsToProcess = @() + # Format files (.ps1xml) to be loaded when importing this module + # FormatsToProcess = @() -# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess -NestedModules = @("modules\OfficeOnlineServerDsc.Util\OfficeOnlineServerDsc.Util.psm1") + # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess + NestedModules = @("modules\OfficeOnlineServerDsc.Util\OfficeOnlineServerDsc.Util.psm1") -# Functions to export from this module -FunctionsToExport = @() + # Functions to export from this module + FunctionsToExport = @() -# Cmdlets to export from this module -CmdletsToExport = @('Get-OosDscInstalledProductVersion', - 'Test-OosDscFarmOu', - 'Test-OosDscParameterState') + # Cmdlets to export from this module + CmdletsToExport = @('Get-OosDscInstalledProductVersion', + 'Test-OosDscFarmOu', + 'Test-OosDscParameterState') -# Variables to export from this module -VariablesToExport = @() + # Variables to export from this module + VariablesToExport = @() -# Aliases to export from this module -AliasesToExport = @() + # Aliases to export from this module + AliasesToExport = @() -# List of all modules packaged with this module -# ModuleList = @() + # List of all modules packaged with this module + # ModuleList = @() -# List of all files packaged with this module -# FileList = @() + # List of all files packaged with this module + # FileList = @() -# Private data to pass to the module specified in RootModule/ModuleToProcess -# PrivateData = '' + # Private data to pass to the module specified in RootModule/ModuleToProcess + # PrivateData = '' -# HelpInfo URI of this module -# HelpInfoURI = '' + # HelpInfo URI of this module + # HelpInfoURI = '' -# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. -# DefaultCommandPrefix = '' + # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. + # DefaultCommandPrefix = '' -PrivateData = @{ + PrivateData = @{ - PSData = @{ - IconUri = 'https://dsccommunity.org/images/DSC_Logo_300p.png' + PSData = @{ + IconUri = 'https://dsccommunity.org/images/DSC_Logo_300p.png' - # Set to a prerelease string value if the release should be a prerelease. - Prerelease = '' + # Set to a prerelease string value if the release should be a prerelease. + Prerelease = '' - # Tags applied to this module. These help with module discovery in online galleries. - Tags = @('DesiredStateConfiguration', 'DSC', 'DSCResourceKit', 'DSCResource') + # Tags applied to this module. These help with module discovery in online galleries. + Tags = @('DesiredStateConfiguration', 'DSC', 'DSCResourceKit', 'DSCResource') - # A URL to the license for this module. - LicenseUri = 'https://github.com/dsccommunity/OfficeOnlineServerDsc/blob/master/LICENSE' + # A URL to the license for this module. + LicenseUri = 'https://github.com/dsccommunity/OfficeOnlineServerDsc/blob/master/LICENSE' - # A URL to the main website for this project. - ProjectUri = 'https://github.com/dsccommunity/OfficeOnlineServerDsc' + # A URL to the main website for this project. + ProjectUri = 'https://github.com/dsccommunity/OfficeOnlineServerDsc' - # A URL to an icon representing this module. - # IconUri = '' + # A URL to an icon representing this module. + # IconUri = '' - # ReleaseNotes of this module - ReleaseNotes = '' + # ReleaseNotes of this module + ReleaseNotes = '' - } # End of PSData hashtable + } # End of PSData hashtable -} # End of PrivateData hashtable + } # End of PrivateData hashtable }