test_all.ps1 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #Name can be 'random N' to randomly force the Nth group of packages.
  2. param( [string[]] $Name, [string] $Root = "$PSScriptRoot" )
  3. if (Test-Path $PSScriptRoot/update_vars.ps1) { . $PSScriptRoot/update_vars.ps1 }
  4. $global:au_root = Resolve-Path $Root
  5. if (($Name.Length -gt 0) -and ($Name[0] -match '^random (.+)')) {
  6. [array] $lsau = lsau
  7. $group = [int]$Matches[1]
  8. $n = (Get-Random -Maximum $group)
  9. Write-Host "TESTING GROUP $($n+1) of $group"
  10. $group_size = [int]($lsau.Count / $group) + 1
  11. $Name = $lsau | select -First $group_size -Skip ($group_size*$n) | % { $_.Name }
  12. Write-Host ($Name -join ' ')
  13. Write-Host ('-'*80)
  14. }
  15. $options = [ordered]@{
  16. Force = $true
  17. Push = $false
  18. Report = @{
  19. Type = 'markdown' #Report type: markdown or text
  20. Path = "$PSScriptRoot\Update-Force-Test-${n}.md" #Path where to save the report
  21. Params= @{ #Report parameters:
  22. Github_UserRepo = $Env:github_user_repo # Markdown: shows user info in upper right corner
  23. NoAppVeyor = $false # Markdown: do not show AppVeyor build shield
  24. Title = "Update Force Test - Group ${n}"
  25. UserMessage = "[Update report](https://gist.github.com/$Env:gist_id) | **USING AU NEXT VERSION**" # Markdown, Text: Custom user message to show
  26. }
  27. }
  28. Gist = @{
  29. Id = $Env:gist_id_test #Your gist id; leave empty for new private or anonymous gist
  30. ApiKey = $Env:github_api_key #Your github api key - if empty anoymous gist is created
  31. Path = "$PSScriptRoot\Update-Force-Test-${n}.md" #List of files to add to the gist
  32. Description = "Update Force Test Report #powershell #chocolatey"
  33. }
  34. }
  35. $global:info = updateall -Name $Name -Options $Options