Skip to content

ci(test): add binary smoke test - #566

Open
amh1k wants to merge 2 commits into
alibaba:mainfrom
amh1k:chore/add-binary-smoke-test
Open

ci(test): add binary smoke test#566
amh1k wants to merge 2 commits into
alibaba:mainfrom
amh1k:chore/add-binary-smoke-test

Conversation

@amh1k

@amh1k amh1k commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a native binary smoke test to the existing CI test job.

Previously, CI built the CLI binary to /dev/null, which verified compilation only. This change builds a real ./opencodereview executable 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

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring (no functional changes)
  • Documentation update
  • CI / Build / Tooling

How Has This Been Tested?

  • make test passes locally

  • Manual testing (describe below)

  • Verified the workflow builds ./opencodereview rather than writing the binary to /dev/null.

  • Added smoke checks for ./opencodereview --version containing open-code-review.

  • Added smoke checks for ./opencodereview --help containing Commands:.

  • Verified the workflow diff with git diff --check.

Checklist

  • My code follows the project's coding style (go fmt, go vet)
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the documentation accordingly (if applicable)
  • I have signed the CLA

Related Issues

Closes #554

@github-actions

Copy link
Copy Markdown
Contributor

OpenCodeReview: No comments generated. Looks good to me.

lizhengfeng101

This comment was marked as outdated.

lizhengfeng101

This comment was marked as outdated.

@lizhengfeng101 lizhengfeng101 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.

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.)

@amh1k

amh1k commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci(test): add binary smoke test to verify built artifact runs correctly

2 participants