From 860b1ce64d131146d97cd04e88072b4066806ca4 Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Fri, 15 May 2026 18:54:20 +0000 Subject: [PATCH] =?UTF-8?q?execute:=20fix=20test=20suite=20=E2=80=94=20Yol?= =?UTF-8?q?o=20mode=20for=20CI,=20correct=20classifyStep=20expectation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/tools/execute/execute_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/tools/execute/execute_test.go b/pkg/tools/execute/execute_test.go index 3d0c202..710502c 100644 --- a/pkg/tools/execute/execute_test.go +++ b/pkg/tools/execute/execute_test.go @@ -20,11 +20,13 @@ func TestMain(m *testing.M) { os.Exit(m.Run()) } -// newServer returns a Server with Confirm always returning true. +// newServer returns a Server with Confirm always returning true and Yolo=true +// so tests run without landrun installed in CI. func newServer(t *testing.T) *Server { t.Helper() s := New(t.TempDir()) s.Confirm = func(string) bool { return true } + s.Yolo = true // skip landrun in unit tests return s } @@ -482,9 +484,9 @@ func TestStrictModeAllowsTool(t *testing.T) { // ---- classifyStep ---- func TestClassifyStep(t *testing.T) { - // read-safe inline code - if got := classifyStep(CodeStep{Code: "echo hi"}); got != lockClassRead { - t.Errorf("inline echo: got %v; want read", got) + // inline code is unclassifiable without scanning → global + if got := classifyStep(CodeStep{Code: "echo hi"}); got != lockClassGlobal { + t.Errorf("inline echo: got %v; want global", got) } // elevated → global if got := classifyStep(CodeStep{Elevated: true}); got != lockClassGlobal {