Skip to content

Fix: Fail Windows CI when a listed agentop test does not run, and drop alive - #2050

Merged
huang195 merged 2 commits into
rossoctl:mainfrom
michaljacovi:agentop-windows-nits
Nov 21, 2026
Merged

huang195 merged 2 commits into
rossoctl:mainfrom
michaljacovi:agentop-windows-nits

Conversation

@michaljacovi

Copy link
Copy Markdown
Contributor

Follow-up to #2048 (review nits). Part of #1520.

  • CI: go-ci-windows runs the listed agentop tests with -v, and fails if any listed name has no --- PASS or --- SKIP line. go test -run passes when a name matches nothing, so a renamed test used to drop out silently (review comment 4652840481).
  • alive removed: it was a one-line wrapper for processAlive, and every caller now uses processAlive directly (review comment 4652840487).

How it was tested

  • The step's script, run locally on Windows, passes with the listed names. With an extra name that matches no test, it fails with ::error::TestDoesNotExist did not run.
  • go vet of cmd/agentop passes for windows, linux and darwin.

Assisted-By: Claude (Anthropic AI) noreply@anthropic.com

…p alive

Follow-up to rossoctl#2048 (review nits):

- go-ci-windows runs the listed agentop tests with -v, and fails if a
  name has no "--- PASS" or "--- SKIP" line: `go test -run` passes when
  a name matches nothing, so a renamed test dropped out silently.
- alive was a one-line wrapper for processAlive; the callers use
  processAlive directly.

Part of rossoctl#1520.

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Michal Jacovi <michal.jacovi@il.ibm.com>
@michaljacovi
michaljacovi requested review from a team, huang195 and rubambiza as code owners November 21, 2026 15:59
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 26 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5f944bdd-a31d-4b90-9d73-fed558781c01
Commits

Reviewing files that changed from the base of the PR and between 1adb270 and 072bd26.

Files selected for processing: 8

  • .github/workflows/ci.yaml
  • cmd/agentop/cmd_doctor_checks_test.go
  • cmd/agentop/cmd_uninstall.go
  • cmd/agentop/cmd_uninstall_test.go
  • cmd/agentop/setup_prior_test.go
  • cmd/agentop/setup_probe.go
  • cmd/agentop/setup_step_service.go
  • cmd/agentop/setup_step_service_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot added the ready-for-ai-review Request automated AI code review from clawgenti label Nov 21, 2026

@clawgenti clawgenti left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

The alive removal is clean: no callers are left, processAlive is defined in both proc_unix.go and proc_windows.go, and the Linux agentop and Windows jobs pass on this head. The new check also works for single tests. I ran the bash logic against sample go test -v output. A missing exact name fails with ::error::<name> did not run, subtest lines (indented) do not count, and pipefail still passes a go test failure through tee. On this head the Windows step Build, vet and test cmd/agentop passed with no error annotations, so all eight names matched. I could not download the raw job log because the log blob host timed out from here.

One must-fix: the check matches on a prefix, so it does not cover the TestAddRecordOff_* family. That family is 5 of the 12 tests the step runs, so the promise in the new comment ("a renamed test fails the step instead of silently dropping out") does not hold there. Details inline.

Author: michaljacovi (CONTRIBUTOR, repo admin — maintainer)
Areas reviewed: CI/GitHub Actions (bash step on windows-latest), Go (cmd/agentop)
Agent/IDE config (.claude/.vscode): none
Commits: 1 commit, all signed-off: yes
CI status: passing (Windows and authbridge agentop jobs green on b0ab66c; README demo and macOS peerproc still pending)

Comment thread .github/workflows/ci.yaml Outdated
tests="TestRefuseUnsupported TestProcessAlive TestLockFile TestWritable TestTerminateRefusesOnWindows TestNoRecordWanted TestWithRecordOff TestAddRecordOff"
go test -v -run "^($(echo ${tests} | tr ' ' '|'))" . | tee "${RUNNER_TEMP}/agentop-tests.txt"
for t in ${tests}; do
grep -qE "^--- (PASS|SKIP): ${t}" "${RUNNER_TEMP}/agentop-tests.txt" \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

