Skip to content

Commit

Permalink
Merge pull request #2801 from ActiveState/mitchell/dx-2255
Browse files Browse the repository at this point in the history
Removed inapplicable shell test.
  • Loading branch information
mitchell-as authored Oct 10, 2023
2 parents 15f20e9 + 066b0a5 commit 32bd7a4
Showing 1 changed file with 0 additions and 49 deletions.
49 changes: 0 additions & 49 deletions test/integration/shell_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import (
"github.com/ActiveState/cli/internal/constants"
"github.com/ActiveState/cli/internal/fileutils"
"github.com/ActiveState/cli/internal/subshell"
"github.com/ActiveState/cli/internal/subshell/bash"
"github.com/ActiveState/cli/internal/subshell/sscommon"
"github.com/ActiveState/cli/internal/subshell/zsh"
"github.com/ActiveState/cli/internal/testhelpers/e2e"
"github.com/ActiveState/cli/internal/testhelpers/tagsuite"
Expand Down Expand Up @@ -280,53 +278,6 @@ func (suite *ShellIntegrationTestSuite) SetupRCFile(ts *e2e.Session) {
suite.Require().NoError(err)
}

func (suite *ShellIntegrationTestSuite) TestNestedShellNotification() {
if runtime.GOOS == "windows" {
return // cmd.exe does not have an RC file to check for nested shells in
}
suite.OnlyRunForTags(tagsuite.Shell)
ts := e2e.New(suite.T(), false)
defer ts.Close()

var ss subshell.SubShell
var rcFile string
env := []string{"ACTIVESTATE_CLI_DISABLE_RUNTIME=false"}
switch runtime.GOOS {
case "darwin":
ss = &zsh.SubShell{}
ss.SetBinary("zsh")
rcFile = filepath.Join(ts.Dirs.HomeDir, ".zshrc")
suite.Require().NoError(sscommon.WriteRcFile("zshrc_append.sh", rcFile, sscommon.DefaultID, nil))
env = append(env, "SHELL=zsh") // override since CI tests are running on bash
case "linux":
ss = &bash.SubShell{}
ss.SetBinary("bash")
rcFile = filepath.Join(ts.Dirs.HomeDir, ".bashrc")
suite.Require().NoError(sscommon.WriteRcFile("bashrc_append.sh", rcFile, sscommon.DefaultID, nil))
default:
suite.Fail("Unsupported OS")
}
suite.Require().Equal(filepath.Dir(rcFile), ts.Dirs.HomeDir, "rc file not in test suite homedir")
suite.Require().Contains(string(fileutils.ReadFileUnsafe(rcFile)), "State Tool is operating on project")

cp := ts.Spawn("checkout", "ActiveState-CLI/small-python")
cp.Expect("Checked out project")
cp.ExpectExitCode(0)

cp = ts.SpawnWithOpts(
e2e.OptArgs("shell", "small-python"),
e2e.OptAppendEnv(env...))
cp.Expect("Activated", e2e.RuntimeSourcingTimeoutOpt)
suite.Assert().NotContains(cp.Output(), "State Tool is operating on project")
cp.SendLine(fmt.Sprintf(`export HOME="%s"`, ts.Dirs.HomeDir)) // some shells do not forward this

cp.SendLine(ss.Binary()) // platform-specific shell (zsh on macOS, bash on Linux, etc.)
cp.Expect("State Tool is operating on project ActiveState-CLI/small-python")
cp.SendLine("exit") // subshell within a subshell
cp.SendLine("exit")
cp.ExpectExitCode(0)
}

func (suite *ShellIntegrationTestSuite) TestRuby() {
if runtime.GOOS == "darwin" {
return // Ruby support is not yet enabled on the Platform
Expand Down

0 comments on commit 32bd7a4

Please sign in to comment.