mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-10-17 01:59:04 +02:00
ci: upgrade from 0.32.0-beta.1 in the installer test (#2683)
Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude
parent
1cdea1f42a
commit
5d8b30cb69
@@ -254,12 +254,19 @@ jobs:
|
||||
throw "Could not determine the latest release"
|
||||
}
|
||||
|
||||
# Packages up to 0.31.x stop the exporter with taskkill /T. It follows
|
||||
# stale parent process IDs and can kill the runner agent, so upgrade
|
||||
# from the first package without it until a newer release exists.
|
||||
if ([Version]($PreviousVersion -replace '^([0-9\.]+).*$','$1') -lt [Version]'0.32.0') {
|
||||
$PreviousVersion = '0.32.0-beta.1'
|
||||
}
|
||||
|
||||
# Builds between tags carry the version of an older tag, so installing
|
||||
# them over the latest release would be a downgrade. Package the same
|
||||
# executable with a higher version for the upgrade test.
|
||||
$UpgradeMsi = $Msi
|
||||
$MsiVersion = $Version -replace '^v?([0-9\.]+).*$','$1'
|
||||
if ([Version]$MsiVersion -le [Version]$PreviousVersion) {
|
||||
if ([Version]$MsiVersion -le [Version]($PreviousVersion -replace '^([0-9\.]+).*$','$1')) {
|
||||
.\installer\build.ps1 -PathToExecutable $Executable -Version 99.0.0 -Arch amd64
|
||||
$UpgradeMsi = Join-Path $env:RUNNER_TEMP 'windows_exporter-99.0.0-amd64.msi'
|
||||
Move-Item installer\windows_exporter-99.0.0-amd64.msi $UpgradeMsi
|
||||
|
||||
@@ -33,7 +33,10 @@ their runtime behavior.
|
||||
packaging, deployment examples, CI fixtures and end-to-end helpers. The CI
|
||||
package job validates installer changes with
|
||||
[`tools/test-installer.ps1`](tools/test-installer.ps1), which installs the
|
||||
service for real. Never run it on a developer machine.
|
||||
service for real. Never run it on a developer machine. Never upgrade from a
|
||||
0.31.x package there: its `taskkill /T` follows stale parent process IDs and
|
||||
can kill the runner agent, which fails the job with "The hosted runner lost
|
||||
communication with the server" and no logs.
|
||||
|
||||
New collectors need discussion with maintainers first. Prefer the configurable
|
||||
`performancecounter` collector where it can provide the requested metrics, as
|
||||
|
||||
@@ -16,7 +16,10 @@ Param (
|
||||
# Executable packaged in $Msi and $UpgradeMsi.
|
||||
[Parameter(Mandatory = $true)]
|
||||
[String] $Executable,
|
||||
# Release to upgrade from, for example 0.31.8.
|
||||
# Release to upgrade from, for example 0.32.0-beta.1. Packages up to 0.31.x
|
||||
# stop every windows_exporter.exe with taskkill /T, which also ends
|
||||
# unrelated processes whose stale parent process ID matches, like the
|
||||
# runner agent of a CI job.
|
||||
[Parameter(Mandatory = $true)]
|
||||
[String] $PreviousVersion,
|
||||
[Parameter(Mandatory = $false)]
|
||||
@@ -194,14 +197,9 @@ try {
|
||||
throw 'the upgraded service does not use the kept configuration'
|
||||
}
|
||||
|
||||
# The previous package removes itself with its own logic. Up to 0.31.x that
|
||||
# stops every windows_exporter.exe, as documented in UPGRADE.md.
|
||||
if (Test-ForeignAlive) {
|
||||
Write-Host 'the independent windows_exporter.exe survived the upgrade'
|
||||
} else {
|
||||
Write-Host "::notice::the $PreviousVersion package stopped the independent windows_exporter.exe during the upgrade"
|
||||
Start-Foreign
|
||||
}
|
||||
# The previous package removes itself with its own logic, so it must be
|
||||
# 0.32.0-beta.0 or newer to leave the independent instance running.
|
||||
Assert-ForeignAlive -Operation 'upgrade'
|
||||
Write-Host '::endgroup::'
|
||||
|
||||
Write-Step 'Repair this build'
|
||||
|
||||
Reference in New Issue
Block a user