Skip to content

fix(spec): add _clwrc test and remove stale SessionEnd tests - #1212

Merged
shunkakinoki merged 3 commits into
mainfrom
fix/shell-test-failures
Mar 19, 2026
Merged

fix(spec): add _clwrc test and remove stale SessionEnd tests#1212
shunkakinoki merged 3 commits into
mainfrom
fix/shell-test-failures

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Mar 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add spec/fish/_clwrc_function_test.fish to satisfy the fish function coverage spec for the recently added _clwrc_function
  • Remove stale SessionEnd hook tests from spec/pushover_spec.sh — the hook was deleted so the tests were failing

Test plan

  • make shell-test passes: 810 examples, 0 failures

🤖 Generated with Claude Code


Summary by cubic

Add Fish spec spec/fish/_clwrc_function_test.fish to verify _clwrc_function calls node with remote-control --worktree and forwards extra args, and remove stale SessionEnd tests in spec/pushover_spec.sh to fix make shell-test failures. Add curl timeouts in config/claude/pushover.sh to prevent hanging stop hooks, and pass config to the make-updater import in home-manager/services/default.nix to fix service wiring.

Written for commit 62d9f6e. Summary will update on new commits.

- Add spec/fish/_clwrc_function_test.fish for new _clwrc_function
- Remove SessionEnd hook tests from pushover_spec.sh (hook deleted)

Entire-Checkpoint: 275a1e436041
Copilot AI review requested due to automatic review settings March 19, 2026 16:58
@mesa-dot-dev

mesa-dot-dev Bot commented Mar 19, 2026

Copy link
Copy Markdown

You do not have enough credits to review this pull request. Please purchase more credits to continue.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on improving test suite hygiene by introducing new tests for a recently added Fish shell function and removing obsolete tests for a deleted hook. The changes ensure that the test suite accurately reflects the current codebase and prevents failures from irrelevant tests.

Highlights

  • New Test File Added: A new test file, spec/fish/_clwrc_function_test.fish, has been added to ensure coverage for the recently introduced _clwrc_function.
  • Stale Tests Removed: Outdated SessionEnd hook tests have been removed from spec/pushover_spec.sh as the corresponding hook was previously deleted, causing these tests to fail.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai

coderabbitai Bot commented Mar 19, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Added a new Fish test for the _clwrc_function helper verifying node invocation and argument passthrough; removed the "SessionEnd hook" test block from the Pushover spec; adjusted a Home Manager module import to pass config into make-updater.

Changes

Cohort / File(s) Summary
Fish test
spec/fish/_clwrc_function_test.fish
Added test that locates and sources _clwrc_function.fish, stubs which, realpath, and node, and asserts node is invoked with remote-control, --worktree, and extra args (e.g., --name). Temporary logs created and cleaned up.
Pushover spec removal
spec/pushover_spec.sh
Removed the entire Describe 'SessionEnd hook' test block including its setup/cleanup and two assertions for session-end notification behavior.
Home Manager import
home-manager/services/default.nix
Changed import of ./make-updater to pass inherit config pkgs (previously passed only pkgs), altering module inputs.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐇 I hopped through tests with a pencil and glee,
Stubbing each call so the truth I could see.
Node danced through remote-control with flags in a row,
SessionEnd whispers? they've quieted — off we go! 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main changes: adding a _clwrc test and removing stale SessionEnd tests from the spec files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description clearly relates to the changeset, explaining the addition of a Fish test file and removal of stale tests.

✏️ 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 fix/shell-test-failures
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@mesa-dot-dev

mesa-dot-dev Bot commented Mar 19, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Fix shell test failures by adding a test for the _clwrc_function fish function, removing stale SessionEnd tests, and correcting the make-updater service wiring.

What changed?

  • spec/fish/_clwrc_function_test.fish: Added a new test suite to ensure the _clwrc_function fish function correctly invokes node with remote-control --worktree and forwards arguments.
  • spec/pushover_spec.sh: Removed stale SessionEnd hook tests and began a new Notification hook testing block.
  • home-manager/services/default.nix: Modified the makeUpdater service import to also inherit the config attribute.

Description generated by Mesa. Update settings

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the repository’s test suite to align with recent hook/function changes: it adds missing fish function coverage for _clwrc_function and removes now-invalid Pushover SessionEnd hook tests after the hook was deleted.

Changes:

  • Add spec/fish/_clwrc_function_test.fish to satisfy fish function coverage requirements for _clwrc_function.
  • Remove stale SessionEnd hook tests from spec/pushover_spec.sh (script no longer handles SessionEnd).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
