Skip to content

Commit

Permalink
Integration tests are running on more Microsoft-hosted agents (dsccom…
Browse files Browse the repository at this point in the history
…munity#564)

### Added

- xWebAdminstration
  - Integration tests are running on more Microsoft-hosted agents to
    test all possible operating systems (issue dsccommunity#550).

### Changed

- xWebAdminstration
  - Azure Pipelines will no longer trigger on changes to just the CHANGELOG.md
    (when merging to master).
  - The deploy step is no longer run if the Azure DevOps organization URL
    does not contain 'dsccommunity'.
  - Changed the VS Code project settings to trim trailing whitespace for
    markdown files too.

### Fixed

- WebApplicationHandler
  - Integration test should no longer fail intermittent (issue dsccommunity#558).
  • Loading branch information
johlju authored and Gregory Storme committed Feb 14, 2020
1 parent 0d012cb commit 41d65b2
Show file tree
Hide file tree
Showing 21 changed files with 218 additions and 55 deletions.
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"steppable"
],
"[markdown]": {
"files.trimTrailingWhitespace": false,
"files.encoding": "utf8"
}
}
24 changes: 22 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@ For older change log history see the [historic changelog](HISTORIC_CHANGELOG.md)

## [Unreleased]

### Added

- xWebAdminstration
- Integration tests are running on more Microsoft-hosted agents to
test all possible operating systems ([issue #550](https://github.com/PowerShell/xWebAdministration/issues/550)).

### Changed

- xWebAdminstration
- Azure Pipelines will no longer trigger on changes to just the CHANGELOG.md
(when merging to master).
- The deploy step is no longer run if the Azure DevOps organization URL
does not contain 'dsccommunity'.
- Changed the VS Code project settings to trim trailing whitespace for
markdown files too.

### Fixed

- WebApplicationHandler
- Integration test should no longer fail intermittent ([issue #558](https://github.com/PowerShell/xWebAdministration/issues/558)).

## [3.1.1] - 2020-01-10

### Changed
Expand All @@ -16,7 +37,7 @@ For older change log history see the [historic changelog](HISTORIC_CHANGELOG.md)
displayed in Azure DevOps for each test file artifact.
- Update Visual Studio Code workspace settings for the repository.
- Set a display name on all the jobs and tasks in the CI pipeline.

### Fixed

- xWebAdministration
Expand All @@ -28,7 +49,6 @@ For older change log history see the [historic changelog](HISTORIC_CHANGELOG.md)
multiple certificates.
- Fix an issue where changes to LogFlags would fail to apply.


## [3.1.0] - 2019-12-30

### Added
Expand Down
1 change: 1 addition & 0 deletions RequiredModules.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
'DscResource.Test' = 'latest'
'DscResource.AnalyzerRules' = 'latest'
xDscResourceDesigner = 'latest'
PSPKI = 'latest'
}
129 changes: 125 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ trigger:
branches:
include:
- master
paths:
exclude:
- CHANGELOG.md
tags:
include:
- "v*"
Expand Down Expand Up @@ -110,8 +113,46 @@ stages:
summaryFileLocation: 'output/testResults/CodeCov*.xml'
pathToSources: '$(Build.SourcesDirectory)/output/$(dscBuildVariable.RepositoryName)'

- job: Test_Integration
displayName: 'Integration'
- job: Test_Integration_2012R2
displayName: 'Integration 2012R2'
pool:
vmImage: 'vs2015-win2012r2'
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
- powershell: |
Install-WindowsFeature -IncludeAllSubFeature -IncludeManagementTools -Name 'Web-Server' -Verbose
name: InstallWebServerFeature
- 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'
condition: succeededOrFailed()
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: 'output/testResults/NUnit*.xml'
testRunTitle: 'Integration (Windows Server Core)'

- job: Test_Integration_2016
displayName: 'Integration 2016'
pool:
vmImage: 'vs2017-win2016'
timeoutInMinutes: 0
Expand All @@ -131,7 +172,86 @@ stages:
script: 'winrm quickconfig -quiet'
pwsh: false
- powershell: |
Install-WindowsFeature -IncludeAllSubFeature -IncludeManagementTools -Name 'Web-Server'
Install-WindowsFeature -IncludeAllSubFeature -IncludeManagementTools -Name 'Web-Server' -Verbose
name: InstallWebServerFeature
- 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'
condition: succeededOrFailed()
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: 'output/testResults/NUnit*.xml'
testRunTitle: 'Integration (Windows Server Core)'

- job: Test_Integration_2019
displayName: 'Integration 2019'
pool:
vmImage: 'windows-2019'
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
- powershell: |
Install-WindowsFeature -IncludeAllSubFeature -IncludeManagementTools -Name 'Web-Server' -Verbose
name: InstallWebServerFeature
- 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'
condition: succeededOrFailed()
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: 'output/testResults/NUnit*.xml'
testRunTitle: 'Integration (Windows Server Core)'

- job: Test_Integration_ServerCore_ltsc2019
displayName: 'Integration Server Core LTSC 2019'
pool:
vmImage: 'windows-2019'
container: mcr.microsoft.com/windows/servercore:ltsc2019
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
- powershell: |
Set-Service -Name wuauserv -StartupType Manual -Verbose
Start-Service -name wuauserv -Verbose
Install-WindowsFeature -IncludeAllSubFeature -Name 'Web-Server' -Verbose
name: InstallWebServerFeature
- task: PowerShell@2
name: test
Expand All @@ -156,7 +276,8 @@ stages:
or(
eq(variables['Build.SourceBranch'], 'refs/heads/master'),
startsWith(variables['Build.SourceBranch'], 'refs/tags/')
)
),
contains(variables['System.TeamFoundationCollectionUri'], 'dsccommunity')
)
jobs:
- job: Deploy_Module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ try
}
finally
{
Restore-WebConfigurationWrapper -Name $tempName
Restore-WebConfigurationWrapper -Name $tempName -Verbose

Remove-WebConfigurationBackup -Name $tempName
Remove-WebConfigurationBackup -Name $tempName -Verbose

Restore-TestEnvironment -TestEnvironment $script:testEnvironment
Restore-TestEnvironment -TestEnvironment $script:testEnvironment -Verbose
}
6 changes: 3 additions & 3 deletions tests/Integration/MSFT_XIISLogging.Integration.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ try
}
finally
{
Restore-WebConfigurationWrapper -Name $tempName
Restore-WebConfigurationWrapper -Name $tempName -Verbose

Remove-WebConfigurationBackup -Name $tempName
Remove-WebConfigurationBackup -Name $tempName -Verbose

Restore-TestEnvironment -TestEnvironment $script:testEnvironment
Restore-TestEnvironment -TestEnvironment $script:testEnvironment -Verbose
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ try
}
finally
{
Restore-WebConfigurationWrapper -Name $tempName
Restore-WebConfigurationWrapper -Name $tempName -Verbose

Remove-WebConfigurationBackup -Name $tempName
Remove-WebConfigurationBackup -Name $tempName -Verbose

Restore-TestEnvironment -TestEnvironment $script:testEnvironment
Restore-TestEnvironment -TestEnvironment $script:testEnvironment -Verbose
}
6 changes: 3 additions & 3 deletions tests/Integration/MSFT_xIISHandler.Integration.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ try
}
finally
{
Restore-WebConfigurationWrapper -Name $tempName
Restore-WebConfigurationWrapper -Name $tempName -Verbose

Remove-WebConfigurationBackup -Name $tempName
Remove-WebConfigurationBackup -Name $tempName -Verbose

Restore-TestEnvironment -TestEnvironment $script:testEnvironment
Restore-TestEnvironment -TestEnvironment $script:testEnvironment -Verbose
}
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ try
}
finally
{
Restore-WebConfigurationWrapper -Name $tempName
Restore-WebConfigurationWrapper -Name $tempName -Verbose

Remove-WebConfigurationBackup -Name $tempName
Remove-WebConfigurationBackup -Name $tempName -Verbose

Restore-TestEnvironment -TestEnvironment $script:testEnvironment
Restore-TestEnvironment -TestEnvironment $script:testEnvironment -Verbose
}
6 changes: 3 additions & 3 deletions tests/Integration/MSFT_xSslSettings.Integration.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ try
}
finally
{
Restore-WebConfigurationWrapper -Name $tempName
Restore-WebConfigurationWrapper -Name $tempName -Verbose

Remove-WebConfigurationBackup -Name $tempName
Remove-WebConfigurationBackup -Name $tempName -Verbose

Restore-TestEnvironment -TestEnvironment $script:testEnvironment
Restore-TestEnvironment -TestEnvironment $script:testEnvironment -Verbose
}
6 changes: 3 additions & 3 deletions tests/Integration/MSFT_xWebAppPool.Integration.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ try
}
finally
{
Restore-WebConfigurationWrapper -Name $tempName
Restore-WebConfigurationWrapper -Name $tempName -Verbose

Remove-WebConfigurationBackup -Name $tempName
Remove-WebConfigurationBackup -Name $tempName -Verbose

Restore-TestEnvironment -TestEnvironment $script:testEnvironment
Restore-TestEnvironment -TestEnvironment $script:testEnvironment -Verbose
}
22 changes: 20 additions & 2 deletions tests/Integration/MSFT_xWebAppPoolDefaults.Integration.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,18 @@ $tempName = "$($script:dscResourceName)_" + (Get-Date).ToString("yyyyMMdd_HHmmss
>>>>>>> Added continuous delivery with a new CI pipeline (#549):tests/Integration/MSFT_xWebAppPoolDefaults.Integration.Tests.ps1
try
{
<<<<<<< HEAD
# Create configuration backup

Backup-WebConfiguration -Name $tempBackupName | Out-Null

#region Integration Tests
=======
# some constants
[string]$constPsPath = 'MACHINE/WEBROOT/APPHOST'
[string]$constAPDFilter = 'system.applicationHost/applicationPools/applicationPoolDefaults'
[string]$constSiteFilter = 'system.applicationHost/sites/'
>>>>>>> Integration tests are running on more Microsoft-hosted agents (#564)

$ConfigFile = Join-Path -Path $PSScriptRoot -ChildPath "$($script:dscResourceName).config.ps1"
. $ConfigFile
Expand All @@ -75,7 +82,6 @@ try
} | Should Not Throw
=======
Describe "$($script:dscResourceName)_Integration" {
#region DEFAULT TESTS
It 'Should compile without throwing' {
{
Invoke-Expression -Command "$($script:dscResourceName)_Config -OutputPath `$TestDrive"
Expand All @@ -89,8 +95,11 @@ try
Get-DscConfiguration -Verbose -ErrorAction Stop
} | Should Not Throw
}
<<<<<<< HEAD

#endregion
=======
>>>>>>> Integration tests are running on more Microsoft-hosted agents (#564)

It 'Should have set the resource and all the parameters should match' {

Expand Down Expand Up @@ -208,6 +217,7 @@ try
}

}
<<<<<<< HEAD

#endregion
}
Expand All @@ -222,6 +232,14 @@ finally

Remove-WebConfigurationBackup -Name $tempName
>>>>>>> Added continuous delivery with a new CI pipeline (#549):tests/Integration/MSFT_xWebAppPoolDefaults.Integration.Tests.ps1
=======
}
finally
{
Restore-WebConfigurationWrapper -Name $tempName -Verbose

Remove-WebConfigurationBackup -Name $tempName -Verbose
>>>>>>> Integration tests are running on more Microsoft-hosted agents (#564)

Restore-TestEnvironment -TestEnvironment $script:testEnvironment
Restore-TestEnvironment -TestEnvironment $script:testEnvironment -Verbose
}
6 changes: 3 additions & 3 deletions tests/Integration/MSFT_xWebApplication.Integration.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ try
}
finally
{
Restore-WebConfigurationWrapper -Name $tempName
Restore-WebConfigurationWrapper -Name $tempName -Verbose

Remove-WebConfigurationBackup -Name $tempName
Remove-WebConfigurationBackup -Name $tempName -Verbose

Restore-TestEnvironment -TestEnvironment $script:testEnvironment
Restore-TestEnvironment -TestEnvironment $script:testEnvironment -Verbose
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ try
}
finally
{
Restore-WebConfigurationWrapper -Name $tempName
Restore-WebConfigurationWrapper -Name $tempName -Verbose

Remove-WebConfigurationBackup -Name $tempName
Remove-WebConfigurationBackup -Name $tempName -Verbose

Restore-TestEnvironment -TestEnvironment $script:testEnvironment
Restore-TestEnvironment -TestEnvironment $script:testEnvironment -Verbose
}

Loading

0 comments on commit 41d65b2

Please sign in to comment.