diff --git a/test/integration/shell_int_test.go b/test/integration/shell_int_test.go index 17e1a6eaa5..9f3f06d53c 100644 --- a/test/integration/shell_int_test.go +++ b/test/integration/shell_int_test.go @@ -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" @@ -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