Skip to content

Commit

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

- xWebAdminstration
  - Integration tests are running on more Microsoft-hosted agents to
    test all possible operating systems (issue #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).
  • Loading branch information
johlju authored Jan 21, 2020
1 parent d66aeeb commit 59e8dcc
Show file tree
Hide file tree
Showing 21 changed files with 201 additions and 61 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
}
11 changes: 3 additions & 8 deletions tests/Integration/MSFT_xWebAppPoolDefaults.Integration.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ $tempName = "$($script:dscResourceName)_" + (Get-Date).ToString("yyyyMMdd_HHmmss

try
{
#region Integration Tests

# some constants
[string]$constPsPath = 'MACHINE/WEBROOT/APPHOST'
[string]$constAPDFilter = 'system.applicationHost/applicationPools/applicationPoolDefaults'
Expand All @@ -41,7 +39,6 @@ try
}

Describe "$($script:dscResourceName)_Integration" {
#region DEFAULT TESTS
It 'Should compile without throwing' {
{
Invoke-Expression -Command "$($script:dscResourceName)_Config -OutputPath `$TestDrive"
Expand All @@ -52,7 +49,6 @@ try
It 'Should be able to call Get-DscConfiguration without throwing' {
{ Get-DscConfiguration -Verbose -ErrorAction Stop } | Should Not throw
}
#endregion

It 'Changing ManagedRuntimeVersion' {
{
Expand Down Expand Up @@ -150,13 +146,12 @@ try
}

}
#endregion
}
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_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
}

Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,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
}
Loading

0 comments on commit 59e8dcc

Please sign in to comment.