must-fix: This only checks prefixes, so the TestAddRecordOff entry does not do what the step's comment says. No test is named exactly TestAddRecordOff. The name stands for five tests (TestAddRecordOff_RefusesASettingsOverride, _AppendsToTheEnvironment, _RefusesAnUnreadableSettingsFile, _ChecksClaudeConfigDir, _RefusesAChildThatIsNotClaudeCode). The -run regex has no $, and this grep has no end anchor, so one --- PASS: TestAddRecordOff_<anything> line is enough for the check to pass. Rename or delete four of the five and the step stays green while they drop out of Windows CI. That is the exact failure this PR says it prevents. I confirmed this against sample output where only TestAddRecordOff_AppendsToTheEnvironment ran.

The same gap applies to the exact names. If a TestLockFileStale is ever added, TestLockFile could be renamed without any error.

Suggested fix: list the five tests by their full names in tests, anchor both ends of -run, and end the grep on the space before the duration:

go test -v -run "^($(echo ${tests} | tr ' ' '|'))\$" . | tee "${RUNNER_TEMP}/agentop-tests.txt"
for t in ${tests}; do
  grep -qE "^--- (PASS|SKIP): ${t} \(" "${RUNNER_TEMP}/agentop-tests.txt" \
    || { echo "::error::${t} did not run"; exit 1; }
done

With that change, each listed name stands for exactly one test, and the check is exact.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, thanks. Fixed in 072bd26: the list names all five TestAddRecordOff_* tests in full (every other entry was already an exact name), -run is anchored with ^(…)$, and the check needs --- PASS: <name> ( or --- SKIP: <name> (. Checked locally with the step's script: the list passes (12 tests); an unknown name, or one of the five renamed, fails the step.

Assisted-By: Claude (Anthropic AI) noreply@anthropic.com

From clawgenti's review of rossoctl#2050: the check matched prefixes, so
TestAddRecordOff stood for five tests, and four could vanish while it
stayed green. The list now names all five in full; every other entry
is already one test's exact name. -run is anchored with ^(...)$, and
the check needs "--- PASS: <name> (" or "--- SKIP: <name> (".

Verified locally with the step's script: the list passes (12 tests);
an unknown name, or one of the five renamed, fails the step.

Part of rossoctl#1520.

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Michal Jacovi <michal.jacovi@il.ibm.com>

@clawgenti clawgenti left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

072bd26 fixes the must-fix from my review of b0ab66c. The step now lists all five TestAddRecordOff_* tests by full name, -run is anchored with ^(…)$, and the check needs --- PASS|SKIP: <name> (. Each listed name now stands for exactly one test, so the comment's promise holds. No coverage is lost: the old unanchored regex matched the same 12 tests in cmd/agentop, and every listed name exists as a top-level func Test….

How I checked:

  • I ran the step's script against real go test -v output on Linux at this head. All 12 tests report PASS or SKIP (TestTerminateRefusesOnWindows skips off Windows), and the step exits 0. With a list of TestLockFile TestAddRecordOff, it fails with ::error::TestAddRecordOff did not run and exits 1, so a bare prefix no longer counts.
  • go vet ./... of cmd/agentop passes for linux, windows and darwin. No caller of alive( is left. processAlive is defined in both proc_unix.go and proc_windows.go.
  • On Windows CI, the step Build, vet and test cmd/agentop passed with no annotations, which means none of the 12 names hit the did not run path. I could not download the raw job log because the log blob host timed out from here.

Author: michaljacovi (CONTRIBUTOR, repo admin — maintainer)
Areas reviewed: CI/GitHub Actions (bash step on windows-latest), Go (cmd/agentop)
Agent/IDE config (.claude/.vscode): none
Commits: 2 commits, all signed-off: yes
CI status: all checks passing on 072bd26

@huang195 huang195 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

The alive removal is complete: no caller is left in cmd/agentop. All 12 listed names exist as top-level tests. The Windows job runs with shell: bash, so set -euo pipefail and the loop work. The Windows CI log at 072bd26 shows --- PASS for all 12 names.

Author: michaljacovi (MEMBER — maintainer)
Areas reviewed: CI (GitHub Actions), Go
Agent/IDE config (.claude/.vscode): none
Commits: 2 commits, all signed-off: yes
CI status: passing

Assisted-By: Claude (Anthropic AI) noreply@anthropic.com

@huang195
huang195 merged commit e3b9b8b into rossoctl:main Nov 21, 2026
38 checks passed
@github-project-automation github-project-automation Bot moved this from New/ToDo to Done in Rossoctl Issue Prioritization Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-ai-review Request automated AI code review from clawgenti

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants