Skip to content

Commit

Permalink
Revert "Fix failing integration tests"
Browse files Browse the repository at this point in the history
  • Loading branch information
MDrakos authored Jan 9, 2024
1 parent 50c4f72 commit ccfcbae
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 25 deletions.
3 changes: 0 additions & 3 deletions internal/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,6 @@ const SvcAuthPollingRateEnvVarName = "ACTIVESTATE_SVC_AUTH_POLLING_RATE"
// log rotation timer interval (1 minute).
const SvcLogRotateIntervalEnvVarName = "ACTIVESTATE_CLI_LOG_ROTATE_INTERVAL_MS"

// DisableActivateEventsEnvVarName is the environment variable used to disable events when activating or checking out a project
const DisableActivateEventsEnvVarName = "ACTIVESTATE_CLI_DISABLE_ACTIVATE_EVENTS"

// APIUpdateInfoURL is the URL for our update info server
const APIUpdateInfoURL = "https://platform.activestate.com/sv/state-update/api/v1"

Expand Down
1 change: 0 additions & 1 deletion internal/testhelpers/e2e/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ func sandboxedTestEnvironment(t *testing.T, dirs *Dirs, updatePath bool, extraEn
constants.ServiceSockDir + "=" + dirs.SockRoot,
constants.HomeEnvVarName + "=" + dirs.HomeDir,
systemHomeEnvVarName + "=" + dirs.HomeDir,
constants.DisableActivateEventsEnvVarName + "=true",
"NO_COLOR=true",
"CI=true",
}...)
Expand Down
11 changes: 0 additions & 11 deletions pkg/project/events.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
package project

import (
"os"
"strings"

"github.com/ActiveState/cli/internal/constants"
)

type EventType string

const (
Expand All @@ -21,10 +14,6 @@ func (e EventType) String() string {
}

func ActivateEvents() []EventType {
if strings.EqualFold(os.Getenv(constants.DisableActivateEventsEnvVarName), "true") {
return []EventType{}
}

return []EventType{
Activate,
FirstActivate,
Expand Down
1 change: 0 additions & 1 deletion test/integration/install_scripts_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ func (suite *InstallScriptsIntegrationTestSuite) TestInstall() {
e2e.OptAppendEnv(constants.DisableRuntime + "=false"),
e2e.OptAppendEnv(fmt.Sprintf("%s=%s", constants.AppInstallDirOverrideEnvVarName, appInstallDir)),
e2e.OptAppendEnv(fmt.Sprintf("%s=FOO", constants.OverrideSessionTokenEnvVarName)),
e2e.OptAppendEnv(fmt.Sprintf("%s=false", constants.DisableActivateEventsEnvVarName)),
}
if runtime.GOOS == "windows" {
cmd = "powershell.exe"
Expand Down
8 changes: 3 additions & 5 deletions test/integration/run_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,9 @@ func (suite *RunIntegrationTestSuite) TestRun_Unauthenticated() {

suite.createProjectFile(ts, 2)

cp := ts.SpawnWithOpts(
e2e.OptArgs("activate"),
e2e.OptAppendEnv(constants.DisableRuntime+"=false"),
)
cp.Expect("Activated", e2e.RuntimeSourcingTimeoutOpt)
cp := ts.SpawnWithOpts(e2e.OptArgs("activate"))
cp.Expect("Skipping runtime setup")
cp.Expect("Activated")
cp.ExpectInput(termtest.OptExpectTimeout(10 * time.Second))

cp.SendLine(fmt.Sprintf("%s run testMultipleLanguages", cp.Executable()))
Expand Down
6 changes: 2 additions & 4 deletions test/integration/shell_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,16 @@ func (suite *ShellIntegrationTestSuite) TestShell() {

cp := ts.SpawnWithOpts(
e2e.OptArgs("checkout", "ActiveState-CLI/small-python"),
e2e.OptAppendEnv(constants.DisableRuntime+"=false"),
)
cp.Expect("Checked out project", e2e.RuntimeSourcingTimeoutOpt)
cp.Expect("Checked out project")
cp.ExpectExitCode(0)

args := []string{"small-python", "ActiveState-CLI/small-python"}
for _, arg := range args {
cp := ts.SpawnWithOpts(
e2e.OptArgs("shell", arg),
e2e.OptAppendEnv(constants.DisableRuntime+"=false"),
)
cp.Expect("Activated", e2e.RuntimeSourcingTimeoutOpt)
cp.Expect("Activated")
cp.ExpectInput()

cp.SendLine("python3 --version")
Expand Down

0 comments on commit ccfcbae

Please sign in to comment.