test: add group-level --path propagation tests (#60)#104
Closed
test: add group-level --path propagation tests (#60)#104
Conversation
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>
There was a problem hiding this comment.
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, andsessiongroup-level--pathpropagation. - Added a stronger assertion for
summaryoutput 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>
Owner
Author
|
Closing — labels config bug (#107). Will re-dispatch after fix lands. |
This was referenced Mar 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #60
What
Adds four tests verifying that the group-level
--pathoption propagates correctly to all four subcommands (summary,cost,live,session) viactx.obj["path"].Why
Each subcommand contains
path = path or ctx.obj.get("path")to supportcopilot-usage --path /dir summarysyntax, but this fallback path was untested. If the propagation line orctx.obj["path"] = pathinmainwere accidentally removed, no existing test would catch the regression.Tests added
test_summary_group_path_propagationsummarygrp10000-…test_cost_group_path_propagationcostgrp20000-…test_live_group_path_propagationlivegrp30000-…test_session_group_path_propagationsessiongrp40000-…Verification
All 402 tests pass, coverage at 98% (well above the 80% threshold).
Warning
The following domain was blocked by the firewall during workflow execution:
astral.shTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.