Skip to content

test: add SDK agent install smoke matrix#232

Open
Gradata wants to merge 1 commit into
mainfrom
gra-1680-smoke-matrix
Open

test: add SDK agent install smoke matrix#232
Gradata wants to merge 1 commit into
mainfrom
gra-1680-smoke-matrix

Conversation

@Gradata
Copy link
Copy Markdown
Owner

@Gradata Gradata commented May 29, 2026

Summary

  • Adds a parameterized SDK-native install smoke matrix for supported agent hosts.
  • Covers Claude Code and Codex explicitly, plus Hermes/OpenCode/Gemini hook paths and Cursor MCP path.
  • Uses mocked HOME/USERPROFILE/XDG_CONFIG_HOME via the existing test helper; no operator config dependency.
  • Unsupported hosts must be represented as explicit pytest.skip(...) entries with a tracked reason; current SDK matrix has no silent skips.

Paperclip issue UUID: b8dc9f1f-d114-453a-8bb5-03ae9195df68

Test Plan

  • python3 -m pytest tests/test_cli_install_agent.py -q
  • python3 -m py_compile tests/test_cli_install_agent.py

Local output:

...........                                                              [100%]
11 passed in 2.59s

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3e8e15dd-5e6a-4867-ac29-3f79fb7bc49a

📥 Commits

Reviewing files that changed from the base of the PR and between a197bff and 497bca0.

📒 Files selected for processing (1)
  • Gradata/tests/test_cli_install_agent.py
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: pytest windows-latest / py3.12
  • GitHub Check: pytest macos-latest / py3.11
  • GitHub Check: pytest ubuntu-latest / py3.12
  • GitHub Check: pytest macos-latest / py3.12
  • GitHub Check: pytest windows-latest / py3.11
  • GitHub Check: pytest ubuntu-latest / py3.11
  • GitHub Check: pytest (py3.11)
  • GitHub Check: pytest (py3.12)
🧰 Additional context used
📓 Path-based instructions (1)
Gradata/tests/**/*.py

📄 CodeRabbit inference engine (Gradata/AGENTS.md)

Gradata/tests/**/*.py: Set BRAIN_DIR environment variable via tmp_path in conftest.py for test isolation — ensure _paths.py module cache refreshes when calling Brain.init() directly inside tests
Add unit tests in tests/test_*.py for every CI push without LLM calls (deterministic); mark integration tests with @pytest.mark.integration and skip them by default (they hit real LLM APIs)

Files:

  • Gradata/tests/test_cli_install_agent.py
🔇 Additional comments (2)
Gradata/tests/test_cli_install_agent.py (2)

8-22: LGTM!


59-85: LGTM!


📝 Walkthrough
  • Added SDK agent install smoke matrix: Parameterized test coverage for gradata.cli install --agent across supported agent hosts (Claude Code, Codex, Hermes, OpenCode, Gemini, Cursor MCP)
  • New test function: test_cli_install_agent_smoke_matrix_with_mocked_home() validates agent installation with mocked HOME/USERPROFILE/XDG_CONFIG_HOME environments
  • Config validation: Tests verify config file creation at expected paths, presence of expected markers, brain path inclusion, and CLI output status
  • Explicit skip handling: Unsupported hosts use explicit pytest.skip() with tracked reasons; no silent skips
  • Test results: 11 test cases passing (44 lines added)

Walkthrough

This PR adds pytest-based smoke test coverage for the gradata.cli install --agent command. A parametrized test matrix defines supported agents, their config file paths, and expected configuration markers. A new parametrized test function executes the CLI for each agent and verifies config creation, marker presence, brain path inclusion, and stdout output.

Changes

Agent Installation Smoke Testing

Layer / File(s) Summary
Test matrix and parametrized smoke tests for agent installation
Gradata/tests/test_cli_install_agent.py
AGENT_INSTALL_SMOKE_MATRIX maps agents to config paths and expected markers. Parametrized test test_cli_install_agent_smoke_matrix_with_mocked_home executes the CLI for each agent, verifies config file creation and marker presence, checks brain path inclusion, and asserts stdout indicates agent was added or already present.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding a smoke matrix test for SDK agent installation, which matches the additions in the changeset.
Description check ✅ Passed The description is directly related to the changeset, providing detailed context about the smoke matrix, test coverage, supported agents, and test plan execution.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch gra-1680-smoke-matrix

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 OpenGrep (1.22.0)

OpenGrep fatal error (exit code 2):
┌──────────────┐
│ Opengrep CLI │
└──────────────┘

�[32m✔�[39m �[1mOpengrep OSS�[0m
�[32m✔�[39m Basic security coverage for first-party code vulnerabilities.

�[1m Loading rules from local config...�[0m
[00.13][ERROR]: Error: exception Glob.Lexer.Syntax_error("malformed glob pattern: missing ']'")
Raised at Glob__Lexer.syntax_error in file "libs/glob/Lexer.mll", line 8, characters 2-26
Called from Glob__Lexer.__ocaml_lex_token_rec in file "libs/glob/Lexer.mll", line 29, characters 26-53
Cal


Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant