Skip to content

Comments

Address macOS-specific commands in tests#38

Open
southpawriter02 wants to merge 1 commit intomainfrom
fix-tests-macos-commands-13458119408557265821
Open

Address macOS-specific commands in tests#38
southpawriter02 wants to merge 1 commit intomainfrom
fix-tests-macos-commands-13458119408557265821

Conversation

@southpawriter02
Copy link
Owner

This PR addresses test failures on non-macOS environments (Linux) by handling macOS-specific commands and syntax.

Changes include:

  1. Library Fixes:

    • Made lib/security.sh idempotent to prevent "readonly variable" errors when sourced multiple times.
    • Added os_get_package_manager to lib/os/linux.sh.
    • Updated lib/plugins/fc-apps and lib/plugins/fc-update to use cross-platform package management functions instead of hardcoded Homebrew checks.
    • Fixed stat usage in lib/plugins/fc-sync to support both macOS (-f %Lp) and Linux (-c %a).
    • Added || true to pipelines in lib/plugins/fc-apps to avoid SIGPIPE with set -eo pipefail.
  2. Test Updates:

    • Added skip_if_not_macos helper.
    • Updated fc_alfred.bats, fc_defaults.bats, fc_raycast.bats, fc_wifi.bats, fc_dns.bats, and fc_firewall.bats to skip tests on Linux.
    • Updated fc_update.bats to expect "System Packages" on Linux instead of "Homebrew".
    • Fixed stat command usage in fc_secrets.bats, fc_sync.bats, and fc_vscode_sync.bats.
    • Fixed incorrect usage strings in fc_apps.bats.
    • Removed outdated/incorrect tests in fc_maintenance.bats.

These changes ensure that the test suite runs correctly on both macOS and Linux environments.


PR created automatically by Jules for task 13458119408557265821 started by @southpawriter02

- Fix idempotent sourcing in `lib/security.sh` by guarding readonly variables.
- Add `skip_if_not_macos` helper to `tests/test_helper.bash`.
- Update macOS-specific tests (`fc_alfred`, `fc_defaults`, `fc_raycast`, `fc_wifi`, `fc_dns`, `fc_firewall`) to skip on Linux.
- Implement `os_get_package_manager` in `lib/os/linux.sh` and fix function naming in `lib/plugins/fc-apps`.
- Update `lib/plugins/fc-update` to use cross-platform package update functions.
- Fix `stat` command usage in `lib/plugins/fc-sync` and various tests (`fc_secrets`, `fc_sync`, `fc_vscode_sync`) to be OS-aware.
- Prevent SIGPIPE errors in `lib/plugins/fc-apps` pipelines.
- Correct test expectations in `tests/fc_apps.bats` and `tests/fc_update.bats`.
- Remove tests for non-existent `setup` subcommand in `tests/fc_maintenance.bats`.

Co-authored-by: southpawriter02 <207498890+southpawriter02@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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