Skip to content

Commit

Permalink
Merge branch 'release/2.2.0'
Browse files Browse the repository at this point in the history
* 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
gep13 committed Jul 26, 2023
2 parents 46976cf + eddf9d5 commit 76b9ca9
Show file tree
Hide file tree
Showing 78 changed files with 3,743 additions and 3,145 deletions.
5 changes: 5 additions & 0 deletions .teamcity/settings.kts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ object ChocolateyDockerWin : BuildType({
param("env.vcsroot.branch", "%vcsroot.branch%")
param("env.Git_Branch", "%teamcity.build.vcs.branch.Chocolatey_ChocolateyVcsRoot%")
param("teamcity.git.fetchAllHeads", "true")
password("env.DOCKER_USER", "%system.DockerUsername%", display = ParameterDisplay.HIDDEN, readOnly = true)
password("env.DOCKER_PASSWORD", "%system.DockerPassword%", display = ParameterDisplay.HIDDEN, readOnly = true)
}

vcs {
Expand Down Expand Up @@ -155,12 +157,15 @@ object ChocolateyPosix : BuildType({

params {
param("env.CAKE_NUGET_SOURCE", "") // The Cake version we use has issues with authing to our private source on Linux
param("env.PRIMARY_NUGET_SOURCE", "") // As above there are issues with authing to our private source on Linux
param("env.CHOCOLATEY_VERSION", "%dep.Chocolatey.build.number%")
param("env.CHOCOLATEY_OFFICIAL_KEY", "%system.teamcity.build.checkoutDir%/chocolatey.official.snk")
password("env.GITHUB_PAT", "%system.GitHubPAT%", display = ParameterDisplay.HIDDEN, readOnly = true)
param("env.vcsroot.branch", "%vcsroot.branch%")
param("env.Git_Branch", "%teamcity.build.vcs.branch.Chocolatey_ChocolateyVcsRoot%")
param("teamcity.git.fetchAllHeads", "true")
password("env.DOCKER_USER", "%system.DockerUsername%", display = ParameterDisplay.HIDDEN, readOnly = true)
password("env.DOCKER_PASSWORD", "%system.DockerPassword%", display = ParameterDisplay.HIDDEN, readOnly = true)
}

vcs {
Expand Down
83 changes: 83 additions & 0 deletions Invoke-AuthedTests.ps1
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
}
4 changes: 2 additions & 2 deletions docs/legal/CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- [log4net @ 2.0.12](#log4net--2012)
- [Microsoft.Bcl.HashCode @ 1.1.1](#microsoftbclhashcode--111)
- [Microsoft.Web.Xdt @ 2.1.1](#microsoftwebxdt--211)
- [Chocolatey.NuGet.Client @ 3.1.0](#chocolateynugetclient--310)
- [Chocolatey.NuGet.Client @ 3.4.0](#chocolateynugetclient--340)
- [Rhino.Licensing @ 1.4.1 (modified)](#rhinolicensing--141-modified)
- [Shim Generator (shimgen) @ 1.0.0](#shim-generator-shimgen--100)
- [SimpleInjector @ 2.8.3](#simpleinjector--283)
Expand Down Expand Up @@ -707,7 +707,7 @@ Chocolatey uses [Microsoft.Web.Xdt](https://www.nuget.org/packages/Microsoft.Web
It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages.
```

### Chocolatey.NuGet.Client @ 3.1.0
### Chocolatey.NuGet.Client @ 3.4.0

Chocolatey uses [NuGet.Client](https://github.com/NuGet/NuGet.Client) [(modified)](https://github.com/chocolatey/NuGet.Client) to work with packaging.
[License terms](https://github.com/NuGet/NuGet.Client/blob/72f9f2b2eab28c9d91a22065c55aa7702abf7e01/LICENSE.txt):
Expand Down
2 changes: 1 addition & 1 deletion recipe.cake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#load nuget:?package=Chocolatey.Cake.Recipe&version=0.23.1
#load nuget:?package=Chocolatey.Cake.Recipe&version=0.24.0

///////////////////////////////////////////////////////////////////////////////
// TOOLS
Expand Down
Loading

0 comments on commit 76b9ca9

Please sign in to comment.