Skip to content

Commit a954625

Browse files
wa: fix cmk-agent-ctl path in integration test setup
winagt-test-integration has been failing since build 1645 with ast.literal_eval('<<<wmi_cpuload:sep(124)>>>') -> SyntaxError in test_check_mk_base. The real error is 30 lines earlier in the log: Copy-Item: run_tests.ps1:278 | Cannot find path '...\checkout\requirements\rust\host\target\ | x86_64-pc-windows-msvc\release\cmk-agent-ctl.exe' cmk-agent-ctl.exe never lands in the test root, the agent emits an empty <<<cmk_agent_ctl_status:sep(0)>>> section, and CTL_STATUS_LINE -- a hardcoded line index -- then points at the following section header. Commit f236e9d reverted the copy source from $repo_root\target\... back to $repo_root\requirements\rust\host\target\..., on the assumption that the rust workspace revamp had only happened on master. It had not: 5499477 ("ci: revamp workspaces for rust", cherry-pick of 1f54fbd) landed on 2.5.0 on 2026-03-12 and removed requirements/rust here too. Cargo writes to $repo_root\target\x86_64-pc-windows-msvc\release, as the artifact upload in the same build log confirms. The wrong path went unnoticed for two months because stale build output from before the revamp was still lying in the Jenkins workspaces -- git checkout does not remove untracked artifacts. Build 1645 ran after agentbuild11's workspace had been wiped ("Compiler version changed, cleaning stale PCH files", full recompile), agentbuild1 followed at 1646. Also add -ErrorAction Stop, matching every neighbouring Copy-Item, so a missing controller fails at setup instead of degrading into an unrelated SyntaxError, and guard _get_ctl_status_line so the shifted-output case reports itself. CMK-34214 Change-Id: I372970caae5702311538e699b7f475bdaa5bedb6
1 parent 974e743 commit a954625

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

agents/wnx/run_tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ function Create_IntegrationTestDir([String]$dir_prefix) {
275275
New-Item -ItemType Directory -Path "$root_dir\plugins" -ErrorAction Stop > nul
276276
Write-Host "Copy exe..." -Foreground White
277277
Copy-Item .\build\check_mk_service\x64\Release\check_mk_service.exe $root_dir\check_mk_agent.exe > nul
278-
Copy-Item $repo_root\requirements\rust\host\target\x86_64-pc-windows-msvc\release\cmk-agent-ctl.exe $root_dir\cmk-agent-ctl.exe > nul
278+
Copy-Item $repo_root\target\x86_64-pc-windows-msvc\release\cmk-agent-ctl.exe $root_dir\cmk-agent-ctl.exe -ErrorAction Stop > nul
279279

280280
Write-Host "Copy cab..." -Foreground White
281281
Copy-Item "$results_dir\python-3.cab" "$root_dir" -Force -ErrorAction Stop > nul # unpack

agents/wnx/tests/integration/test_check_mk_run.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ def _make_config(config: YamlDict, only_from: Sequence[str]) -> YamlDict:
2424

2525
def _get_ctl_status_line(data: Sequence[str]) -> dict[str, str | list | bool]:
2626
s = data[CTL_STATUS_LINE].replace(":false", ":False").replace(":true", ":True")
27+
# An empty cmk_agent_ctl_status section shifts the output and lands us on the next
28+
# section header. Say so, instead of failing with an unrelated SyntaxError.
29+
assert s.startswith("{"), f"No controller status at line {CTL_STATUS_LINE}, got: {s!r}"
2730
return ast.literal_eval(s)
2831

2932

0 commit comments

Comments
 (0)