ci(test): add binary smoke test - #566
Conversation
|
✅ OpenCodeReview: No comments generated. Looks good to me. |
lizhengfeng101
left a comment
There was a problem hiding this comment.
Review
Overall the change is clean and effective. Two suggestions:
1. Assert that core subcommands exist in --help output
Currently the smoke test only checks that the string Commands: is present. If a contributor accidentally removes a subcommand registration, CI won't catch it. Suggest asserting all core subcommands:
- name: Smoke test
run: |
./opencodereview --version
./opencodereview --version | grep -q "open-code-review"
HELP=$(./opencodereview --help)
echo "$HELP" | grep -q "Commands:"
echo "$HELP" | grep -q "review"
echo "$HELP" | grep -q "scan"
echo "$HELP" | grep -q "delegate"
echo "$HELP" | grep -q "config"
echo "$HELP" | grep -q "llm"
echo "$HELP" | grep -q "viewer"
echo "$HELP" | grep -q "session"
echo "$HELP" | grep -q "rules"2. Clean up the binary after the smoke test
rm -f ./opencodereview(Please ignore the two earlier Chinese comments — they are superseded by this one.)
Done |
Description
Adds a native binary smoke test to the existing CI
testjob.Previously, CI built the CLI binary to
/dev/null, which verified compilation only. This change builds a real./opencodereviewexecutable and verifies that it starts successfully, prints version information, and renders CLI help correctly.The cross-compile job remains unchanged because its target binaries cannot run on the Linux CI runner.
Type of Change
How Has This Been Tested?
make testpasses locallyManual testing (describe below)
Verified the workflow builds
./opencodereviewrather than writing the binary to/dev/null.Added smoke checks for
./opencodereview --versioncontainingopen-code-review.Added smoke checks for
./opencodereview --helpcontainingCommands:.Verified the workflow diff with
git diff --check.Checklist
go fmt,go vet)Related Issues
Closes #554