From 0f4e5e73efbde8f1d9728ba37cfd5b6467ad64b2 Mon Sep 17 00:00:00 2001 From: Mike Drakos Date: Tue, 24 Sep 2024 11:36:11 -0700 Subject: [PATCH 1/2] Add language to script --- internal/scriptrun/test/integration/scriptrun_test.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/internal/scriptrun/test/integration/scriptrun_test.go b/internal/scriptrun/test/integration/scriptrun_test.go index 630e243711..b93b25cea8 100644 --- a/internal/scriptrun/test/integration/scriptrun_test.go +++ b/internal/scriptrun/test/integration/scriptrun_test.go @@ -353,6 +353,7 @@ project: "https://platform.activestate.com/ActiveState/project" scripts: - name: %s standalone: true + language: batch value: | echo "ARGS|%%1|%%2|%%3|%%4|"`, cmdName) } @@ -363,15 +364,12 @@ scripts: } func captureExecCommand(t *testing.T, tmplCmdName, cmdName string, cmdArgs []string) (string, error) { - auth, err := authentication.LegacyGet() require.NoError(t, err) pjfile := setupProjectWithScriptsExpectingArgs(t, tmplCmdName) - proj, err := project.New(pjfile, nil) require.NoError(t, err) - cfg, err := config.New() require.NoError(t, err) defer func() { require.NoError(t, cfg.Close()) }() @@ -384,7 +382,6 @@ func captureExecCommand(t *testing.T, tmplCmdName, cmdName string, cmdArgs []str } }) require.NoError(t, outErr, "error capturing stdout") - return outStr, err } From fac08a8c68b8bc8c00204ca9a1feb10412db054f Mon Sep 17 00:00:00 2001 From: mdrakos Date: Tue, 24 Sep 2024 13:09:58 -0700 Subject: [PATCH 2/2] Fix panic --- internal/scriptrun/test/integration/scriptrun_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/scriptrun/test/integration/scriptrun_test.go b/internal/scriptrun/test/integration/scriptrun_test.go index b93b25cea8..506a7da279 100644 --- a/internal/scriptrun/test/integration/scriptrun_test.go +++ b/internal/scriptrun/test/integration/scriptrun_test.go @@ -29,6 +29,7 @@ import ( "github.com/ActiveState/cli/internal/testhelpers/osutil" "github.com/ActiveState/cli/internal/testhelpers/outputhelper" "github.com/ActiveState/cli/pkg/platform/authentication" + "github.com/ActiveState/cli/pkg/platform/model" "github.com/ActiveState/cli/pkg/project" "github.com/ActiveState/cli/pkg/projectfile" ) @@ -119,7 +120,7 @@ func (suite *ScriptRunSuite) TestEnvIsSet() { cfg.Set(constants.AsyncRuntimeConfig, true) out := capturer.CaptureOutput(func() { - scriptRun := scriptrun.New(primer.New(auth, outputhelper.NewCatcher(), subshell.New(cfg), proj, cfg, blackhole.New())) + scriptRun := scriptrun.New(primer.New(auth, outputhelper.NewCatcher(), subshell.New(cfg), proj, cfg, blackhole.New(), model.NewSvcModel(""))) script, err := proj.ScriptByName("run") require.NoError(t, err, "Error: "+errs.JoinMessage(err)) err = scriptRun.Run(script, nil)