spec/pushover_spec.sh Removes SessionEnd tests that no longer match config/claude/pushover.sh behavior.
spec/fish/_clwrc_function_test.fish Adds fishtape tests verifying _clwrc_function invokes node ... remote-control --worktree and passes through args.

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

You can also share your feedback on Copilot code review. Take the survey.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds a new test file, spec/fish/_clwrc_function_test.fish, and removes obsolete tests from spec/pushover_spec.sh. I have provided feedback on the new test file to improve test isolation and maintainability. The removal of stale tests is appropriate.

Comment on lines +5 to +28
set log1 (mktemp)
set fake_cli (mktemp)

function which; echo $fake_cli; end
function realpath; echo $argv[1]; end
function node; echo "node" $argv >> $log1; end

_clwrc_function

@test "calls node directly (not claude symlink)" (grep -c "^node" $log1) -ge 1
@test "passes remote-control subcommand" (grep -c "remote-control" $log1) -ge 1
@test "passes --worktree flag" (grep -c -- "--worktree" $log1) -ge 1

# ── with args: passes through extra args ──────────────────────
set log2 (mktemp)
function node; echo "node" $argv >> $log2; end

_clwrc_function --name mysession

@test "passes extra args through" (grep -c -- "--name" $log2) -ge 1
@test "still includes remote-control with args" (grep -c "remote-control" $log2) -ge 1
@test "still includes --worktree with args" (grep -c -- "--worktree" $log2) -ge 1

rm -f $log1 $log2 $fake_cli

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The two test cases in this file are not independent. The second test case relies on mock functions (which, realpath) defined for the first one, and redefines the node mock function. This can make the tests brittle and harder to maintain.

To improve test isolation and clarity, you could define the mock functions once and reuse them for both test cases, clearing the log file between runs. This avoids redefining functions and using separate log files.

# Use a single set of mocks and a single log file for all tests
set logfile (mktemp)
set fake_cli (mktemp)

# Mock external commands
function which; echo $fake_cli; end
function realpath; echo $argv[1]; end
function node; echo "node" $argv >> $logfile; end

# ── basic: resolves symlink and runs node with remote-control --worktree ──
_clwrc_function

@test "calls node directly (not claude symlink)" (grep -c "^node" $logfile) -ge 1
@test "passes remote-control subcommand" (grep -c "remote-control" $logfile) -ge 1
@test "passes --worktree flag" (grep -c -- "--worktree" $logfile) -ge 1

# ── with args: passes through extra args ──────────────────────
: > $logfile # Truncate log for the next test case

_clwrc_function --name mysession

@test "passes extra args through" (grep -c -- "--name" $logfile) -ge 1
@test "still includes remote-control with args" (grep -c "remote-control" $logfile) -ge 1
@test "still includes --worktree with args" (grep -c -- "--worktree" $logfile) -ge 1

# Clean up temporary files
rm -f $logfile $fake_cli

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 2 files

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
spec/fish/_clwrc_function_test.fish (1)

24-26: Strengthen passthrough assertion for --name value.

Current checks confirm --name exists, but they don’t confirm the paired value (mysession) is forwarded. Tightening this makes the arg-pass test more robust.

Suggested assertion refinement
-@test "passes extra args through" (grep -c -- "--name" $log2) -ge 1
+@test "passes --name value through" (grep -c -- "--name mysession" $log2) -ge 1
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@spec/fish/_clwrc_function_test.fish` around lines 24 - 26, The "passes extra
args through" test currently only verifies the presence of "--name" but not its
value; update that test in spec/fish/_clwrc_function_test.fish (the `@test`
"passes extra args through" block) to assert the paired value "mysession" is
forwarded as well by grepping for the combined token "--name mysession" (or an
equivalent regex that ensures "--name" is immediately followed by "mysession"),
so the assertion confirms both flag and value are passed through.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@spec/fish/_clwrc_function_test.fish`:
- Around line 8-10: The test stubs for which, realpath, and node are left
defined and can leak into other specs; update the cleanup block in
_clwrc_function_test.fish (and similarly in _clrc_function_test.fish) to erase
those function definitions by invoking functions --erase for which, realpath,
and node before the existing rm -f temp-file cleanup so the stubs are removed
from the shell namespace and won't affect subsequent tests.

---

Nitpick comments:
In `@spec/fish/_clwrc_function_test.fish`:
- Around line 24-26: The "passes extra args through" test currently only
verifies the presence of "--name" but not its value; update that test in
spec/fish/_clwrc_function_test.fish (the `@test` "passes extra args through"
block) to assert the paired value "mysession" is forwarded as well by grepping
for the combined token "--name mysession" (or an equivalent regex that ensures
"--name" is immediately followed by "mysession"), so the assertion confirms both
flag and value are passed through.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: db9796a9-6840-435f-9576-74b32b0c6e63

