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/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..9f18532 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() @@ -74,8 +76,8 @@ stages: testResultsFiles: 'output/testResults/NUnit*.xml' testRunTitle: 'HQRM' - - job: Test_Unit - displayName: 'Unit' + - job: Test_Unit_2013 + displayName: 'Unit OWA 2013' pool: vmImage: 'windows-2019' timeoutInMinutes: 0 @@ -87,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: @@ -94,13 +97,60 @@ stages: downloadType: 'single' artifactName: 'output' 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 '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: PublishBuildArtifacts@1 + displayName: 'Publish CodeCoverage Artifact' + inputs: + pathToPublish: '$(Build.SourcesDirectory)/output/testResults' + artifactName: 'CodeCoverage_2013' + publishLocation: 'Container' + + - job: Test_Unit_2016 + displayName: 'Unit OOS 2016' + 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 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' }})" + pwsh: false + - task: PublishTestResults@2 displayName: 'Publish Test Results' condition: succeededOrFailed() @@ -108,12 +158,68 @@ stages: testResultsFormat: 'NUnit' testResultsFiles: 'output/testResults/NUnit*.xml' testRunTitle: 'Unit (Windows Server Core)' + + - task: PublishBuildArtifacts@1 + displayName: 'Publish CodeCoverage Artifact' + inputs: + pathToPublish: '$(Build.SourcesDirectory)/output/testResults' + artifactName: 'CodeCoverage_2016' + publishLocation: 'Container' + + - 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: '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_2016' + downloadPath: '$(Build.SourcesDirectory)/output' + + - 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 e32572d..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 @@ -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 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 }