Skip to content

fix(test): add roborev to shell coverage spec - #1751

Merged
shunkakinoki merged 1 commit into
mainfrom
fix/roborev-coverage-spec
May 11, 2026
Merged

fix(test): add roborev to shell coverage spec#1751
shunkakinoki merged 1 commit into
mainfrom
fix/roborev-coverage-spec

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented May 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds home-manager/services/roborev/activate.sh to the covered_scripts list in spec/coverage_spec.sh
  • Creates spec/activate_roborev_spec.sh with tests for the activate script and default.nix

The shell-test CI job has been failing since #1745 (roborev service) because the new activate.sh was not registered in the coverage spec.

Test plan

  • shell-test CI job passes
  • spec/activate_roborev_spec.sh tests pass

🤖 Generated with Claude Code


Summary by cubic

Registers home-manager/services/roborev/activate.sh in the shell coverage list and adds tests for the activate script and default.nix. Fixes the failing shell-test CI job introduced with the roborev service.

Written for commit 6ee15c5. Summary will update on new commits.

… list

Closes the shell-test CI failure caused by the roborev activate.sh not
being registered in coverage_spec.sh after #1745.
@indent-zero

indent-zero Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor
PR Summary

Re-greens the shell-test CI by registering home-manager/services/roborev/activate.sh (added in #1745) in spec/coverage_spec.sh's covered_scripts allow-list, and adds a corresponding shellspec file modeled on spec/activate_qmd_spec.sh that statically grep-verifies the activation script and its default.nix manifest.

  • spec/coverage_spec.sh: appends home-manager/services/roborev/activate.sh to the covered_scripts heredoc so the git ls-files '*.sh' vs. allow-list diff is empty again.
  • spec/activate_roborev_spec.sh (new): asserts the bash shebang, mkdir -p, and chmod 700 in activate.sh, plus the isGalactica || isMatic host gate, the "daemon" argument, and the exact "${./activate.sh}" "${dataDir}" invocation in default.nix.

Issues

1 potential issue found:

  • spec/activate_roborev_spec.sh is missing the #!/usr/bin/env bash shebang and # shellcheck disable=SC2016,SC2329 header that every other spec/activate_*_spec.sh sibling (qmd, paperclip_openclaw, k3s, neovim, tailscale) starts with. → Autofix

CI Checks

Waiting for CI checks...


⚡ Autofix All Issues

@mesa-dot-dev

mesa-dot-dev Bot commented May 11, 2026

Copy link
Copy Markdown

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

@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Summary by CodeRabbit

  • Tests
    • Added comprehensive validation tests for Roborev service components.
    • Updated test coverage tracking to include new service script.

Walkthrough

New test specifications are added to validate the Roborev service activation script and its configuration module. The activate script tests confirm proper shebang, directory creation, and permission handling. The default.nix tests verify service conditional gating, daemon presence, and parameter passing. Coverage tracking is updated to include the new activation script.

Changes

Roborev Service Test Coverage

Layer / File(s) Summary
Activate Script Tests
spec/activate_roborev_spec.sh
Tests assert bash shebang, mkdir -p directory creation, and chmod 700 permission setup in the activate script.
Default Configuration Tests
spec/activate_roborev_spec.sh
Tests verify service is enabled only for isGalactica || isMatic, daemon execution is present, and dataDir is passed to the activate script invocation.
Coverage Script Registration
spec/coverage_spec.sh
home-manager/services/roborev/activate.sh is added to covered_scripts list to ensure all repository shell scripts are tracked in coverage validation.

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly Related PRs

  • shunkakinoki/dotfiles#1745: Adds the Roborev service implementation files (activate.sh and default.nix) that these test specs directly validate.
  • shunkakinoki/dotfiles#891: Also adds shell script test specs and updates spec/coverage_spec.sh to register the new script in the covered list, following the same pattern.

🐰 A spec file hops to life,
Testing Roborev's activation bright,
Directory, permissions all right,
Service gates checked day and night,
Coverage tracking shines so light! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(test): add roborev to shell coverage spec' clearly and concisely summarizes the main change: registering the roborev activate.sh script in the shell coverage specification.
Description check ✅ Passed The description directly relates to the changeset, explaining that it adds roborev/activate.sh to the coverage list and creates tests for the roborev components, with clear context about the failing CI job.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 fix/roborev-coverage-spec

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 May 11, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Adds home-manager/services/roborev/activate.sh to the covered_scripts list in spec/coverage_spec.sh and creates spec/activate_roborev_spec.sh with tests for the activate script and default.nix. This fixes the failing shell-test CI job.

What changed?

  • spec/coverage_spec.sh: Added home-manager/services/roborev/activate.sh to the covered_scripts list.
  • spec/activate_roborev_spec.sh: Creates spec/activate_roborev_spec.sh with tests for the activate script and default.nix.

Description generated by Mesa. Update settings

@shunkakinoki
shunkakinoki merged commit 904429f into main May 11, 2026
27 of 30 checks passed
@shunkakinoki
shunkakinoki deleted the fix/roborev-coverage-spec branch May 11, 2026 11:03
@@ -0,0 +1,35 @@
Describe 'home-manager/services/roborev/activate.sh'

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.

Missing standard spec header: every other spec/activate_*_spec.sh file (activate_qmd_spec.sh, activate_paperclip_openclaw_spec.sh, activate_k3s_spec.sh, activate_neovim_spec.sh, activate_tailscale_spec.sh) begins with:

#!/usr/bin/env bash
# shellcheck disable=SC2016,SC2329

This file starts directly with Describe, which is inconsistent with the established convention and may surface SC2016/SC2329 warnings on the inline single-quoted bash -c "grep '...' '$SCRIPT'" patterns when shellcheck runs over the spec directory.

Suggested change
Describe 'home-manager/services/roborev/activate.sh'
#!/usr/bin/env bash
# shellcheck disable=SC2016,SC2329
Describe 'home-manager/services/roborev/activate.sh'

@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 introduces a new test suite for the roborev service and updates the coverage manifest. Feedback recommends optimizing the ShellSpec tests by removing redundant shell wrappers, utilizing more efficient search commands, and ensuring the new test file is properly integrated into the repository's coverage verification process.

Comment thread spec/coverage_spec.sh
home-manager/services/openclaw/activate.sh
home-manager/services/paperclip/activate.sh
home-manager/services/qmd/activate.sh
home-manager/services/roborev/activate.sh

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

While the script is correctly added to the covered_scripts list here, it is missing a corresponding It block in the first Describe section of this file (around line 206) to verify that the spec file itself exists. Following the established pattern in this repository ensures that new spec files are tracked and not accidentally deleted.

SCRIPT="$PWD/home-manager/services/roborev/activate.sh"

It 'uses bash shebang'
When run bash -c "head -1 '$SCRIPT'"

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 use of bash -c inside When run is unnecessary for simple commands like head or grep. ShellSpec can execute these directly, which is cleaner and more efficient. Additionally, using head -n 1 is more standard than head -1. This pattern should be applied to lines 10, 15, 22, and 27 as well.

Suggested change
When run bash -c "head -1 '$SCRIPT'"
When run head -n 1 "$SCRIPT"

End

It 'passes data dir to activate script'
When run cat "$PWD/home-manager/services/roborev/default.nix"

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

Using cat to read an entire file just to check for a specific string is less efficient than using grep directly. It is better to use grep to search for the pattern, which is also more consistent with the other tests in this file.

Suggested change
When run cat "$PWD/home-manager/services/roborev/default.nix"
When run grep '"${./activate.sh}" "${dataDir}"' "$PWD/home-manager/services/roborev/default.nix"
References
  1. Maintain consistency with established patterns for writing scripts that are extracted from Nix expressions.

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