📥 Commits

Reviewing files that changed from the base of the PR and between cf7a413 and e4efc6a.

📒 Files selected for processing (2)
  • spec/fish/_clwrc_function_test.fish
  • spec/pushover_spec.sh
💤 Files with no reviewable changes (1)
  • spec/pushover_spec.sh

Comment on lines +8 to +10
function which; echo $fake_cli; end
function realpath; echo $argv[1]; end
function node; echo "node" $argv >> $log1; end

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify whether fish test infrastructure can be affected by leaked function stubs.

# 1) Inspect shell-test/fish runner wiring for process/session reuse clues.
rg -n -C3 'shell-test|fish|fishtape|@test|source spec/fish' Makefile

# 2) Inspect fish specs for global stubs and whether they are erased.
rg -n -C2 'function (which|realpath|node)\b|functions --erase (which|realpath|node)\b' spec/fish

Repository: shunkakinoki/dotfiles

Length of output: 4940


🏁 Script executed:

# 1) List all test files in spec/fish to understand scope
find spec/fish -name '*_test.fish' -type f | sort

# 2) Check the cleanup sections in the mentioned files
head -n 35 spec/fish/_clwrc_function_test.fish | tail -n +20

# 3) Look for any other function definitions that might pollute
rg -n 'function ' spec/fish --type fish | grep -v '^[^:]*:[0-9]*:function (which|realpath|node)'

Repository: shunkakinoki/dotfiles

Length of output: 17321


🏁 Script executed:

# Check _clwrc_function_test.fish lines 18-30
echo "=== _clwrc_function_test.fish ===" && sed -n '18,30p' spec/fish/_clwrc_function_test.fish

# Check _clrc_function_test.fish lines 17-30
echo "=== _clrc_function_test.fish ===" && sed -n '17,30p' spec/fish/_clrc_function_test.fish

# Count total lines in each file
echo "=== Line counts ===" && wc -l spec/fish/_clwrc_function_test.fish spec/fish/_clrc_function_test.fish

Repository: shunkakinoki/dotfiles

Length of output: 1022


🏁 Script executed:

# List test files in order to see what comes after _clwrc_function_test.fish
find spec/fish -name '*_test.fish' -type f | sort

# Search for calls to which, realpath, node (not definitions) in test files
echo "=== Looking for calls to which/realpath/node functions ==="
rg -n 'which|realpath|node' spec/fish/*.fish --type fish | grep -v '^[^:]*:[0-9]*:function (which|realpath|node)' | grep -v '^[^:]*:[0-9]*:`@test`' | head -30

Repository: shunkakinoki/dotfiles

Length of output: 3341


Add function cleanup to prevent stubs leaking into subsequent specs.

Lines 8–10 override which, realpath, and node but only temp files are erased at cleanup (line 28). Since fishtape runs all test files sequentially in a single process, these function stubs persist and pollute the namespace for any specs that run afterward.

Add functions --erase which realpath node at the cleanup section before the rm -f command to ensure stubs don't affect tests in other files.

Suggested fix
 `@test` "still includes remote-control with args" (grep -c "remote-control" $log2) -ge 1
 `@test` "still includes --worktree with args" (grep -c -- "--worktree" $log2) -ge 1

+functions --erase which realpath node
 rm -f $log1 $log2 $fake_cli

The same issue exists in spec/fish/_clrc_function_test.fish (lines 8–10, cleanup at line 26).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@spec/fish/_clwrc_function_test.fish` around lines 8 - 10, The test stubs for
which, realpath, and node are left defined and can leak into other specs; update
the cleanup block in _clwrc_function_test.fish (and similarly in
_clrc_function_test.fish) to erase those function definitions by invoking
functions --erase for which, realpath, and node before the existing rm -f
temp-file cleanup so the stubs are removed from the shell namespace and won't
affect subsequent tests.

- Pass config arg to make-updater import in services/default.nix
- Format spec/pushover_spec.sh (trailing blank line)

Entire-Checkpoint: d2aa9c34776d
Add --max-time 5 and --connect-timeout 3 to curl call so the
Stop hook doesn't hang waiting for the Pushover API when the
network is slow or unreachable, causing 57s+ delays.

Entire-Checkpoint: 472f8aeb3785
@shunkakinoki
shunkakinoki merged commit cf1483f into main Mar 19, 2026
18 of 26 checks passed
@shunkakinoki
shunkakinoki deleted the fix/shell-test-failures branch March 19, 2026 17:15
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.

2 participants