Skip to content

Commit

Permalink
Fix shells tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MDrakos committed Sep 3, 2024
1 parent 8d8234f commit 77c970f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
6 changes: 5 additions & 1 deletion test/integration/shell_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,11 @@ func (suite *ShellIntegrationTestSuite) TestWindowsShells() {

hostname, err := os.Hostname()
suite.Require().NoError(err)
cp := ts.SpawnCmd("cmd", "/C", "state", "shell")
cp := ts.SpawnCmdWithOpts(
"cmd",
e2e.OptArgs("/C", "state", "shell"),
e2e.OptAppendEnv(constants.OverrideShellEnvVarName+"="),
)
cp.ExpectInput()
cp.SendLine("hostname")
cp.Expect(hostname) // cmd.exe shows the actual hostname
Expand Down
11 changes: 9 additions & 2 deletions test/integration/shells_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"runtime"
"testing"

"github.com/ActiveState/cli/internal/constants"
"github.com/ActiveState/cli/internal/testhelpers/suite"

"github.com/ActiveState/cli/internal/fileutils"
Expand Down Expand Up @@ -48,7 +49,10 @@ func (suite *ShellsIntegrationTestSuite) TestShells() {
}

// Run the checkout in a particular shell.
cp = ts.SpawnShellWithOpts(shell)
cp = ts.SpawnShellWithOpts(
shell,
e2e.OptAppendEnv(constants.OverrideShellEnvVarName+"="),
)
cp.SendLine(e2e.QuoteCommand(shell, ts.ExecutablePath(), "checkout", "ActiveState-CLI/small-python", string(shell)))
cp.Expect("Checked out project")
cp.SendLine("exit")
Expand All @@ -58,7 +62,10 @@ func (suite *ShellsIntegrationTestSuite) TestShells() {

// There are 2 or more instances checked out, so we should get a prompt in whichever shell we
// use.
cp = ts.SpawnShellWithOpts(shell)
cp = ts.SpawnShellWithOpts(
shell,
e2e.OptAppendEnv(constants.OverrideShellEnvVarName+"="),
)
cp.SendLine(e2e.QuoteCommand(shell, ts.ExecutablePath(), "shell", "small-python"))
cp.Expect("Multiple project paths")

Expand Down

0 comments on commit 77c970f

Please sign in to comment.