Skip to content

Commit

Permalink
Removed inapplicable shell test.
Browse files Browse the repository at this point in the history
Its underlying feature was reverted.
  • Loading branch information
mitchell-as committed Oct 9, 2023
1 parent 891e2d2 commit 5baef87
Showing 1 changed file with 0 additions and 47 deletions.
47 changes: 0 additions & 47 deletions test/integration/shell_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,53 +280,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 5baef87

Please sign in to comment.