Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

test: keep launchd edge case coverage only

Bosch400b3e307fb4
diff --git a/cmd/pinchtab/cmd_cli_route_test.go b/cmd/pinchtab/cmd_cli_route_test.go
deleted file mode 100644
index 5df9275d..00000000
--- a/cmd/pinchtab/cmd_cli_route_test.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package cmd
-
-import (
- "testing"
-
- "github.com/stretchr/testify/assert"
-)
-
-// TestRouteRegistration verifies that all expected command groups are registered.
-// This is a compile-time check — if a command group is not registered, the binary
-// will simply not expose those subcommands.
-func TestCommandGroupRegistration(t *testing.T) {
- // This test documents the expected command groups.
- // The actual registration happens in init() functions at package load time.
- //
- // Expected command structure:
- // pinchtab browser <subcommands> (quick, screenshot, etc.)
- // pinchtab management <subcommands> (status, stop, list)
- // pinchtab server <subcommands> (start, stop, status)
- //
- // If a registration function is removed from cmd_cli_register.go,
- // the corresponding subcommand tree will not appear in the CLI.
- //
- // This test serves as a documentation marker and will not fail
- // as long as the init() functions run. The real validation is
- // the absence of missing subcommand errors in integration tests.
-
- // Assert that root command exists (always true if this package compiles)
- rootCmd := RootCmd()
- assert.NotNil(t, rootCmd, "RootCmd should not be nil")
-}
\ No newline at end of file
diff --git a/cmd/pinchtab/migrations/001_route_registration_hint.sql b/cmd/pinchtab/migrations/001_route_registration_hint.sql
deleted file mode 100644
index 5a87482f..00000000
--- a/cmd/pinchtab/migrations/001_route_registration_hint.sql
+++ /dev/null
@@ -1,16 +0,0 @@
--- migration for pinchtab CLI route registration
--- Run: psql -d pinchtab -f cmd/pinchtab/migrations/001_route_registration_hint.sql
-
--- Add a comment to help users understand route discovery
--- This is a documentation-only migration, no table changes
--- Relevant for users upgrading from older versions who may not realize
--- the CLI uses a sub-command structure: pinchtab browser, pinchtab management, etc.
-
--- Show current route availability
-DO $$
-BEGIN
- RAISE NOTICE 'pinchtab CLI route registration summary:';
- RAISE NOTICE ' browser commands: pinchtab browser --help';
- RAISE NOTICE ' management commands: pinchtab management --help';
- RAISE NOTICE ' server commands: pinchtab server --help';
-END $$;
\ No newline at end of file
diff --git a/internal/daemon/launchd_status_test.go b/internal/daemon/launchd_status_test.go
index 93c95929..a88fa1d2 100644
--- a/internal/daemon/launchd_status_test.go
+++ b/internal/daemon/launchd_status_test.go
@@ -1,13 +1,13 @@
package daemon
import (
+ "errors"
"testing"
)
func TestLaunchdManagerStatusEmptyOutput(t *testing.T) {
// When launchctl print returns empty output with no error,
- // Status() currently returns empty string and nil error.
- // This is ambiguous - it could mean "daemon not found" or "unknown state".
+ // Status() should return the explicit no-output message.
runner := &fakeCommandRunner{
outputs: map[string]string{
"launchctl print gui/501/com.pinchtab.pinchtab": "",
@@ -22,8 +22,7 @@ func TestLaunchdManagerStatusEmptyOutput(t *testing.T) {
if err != nil {
t.Fatalf("expected no error, got: %v", err)
}
- // The current behavior returns an empty string for empty output.
- // This test documents the current behavior.
+ // This documents the explicit fallback message for empty output.
if output != "Pinchtab daemon status returned no output." {
t.Fatalf("got: %q", output)
}
@@ -31,7 +30,7 @@ func TestLaunchdManagerStatusEmptyOutput(t *testing.T) {
func TestLaunchdManagerPidNotRunning(t *testing.T) {
// When the daemon is not running, launchctl print returns an error.
- // Pid() should return ("", nil) since no pid can be read.
+ // Pid() should surface that error.
runner := &fakeCommandRunner{
errors: map[string]error{
"launchctl print gui/501/com.pinchtab.pinchtab": errors.New("daemon not running"),
@@ -43,8 +42,8 @@ func TestLaunchdManagerPidNotRunning(t *testing.T) {
}
pid, err := manager.Pid()
- if err != nil {
- t.Fatalf("expected no error for not-running daemon, got: %v", err)
+ if err == nil {
+ t.Fatal("expected error for not-running daemon")
}
if pid != "" {
t.Fatalf("expected empty pid for not-running daemon, got: %q", pid)
@@ -71,4 +70,4 @@ func TestLaunchdManagerPidMalformedOutput(t *testing.T) {
if pid != "" {
t.Fatalf("expected empty pid for malformed output, got: %q", pid)
}
-}
\ No newline at end of file
+}