Skip to content

Commit 46b95c9

Browse files
authored
[skip ci] Docker tests (#9)
Added Docker testing in Ubuntu 16.04 container as part of the CI suite
2 parents eee1fba + 680a1ac commit 46b95c9

File tree

4 files changed

+36
-4
lines changed

4 files changed

+36
-4
lines changed

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@ FROM base as src
55
LABEL maintainer="nferrell"
66
LABEL description="PSProfile container for Ubuntu 16.04"
77
LABEL vendor="scrthq"
8-
COPY [".", "/tmp/PSProfile/"]
9-
WORKDIR /tmp/PSProfile
8+
SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $VerbosePreference = 'Continue'; $ProgressPreference = 'SilentlyContinue';"]
9+
COPY [".", "/PSProfile/"]
10+
WORKDIR /PSProfile
11+
ENTRYPOINT [ "pwsh", "-command", ". ./build.ps1 -Task Build,Test" ]

PSProfile/PSProfile.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'PSProfile.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '0.1.7'
15+
ModuleVersion = '0.1.8'
1616

1717
# Supported PSEditions
1818
CompatiblePSEditions = @('Desktop','Core')

azure-pipelines.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,43 @@ phases:
132132
testResultsFiles: '**/Test*.xml'
133133
condition: succeededOrFailed()
134134

135+
135136
- phase: Phase_6
137+
displayName: Test Docker
138+
dependsOn: Phase_1
139+
condition: succeeded()
140+
queue:
141+
name: Hosted Ubuntu 1604
142+
143+
steps:
144+
- task: DownloadBuildArtifacts@0
145+
displayName: 'Download Build Artifacts'
146+
inputs:
147+
artifactName: BuildOutput
148+
downloadPath: '$(Build.SourcesDirectory)'
149+
150+
- powershell: |
151+
docker build . -t psprofile-img -f ./Dockerfile
152+
docker run --name psprofile psprofile-img:latest
153+
docker cp psprofile:/PSProfile/BuildOutput/TestResults.xml BuildOutput/TestResults_Docker.xml
154+
docker rm psprofile
155+
displayName: Test Module in Container
156+
157+
- task: PublishTestResults@2
158+
displayName: 'Publish Test Results **/Test*.xml'
159+
inputs:
160+
testRunner: NUnit
161+
testResultsFiles: '**/Test*.xml'
162+
condition: succeededOrFailed()
163+
164+
- phase: Phase_7
136165
displayName: Deploy Module
137166
dependsOn:
138167
- Phase_2
139168
- Phase_3
140169
- Phase_4
141170
- Phase_5
171+
- Phase_6
142172
condition: and(succeeded(), in(variables['Build.Reason'], 'Manual', 'IndividualCI', 'BatchedCI'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
143173
queue:
144174
name: Hosted VS2017

tasks.build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ task Test Init,{
172172
Import-Module -Name $TargetModuleDirectory -Force -Verbose:$false
173173
$pesterParams = @{
174174
OutputFormat = 'NUnitXml'
175-
OutputFile = Join-Path $TargetDirectory "TestResults_PS$PSVersion`_$TimeStamp.xml"
175+
OutputFile = Join-Path $TargetDirectory "TestResults.xml"
176176
PassThru = $true
177177
Path = Join-Path $BuildRoot "Tests"
178178
}

0 commit comments

Comments
 (0)