Skip to content

test: add group-level --path propagation tests (#60)#104

Closed
microsasa wants to merge 1 commit intomainfrom
fix/60-group-path-propagation-tests-9ce083d246d262a2
Closed

test: add group-level --path propagation tests (#60)#104
microsasa wants to merge 1 commit intomainfrom
fix/60-group-path-propagation-tests-9ce083d246d262a2

Conversation

@microsasa
Copy link
Owner

Closes #60

What

Adds four tests verifying that the group-level --path option propagates correctly to all four subcommands (summary, cost, live, session) via ctx.obj["path"].

Why

Each subcommand contains path = path or ctx.obj.get("path") to support copilot-usage --path /dir summary syntax, but this fallback path was untested. If the propagation line or ctx.obj["path"] = path in main were accidentally removed, no existing test would catch the regression.

Tests added

Test Subcommand Session ID
test_summary_group_path_propagation summary grp10000-…
test_cost_group_path_propagation cost grp20000-…
test_live_group_path_propagation live grp30000-…
test_session_group_path_propagation session grp40000-…

Verification

All 402 tests pass, coverage at 98% (well above the 80% threshold).

Generated by Issue Implementer ·

Warning

⚠️ Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • astral.sh

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "astral.sh"

See Network Configuration for more information.

Add four tests verifying that --path passed at the group level
(before the subcommand name) propagates correctly to summary, cost,
live, and session subcommands via ctx.obj. These tests use the exact
session IDs and assertions specified in issue #60.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 15, 2026 21:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds additional CLI tests to verify that group-level --path is honored by subcommands when --path isn’t provided at the subcommand level.

Changes:

  • Added new tests for summary, cost, live, and session group-level --path propagation.
  • Added a stronger assertion for summary output containing the session name.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +751 to +785
def test_summary_group_path_propagation(tmp_path: Path) -> None:
"""summary reads --path from group level when not provided at subcommand level."""
_write_session(tmp_path, "grp10000-0000-0000-0000-000000000000", name="GroupPath")
runner = CliRunner()
# --path before subcommand name → stored in ctx.obj, not subcommand
result = runner.invoke(main, ["--path", str(tmp_path), "summary"])
assert result.exit_code == 0
assert "GroupPath" in result.output


def test_cost_group_path_propagation(tmp_path: Path) -> None:
_write_session(tmp_path, "grp20000-0000-0000-0000-000000000000", name="CostGroup")
runner = CliRunner()
result = runner.invoke(main, ["--path", str(tmp_path), "cost"])
assert result.exit_code == 0


def test_live_group_path_propagation(tmp_path: Path) -> None:
_write_session(
tmp_path, "grp30000-0000-0000-0000-000000000000", name="LiveGroup", active=True
)
runner = CliRunner()
result = runner.invoke(main, ["--path", str(tmp_path), "live"])
assert result.exit_code == 0


def test_session_group_path_propagation(tmp_path: Path) -> None:
sid = "grp40000-0000-0000-0000-000000000000"
_write_session(tmp_path, sid, name="SessGroup")
runner = CliRunner()
# session needs the session_id positional argument
result = runner.invoke(main, ["--path", str(tmp_path), "session", sid[:8]])
assert result.exit_code == 0


_write_session(tmp_path, "grp20000-0000-0000-0000-000000000000", name="CostGroup")
runner = CliRunner()
result = runner.invoke(main, ["--path", str(tmp_path), "cost"])
assert result.exit_code == 0
)
runner = CliRunner()
result = runner.invoke(main, ["--path", str(tmp_path), "live"])
assert result.exit_code == 0
runner = CliRunner()
# session needs the session_id positional argument
result = runner.invoke(main, ["--path", str(tmp_path), "session", sid[:8]])
assert result.exit_code == 0
microsasa pushed a commit that referenced this pull request Mar 15, 2026
Remove labels: ["aw"] from issue-implementer create-pull-request
config. The config-level labels feature has a gh-aw runtime bug where
the post-creation label API call fails with a node ID resolution error.
This caused PR #104 to be created without the aw label.

Reverts the labels portion of PR #97. The agent instruction to add the
aw label remains and works reliably (worked for PRs #61-91).

Closes #107, refs #108

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@microsasa
Copy link
Owner Author

Closing — labels config bug (#107). Will re-dispatch after fix lands.

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.

[aw][test audit] Group-level --path option propagation to subcommands is untested

2 participants