Skip to content

Commit a51ecb2

Browse files
committed
WIP Make some progress on tests.
1 parent c0fbf06 commit a51ecb2

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

Invoke-Tests.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ try {
166166
if (-not $env:VM_RUNNING -and -not $env:TEST_KITCHEN) {
167167
'VMOnly'
168168
}
169+
'Broken'
169170
)
170171
}
171172
Should = @{

tests/Vagrantfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# vi: set ft=ruby :
33

44
# Setup a global variable to be consistent about xcopy arguments.
5-
$xcopyArgs = '/s /q /exclude:c:\\chocoroot\\.xcopyignore /i /y /h'
5+
$xcopyCommand = 'xcopy c:\\chocoroot\\* c:\\code\\choco /s /q /exclude:c:\\chocoroot\\.xcopyignore /i /y /h'
66

77
$memory = ENV['VM_MEMORY'] ? ENV['VM_MEMORY'].to_i : 4096
88
$cpus = ENV['VM_CPU'] ? ENV['VM_CPU'].to_i : 2
@@ -65,11 +65,11 @@ Vagrant.configure("2") do |config|
6565
config.vm.provision "shell", name: "clear-build", inline: <<-CLEARBUILD
6666
Write-Host "($(Get-Date -Format "dddd MM/dd/yyyy HH:mm:ss K")) Clearing the Chocolatey source directory"
6767
Remove-Item -Path C:/code/choco -Recurse -Force -ErrorAction SilentlyContinue
68-
xcopy c:\\chocoroot\\* c:\\code\\choco #{$xcopyArgs}
68+
#{$xcopyCommand}
6969
CLEARBUILD
7070

7171
config.vm.provision "shell", name: "build", inline: <<-BUILD
72-
xcopy c:\\chocoroot\\* c:\\code\\choco #{$xcopyArgs}
72+
#{$xcopyCommand}
7373
Push-Location c:/code/choco
7474
Write-Host "($(Get-Date -Format "dddd MM/dd/yyyy HH:mm:ss K")) Files have been copied, beginning build process."
7575
$CakeOutput = ./build.bat --verbosity=diagnostic --target=CI --testExecutionType=none --shouldRunalyze=false --shouldRunNuGet=false 2>&1
@@ -90,10 +90,9 @@ Vagrant.configure("2") do |config|
9090
CLEARPACKAGES
9191

9292
config.vm.provision "shell", name: "test", inline: <<-TEST
93-
xcopy c:\\chocoroot\\* c:\\code\\choco #{$xcopyArgs}
9493
# Purge any tests files that have been removed.
9594
rm -re -fo c:\\code\\choco\\tests
96-
xcopy c:\\chocoroot\\tests\\* c:\\code\\choco\\tests #{$xcopyArgs}
95+
#{$xcopyCommand}
9796
Write-Host "($(Get-Date -Format "dddd MM/dd/yyyy HH:mm:ss K")) Starting Test Execution"
9897
Push-Location c:/code/choco
9998
# $env:TEST_KITCHEN = 1

tests/pester-tests/commands/choco-uninstall.Tests.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Describe "choco uninstall" -Tag Chocolatey, UninstallCommand {
4545
}
4646

4747
# Broken since v1.0.0
48+
# TODO: Why are we tagging this as broken and not considering changing it or updating the test?
4849
It "Exits with Success (0)" -Tag Broken {
4950
$Output.ExitCode | Should -Be 0 -Because $Output.String
5051
}
@@ -70,7 +71,9 @@ Describe "choco uninstall" -Tag Chocolatey, UninstallCommand {
7071
}
7172
}
7273

73-
Context "Uninstalling a package with a failing uninstall script" {
74+
# TODO: Fix failure in Vagrant environment
75+
# Skipping as we don't currently have these packages in the repository.
76+
Context "Uninstalling a package with a failing uninstall script" -skip:(-not $env:TEST_KITCHEN) {
7477
BeforeAll {
7578
Restore-ChocolateyInstallSnapshot
7679

@@ -251,7 +254,8 @@ Describe "choco uninstall" -Tag Chocolatey, UninstallCommand {
251254
}
252255
}
253256

254-
Context "When specifying non-existing package before and after failing package does not abort execution" {
257+
# TODO: This package is currently missing...
258+
Context "When specifying non-existing package before and after failing package does not abort execution" -skip:(-not $env:TEST_KITCHEN) {
255259
BeforeAll {
256260
$null = Invoke-Choco install uninstallfailure installpackage --confirm
257261

0 commit comments

Comments
 (0)