Skip to content

Refactor tests and add platform-specific test cases#623

Merged
creativeprojects merged 2 commits intomasterfrom
refactoring-platform-tests
Apr 8, 2026
Merged

Refactor tests and add platform-specific test cases#623
creativeprojects merged 2 commits intomasterfrom
refactoring-platform-tests

Conversation

@creativeprojects
Copy link
Copy Markdown
Owner

  • Removed the TestFilteredArgumentsRegression from wrapper_test.go and added it to wrapper_unix_test.go for Unix-specific testing.
  • Added new test files for Unix and Windows configurations, including path handling, profile settings, and command execution.
  • Implemented tests for handling environment variables in Unix and Windows.
  • Created tests for path fixing and symlink evaluation in Unix.
  • Added tests for scheduling mechanisms across different platforms (crond, launchd, systemd, and Windows).
  • Introduced tests for shell command execution and argument escaping specific to Unix.
  • Ensured that all tests are properly organized and follow the build constraints for platform-specific execution.

- Removed the TestFilteredArgumentsRegression from wrapper_test.go and added it to wrapper_unix_test.go for Unix-specific testing.
- Added new test files for Unix and Windows configurations, including path handling, profile settings, and command execution.
- Implemented tests for handling environment variables in Unix and Windows.
- Created tests for path fixing and symlink evaluation in Unix.
- Added tests for scheduling mechanisms across different platforms (crond, launchd, systemd, and Windows).
- Introduced tests for shell command execution and argument escaping specific to Unix.
- Ensured that all tests are properly organized and follow the build constraints for platform-specific execution.
Copilot AI review requested due to automatic review settings April 8, 2026 10:59
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.76%. Comparing base (7a64653) to head (647121f).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #623   +/-   ##
=======================================
  Coverage   80.76%   80.76%           
=======================================
  Files         164      164           
  Lines       12116    12116           
=======================================
  Hits         9785     9785           
  Misses       1836     1836           
  Partials      495      495           
Flag Coverage Δ
unittests 79.04% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown

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

This PR reorganizes and expands the test suite by moving OS-dependent tests into platform-specific files (via build tags / OS filename suffixes), and adds additional coverage for path handling, scheduling backends, environment expansion, and FUSE-related remote configuration.

Changes:

  • Split previously runtime-skipped tests into Unix-/Windows-/Darwin-/Systemd-specific test files using build constraints.
  • Added new Unix-focused tests around argument escaping, executable path resolution, path fixing, and symlink evaluation.
  • Adjusted CI/test configuration to include the fuse build tag and moved FUSE-dependent remote tests behind build tags.

Reviewed changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
wrapper_unix_test.go Moved Unix-only wrapper tests behind !windows build tag.
wrapper_test.go Removed Unix-only wrapper tests from the cross-platform test file.
util/executable_unix_test.go Added non-Windows executable resolution tests using a built helper binary.
util/executable_test.go Removed Unix-only executable tests from the shared test file.
shell/expand_env_modifier_test.go Made env expansion tests !windows via build tag instead of runtime skip.
shell/command_unix_test.go Moved interrupt/signalling test to a Unix-only test file.
shell/command_test.go Removed Unix-only interrupt/signalling test from cross-platform file.
shell/arg_unix_test.go Added Unix-only argument escaping test cases.
shell/arg_test.go Removed Unix-only argument escaping tests from cross-platform file.
serve_test.go Made not-found assertion cross-platform by loosening error-message matching.
schedule/schedule_windows_test.go Added Windows scheduler init test (Windows-only via filename suffix).
schedule/schedule_test.go Removed platform-specific scheduler init tests from shared test file.
schedule/schedule_systemd_test.go Added systemd init test behind !windows && !darwin build tag.
schedule/schedule_darwin_test.go Added launchd init test (Darwin-only via filename suffix).
schedule/schedule_crond_test.go Added crond init test behind !windows build tag.
schedule/handler_test.go Made lookupBinary tests !windows via build tag instead of runtime skip.
remote_test.go Removed FUSE-dependent remote configuration tests from the default test set.
remote_fuse_test.go Added FUSE-gated remote configuration tests behind !windows && fuse.
Makefile Updated test-ci to always run tests with -tags=fuse.
main_test.go Simplified binary naming using platform.Executable(...).
lock/lock_test.go Removed non-Windows signal tests from shared lock tests.
lock/lock_signal_test.go Added !windows signal-handling tests in a dedicated file.
integration_test.go Improved Windows skip message for unsupported integration fixtures.
fuse/mount_test.go Gated FUSE mount tests behind !windows && fuse.
filesearch/filesearch_unix_test.go Added !windows tests for tilde expansion and root-relative path behavior.
filesearch/filesearch_test.go Removed Unix-only filesearch tests from the shared test file.
config/profile_unix_test.go Added !windows tests for root/path resolution in profiles.
config/profile_test.go Removed Unix-only profile/path tests from shared test file.
config/path_windows_test.go Added Windows-specific path-fixing tests (Windows-only via filename suffix).
config/path_unix_test.go Added !windows path-fixing + symlink evaluation tests.
config/path_test.go Removed OS-specific path tests from shared file, leaving common env expansion tests.
config/jsonschema/schema_test.go Removed the !ajv_test build constraint from the schema tests.
config/confidential_unix_test.go Added !windows confidential/env-var behavior tests.
config/confidential_test.go Removed Unix-only confidential/env-var tests from shared file.
.vscode/settings.json Updated local Go build tags to include fuse.

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

Comment thread lock/lock_signal_test.go
Comment thread shell/arg_unix_test.go
Comment thread shell/arg_unix_test.go
Comment thread filesearch/filesearch_unix_test.go
Comment thread filesearch/filesearch_unix_test.go
Comment thread config/path_unix_test.go Outdated
Comment thread shell/command_unix_test.go Outdated
Comment thread Makefile
@creativeprojects creativeprojects merged commit cc83d53 into master Apr 8, 2026
8 checks passed
@creativeprojects creativeprojects deleted the refactoring-platform-tests branch April 8, 2026 11:41
@creativeprojects creativeprojects added this to the v0.34.0 milestone Apr 10, 2026
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