-
Notifications
You must be signed in to change notification settings - Fork 903
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* release/2.2.0: (21 commits) (doc) Update to indicate new package version used (maint) Add helper to split on max line lengths (#3281) Add validation for cache folder permissions (#3264) Update to latest Chocolatey.NuGet.Client (#3264) Ignore lock folders in cache directories (#3186) Remove easter egg (doc) Improve error message for defaultPushSource (tests) Clear HTTP Cache before getting packages (#3258) Expand logging for nuget resources errors (maint) Set file encoding to include BOM (#3237) Reduce number of queries for dependencies (#3231) Add tests to ensure package listing (maint) Remove unnecessary using statements (#3231) Don't refresh local package info during upgrade no-ops (build) Update to latest recipe package (doc) Minor corrections to wording (#3242) Add a script to run Authenticated tests (#3242) Attempt default credentials for sources (maint) Fix incorrect naming style uses (doc) Apply scripting best practices to output ...
- Loading branch information
Showing
78 changed files
with
3,743 additions
and
3,145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
#Requires -Module @{ ModuleName = 'pester'; ModuleVersion = '5.3.1' } | ||
#Requires -RunAsAdministrator | ||
<# | ||
.SYNOPSIS | ||
Prepares a system to test as though it was Test Kitchen. | ||
#> | ||
param( | ||
# Path to place Chocolatey test related artifacts. | ||
[string] | ||
$TestPath = "$env:TEMP/chocolateyTests", | ||
|
||
# Indicate to skip packaging all of the tests packages. Useful for running tests after you've performed the tests previously. | ||
[switch] | ||
$SkipPackaging, | ||
|
||
# The remote repository to push packages to and to use during tests. | ||
[string] | ||
$RemoteRepository, | ||
|
||
# API Key used by the remote repository for pushing packages. | ||
[string] | ||
$ApiKey | ||
) | ||
|
||
if (-not (Test-Path "$TestPath/packages") -or -not $SkipPackaging) { | ||
if (($null -ne $RemoteRepository) -and ($null -ne $ApiKey)) | ||
$null = New-Item -Path "$TestPath/packages" -ItemType Directory -Force | ||
# Get and pack packages | ||
$nuspecs = Get-ChildItem -Path $PSScriptRoot/src/chocolatey.tests.integration, $PSScriptRoot/tests/packages -Recurse -Include *.nuspec | ||
Get-ChildItem -Path $PSScriptRoot/tests/packages -Recurse -Include *.nupkg | Copy-Item -Destination "$TestPath/packages" | ||
|
||
foreach ($file in $nuspecs) { | ||
Write-Host "Packaging $file" | ||
$null = choco pack $file.FullName --out "$TestPath/packages" | ||
} | ||
|
||
Get-ChildItem -Path $TestPath/packages | ForEach-Object { | ||
choco push $_.FullName -s $RemoteRepository -k $ApiKey --force --allow-unofficial | ||
} | ||
} | ||
|
||
try { | ||
Push-Location $PSScriptRoot/tests | ||
$env:PSModulePath = "$PSScriptRoot/tests;$env:PSModulePath" | ||
|
||
Import-Module $PSScriptRoot\tests\helpers\common-helpers.psm1 -Force | ||
$null = Invoke-Choco source add --name hermes --source $RemoteRepository | ||
Enable-ChocolateyFeature -Name allowGlobalConfirmation | ||
$PesterConfiguration = [PesterConfiguration]@{ | ||
Run = @{ | ||
PassThru = $true | ||
Path = "$PSScriptRoot/tests/chocolatey-tests" | ||
} | ||
TestResult = @{ | ||
Enabled = $true | ||
TestSuiteName = "Pester - Chocolatey" | ||
} | ||
Output = @{ | ||
Verbosity = 'Minimal' | ||
} | ||
Filter = @{ | ||
ExcludeTag = @( | ||
'Background' | ||
'Licensed' | ||
'CCM' | ||
'WIP' | ||
'NonAdmin' | ||
'Internal' | ||
if (-not $env:VM_RUNNING -and -not $env:TEST_KITCHEN) { | ||
'VMOnly' | ||
} | ||
) | ||
} | ||
Should = @{ | ||
ErrorAction = 'Continue' | ||
} | ||
} | ||
|
||
Invoke-Pester -Configuration $PesterConfiguration | ||
} | ||
finally { | ||
Pop-Location | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.