Skip to content
This repository was archived by the owner on Mar 11, 2020. It is now read-only.

Commit 8ff2e36

Browse files
committed
For #11 - added appveyor.yml
1 parent 43a89cd commit 8ff2e36

File tree

2 files changed

+36
-13
lines changed

2 files changed

+36
-13
lines changed

Tests/Image2Docker.tests.ps1

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,43 @@
1-
describe Image2Docker {
2-
$ModuleName = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Leaf
3-
Write-Verbose -Message ('Module name is {0}' -f $ModuleName)
1+
Describe Image2Docker {
2+
$ModuleName = 'Image2Docker'
3+
WrIte-Verbose -Message ('Module name is {0}' -f $ModuleName)
44

5-
### Remove the module if it's already imported, then re-import it (in case code changed)
5+
### Remove the module if It's already imported, then re-import It (in case code changed)
66
Remove-Module -Name $ModuleName -ErrorAction Ignore
7-
#Import-Module -Name (Split-Path -Path $PSScriptRoot -Parent)
7+
#Import-Module -Name (SplIt-Path -Path $PSScriptRoot -Parent)
88
Import-Module -Name $PSScriptRoot\..\Image2Docker.psd1
99

10-
context 'Public-facing PowerShell commands' {
11-
it 'Has a ConvertTo-Dockerfile command' {
10+
Context 'Public-facing PowerShell commands' {
11+
It 'Has a ConvertTo-Dockerfile command' {
1212
(Get-Command -Module $ModuleName -Name ConvertTo-Dockerfile).Count | Should Be 1
1313
}
1414

15-
it 'Has a Get-WindowsArtifacts command' {
15+
It 'Has a Get-WindowsArtifacts command' {
1616
(Get-Command -Module $ModuleName -Name Get-WindowsArtifacts).Count | Should Be 1
1717
}
1818
}
1919

20-
context 'Private / internal PowerShell commands' {
20+
Context 'Private / internal PowerShell commands' {
2121
InModuleScope -ModuleName $ModuleName -ScriptBlock {
22-
it 'Has a GenerateDockerfile command' {
22+
It 'Has a GenerateDockerfile command' {
2323
(Get-Command -Module $ModuleName -Name GenerateDockerfile).Count | Should Be 1
2424
}
25-
it 'Has a GetImageType command' {
25+
It 'Has a GetImageType command' {
2626
(Get-Command -Module $ModuleName -Name GetImageType).Count | Should Be 1
2727
}
2828
}
2929
}
3030

31-
context 'Test ConvertTo-Dockerfile command' {
32-
it 'Should throw when -ImagePath parameter value is invalid' {
31+
Context 'Artifact Discovery' {
32+
foreach ($artifact in Get-WindowsArtifacts) {
33+
34+
It "Has an $artifact Artifact" {
35+
Get-WindowsArtifacts | Where-Object {$_ -match $artifact }| Should Match $artifact
36+
}
37+
}
38+
}
39+
Context 'Test ConvertTo-Dockerfile command' {
40+
It 'Should throw when -ImagePath parameter value is invalid' {
3341
{ ConvertTo-Dockerfile -ImagePath c:\invalid\path.wim } | Should throw
3442
}
3543
}

appveyor.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 1.5.1.{build}
2+
build: off
3+
install:
4+
- ps: |
5+
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
6+
Install-Module -Name Pester -Repository PSGallery -Force
7+
Install-Module -Name PSScriptAnalyzer -Repository PSGallery -Force
8+
test_script:
9+
- ps: |
10+
$testResultsFile = ".\TestsResults.xml"
11+
$tempModulePath = (Resolve-Path (join-path $PWD '..')).ProviderPath
12+
$env:PSModulePath = "$env:PSModulePath;$tempModulePath"
13+
$res = Invoke-Pester -OutputFormat NUnitXml -OutputFile $testResultsFile -PassThru
14+
(New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFile))
15+
if ($res.FailedCount -gt 0) { throw "$($res.FailedCount) tests failed."} else {return}

0 commit comments

Comments
 (0)