MCPcopy Create free account
hub / github.com/github/gh-aw / TestBuildEngineCommandScriptSetup

Function TestBuildEngineCommandScriptSetup

pkg/workflow/copilot_engine_test.go:2799–2823  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2797}
2798
2799func TestBuildEngineCommandScriptSetup(t *testing.T) {
2800 setup := buildEngineCommandScriptSetup("/usr/local/bin/custom-copilot")
2801
2802 if !strings.Contains(setup, "umask 0177") {
2803 t.Fatalf("Expected restrictive umask in script setup, got:\n%s", setup)
2804 }
2805 if !strings.Contains(setup, "chmod 700 /tmp/gh-aw/engine-command.sh") {
2806 t.Fatalf("Expected owner-only execute permissions, got:\n%s", setup)
2807 }
2808 if !strings.Contains(setup, "cat > /tmp/gh-aw/engine-command.sh <<'GH_AW_ENGINE_COMMAND_EOF'") {
2809 t.Fatalf("Expected heredoc-based script materialization, got:\n%s", setup)
2810 }
2811 if !strings.Contains(setup, "set -eo pipefail") {
2812 t.Fatalf("Expected script strict mode without -u, got:\n%s", setup)
2813 }
2814 if strings.Contains(setup, "set -euo pipefail") {
2815 t.Fatalf("Expected script strict mode to drop -u, got:\n%s", setup)
2816 }
2817 if !strings.Contains(setup, "set +o histexpand") {
2818 t.Fatalf("Expected histexpand disabled in engine command script, got:\n%s", setup)
2819 }
2820 if !strings.Contains(setup, `/usr/local/bin/custom-copilot "$@"`) {
2821 t.Fatalf("Expected custom command to forward driver args, got:\n%s", setup)
2822 }
2823}
2824
2825func TestCopilotSupportsNoAskUser(t *testing.T) {
2826 defaultSupported := semverutil.Compare(

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected