From 3a069d5308f2b9a08c8ff445ed6da535be6aca2e Mon Sep 17 00:00:00 2001 From: Nathan Rijksen Date: Wed, 23 Aug 2023 14:23:27 -0700 Subject: [PATCH] Use `Output()` instead of `Snapshot()` as that was what the original implementation did, despite the name --- .../test/integration/installer_int_test.go | 10 ++++----- .../test/integration/svc_int_test.go | 6 ++--- test/automation/invite_neg_automation_test.go | 4 ++-- test/integration/activate_int_test.go | 8 +++---- test/integration/auth_int_test.go | 2 +- test/integration/condition_int_test.go | 4 ++-- test/integration/edit_int_test.go | 2 +- test/integration/events_int_test.go | 2 +- test/integration/exec_int_test.go | 2 +- test/integration/export_int_test.go | 2 +- test/integration/history_int_test.go | 2 +- test/integration/install_scripts_int_test.go | 2 +- test/integration/languages_int_test.go | 2 +- test/integration/msg_int_test.go | 8 +++---- test/integration/package_int_test.go | 2 +- test/integration/performance_int_test.go | 6 ++--- test/integration/platforms_int_test.go | 4 ++-- test/integration/progress_int_test.go | 2 +- test/integration/projects_int_test.go | 2 +- test/integration/refresh_int_test.go | 2 +- test/integration/revert_int_test.go | 2 +- test/integration/run_int_test.go | 4 ++-- test/integration/secrets_int_test.go | 2 +- test/integration/shell_int_test.go | 2 +- test/integration/update_int_test.go | 4 ++-- test/integration/version_int_test.go | 2 +- test/integration/vscode_int_test.go | 22 +++++++++---------- 27 files changed, 56 insertions(+), 56 deletions(-) diff --git a/cmd/state-installer/test/integration/installer_int_test.go b/cmd/state-installer/test/integration/installer_int_test.go index 275b854d35..46e2fc58b3 100644 --- a/cmd/state-installer/test/integration/installer_int_test.go +++ b/cmd/state-installer/test/integration/installer_int_test.go @@ -58,7 +58,7 @@ func (suite *InstallerIntegrationTestSuite) TestInstallFromLocalSource() { if runtime.GOOS == "darwin" && condition.OnCI() { cp.Expect("You are running bash on macOS") } - suite.NotContains(cp.Snapshot(), "Downloading State Tool") + suite.NotContains(cp.Output(), "Downloading State Tool") cp.ExpectInput() cp.SendLine("exit") cp.ExpectExitCode(0) @@ -113,7 +113,7 @@ func (suite *InstallerIntegrationTestSuite) TestInstallFromLocalSource() { cp.SendLine("exit") cp.ExpectExitCode(0) - snapshot := strings.Replace(cp.Snapshot(), "\n", "", -1) + snapshot := strings.Replace(cp.Output(), "\n", "", -1) if !strings.Contains(snapshot, stateExec) && !strings.Contains(snapshot, stateExecResolved) { suite.Fail(fmt.Sprintf("Snapshot does not include '%s' or '%s', snapshot:\n %s", stateExec, stateExecResolved, snapshot)) } @@ -166,7 +166,7 @@ func (suite *InstallerIntegrationTestSuite) TestInstallNoErrorTips() { ) cp.ExpectExitCode(1) - suite.Assert().NotContains(cp.Snapshot(), "Need More Help?", "error tips should not be displayed when invoking installer") + suite.Assert().NotContains(cp.Output(), "Need More Help?", "error tips should not be displayed when invoking installer") } func (suite *InstallerIntegrationTestSuite) TestInstallErrorTips() { @@ -189,7 +189,7 @@ func (suite *InstallerIntegrationTestSuite) TestInstallErrorTips() { cp.ExpectInput() cp.SendLine("exit") cp.Wait() - suite.Assert().Contains(cp.Snapshot(), "Need More Help?", "error tips should be displayed in shell created by installer") + suite.Assert().Contains(cp.Output(), "Need More Help?", "error tips should be displayed in shell created by installer") } func (suite *InstallerIntegrationTestSuite) TestStateTrayRemoval() { @@ -248,7 +248,7 @@ func (suite *InstallerIntegrationTestSuite) TestStateTrayRemoval() { stateExec, err := installation.StateExecFromDir(dir) suite.Require().NoError(err) cp = ts.SpawnCmdWithOpts(stateExec, e2e.OptArgs("--version")) - suite.Assert().NotContains(cp.Snapshot(), version) + suite.Assert().NotContains(cp.Output(), version) cp.ExpectExitCode(0) } diff --git a/cmd/state-svc/test/integration/svc_int_test.go b/cmd/state-svc/test/integration/svc_int_test.go index 8d7d3cdc08..7895b0a05c 100644 --- a/cmd/state-svc/test/integration/svc_int_test.go +++ b/cmd/state-svc/test/integration/svc_int_test.go @@ -54,14 +54,14 @@ func (suite *SvcIntegrationTestSuite) TestStartStop() { // Verify the server is running on its reported port. cp.ExpectRe("Port:\\s+:\\d+\\s") portRe := regexp.MustCompile("Port:\\s+:(\\d+)") - port := portRe.FindStringSubmatch(cp.Snapshot())[1] + port := portRe.FindStringSubmatch(cp.Output())[1] _, err := net.Listen("tcp", "localhost:"+port) suite.Error(err) // Verify it created and wrote to its reported log file. cp.ExpectRe("Log:\\s+.+?\\.log") logRe := regexp.MustCompile("Log:\\s+(.+?\\.log)") - logFile := logRe.FindStringSubmatch(cp.Snapshot())[1] + logFile := logRe.FindStringSubmatch(cp.Output())[1] suite.True(fileutils.FileExists(logFile), "log file '"+logFile+"' does not exist") suite.True(len(fileutils.ReadFileUnsafe(logFile)) > 0, "log file is empty") @@ -113,7 +113,7 @@ func (suite *SvcIntegrationTestSuite) TestSignals() { cp.Expect("Starting") time.Sleep(1 * time.Second) // wait for the service to start up cp.Cmd().Process.Signal(syscall.SIGTERM) - suite.NotContains(cp.Snapshot(), "caught a signal") + suite.NotContains(cp.Output(), "caught a signal") cp.ExpectExitCode(0) // should exit gracefully cp = ts.SpawnCmdWithOpts(ts.SvcExe, e2e.OptArgs("status")) diff --git a/test/automation/invite_neg_automation_test.go b/test/automation/invite_neg_automation_test.go index d79fceaff4..de3bf74fde 100644 --- a/test/automation/invite_neg_automation_test.go +++ b/test/automation/invite_neg_automation_test.go @@ -122,7 +122,7 @@ func (suite *InviteNegativeAutomationTestSuite) TestInvite_NonExistentArgValues_ // `-n` flag used cp = ts.Spawn("invite", "qatesting+3@activestate.com", "-n") cp.ExpectExitCode(1) - suite.Assert().NotContains(cp.Snapshot(), "Invalid role") // there is an error, just not this one + suite.Assert().NotContains(cp.Output(), "Invalid role") // there is an error, just not this one } func (suite *InviteNegativeAutomationTestSuite) TestInvite_NonExistentArgValues_Private() { @@ -153,7 +153,7 @@ func (suite *InviteNegativeAutomationTestSuite) TestInvite_NonExistentArgValues_ // `-n` flag used cp = ts.Spawn("invite", "qatesting+3@activestate.com", "-n") cp.ExpectExitCode(1) - suite.Assert().NotContains(cp.Snapshot(), "Invalid role") // there is an error, just not this one + suite.Assert().NotContains(cp.Output(), "Invalid role") // there is an error, just not this one } func TestInviteAutomationTestSuite(t *testing.T) { diff --git a/test/integration/activate_int_test.go b/test/integration/activate_int_test.go index 5f0b5f612e..a3c92274d9 100644 --- a/test/integration/activate_int_test.go +++ b/test/integration/activate_int_test.go @@ -308,7 +308,7 @@ func (suite *ActivateIntegrationTestSuite) TestActivate_PythonPath() { } else { cp.Send("echo $PYTHONPATH") } - suite.Assert().NotContains(cp.Snapshot(), constants.LocalRuntimeTempDirectory) + suite.Assert().NotContains(cp.Output(), constants.LocalRuntimeTempDirectory) // Verify the temp runtime setup directory has been removed. runtimeFound := false entries, err := fileutils.ListDir(ts.Dirs.Cache, true) @@ -382,7 +382,7 @@ func (suite *ActivateIntegrationTestSuite) TestActivatePerl() { cp.Expect("Installing", termtest.OptExpectTimeout(140*time.Second)) cp.Expect("Activated") - suite.assertCompletedStatusBarReport(cp.Snapshot()) + suite.assertCompletedStatusBarReport(cp.Output()) // ensure that shell is functional cp.ExpectInput() @@ -511,7 +511,7 @@ func (suite *ActivateIntegrationTestSuite) TestActivate_FromCache() { cp.Expect("Installing") cp.Expect("Activated") - suite.assertCompletedStatusBarReport(cp.Snapshot()) + suite.assertCompletedStatusBarReport(cp.Output()) cp.SendLine("exit") cp.ExpectExitCode(0) @@ -524,7 +524,7 @@ func (suite *ActivateIntegrationTestSuite) TestActivate_FromCache() { cp.ExpectInput() cp.SendLine("exit") cp.ExpectExitCode(0) - suite.NotContains(cp.Snapshot(), "Downloading") + suite.NotContains(cp.Output(), "Downloading") } func TestActivateIntegrationTestSuite(t *testing.T) { diff --git a/test/integration/auth_int_test.go b/test/integration/auth_int_test.go index c425bcb934..ba3adfd903 100644 --- a/test/integration/auth_int_test.go +++ b/test/integration/auth_int_test.go @@ -111,7 +111,7 @@ func (suite *AuthIntegrationTestSuite) authOutput(method string) { cp := ts.Spawn(tagsuite.Auth, "--output", method) cp.Expect("false}") cp.ExpectExitCode(0) - suite.Equal(fmt.Sprintf("%s", string(expected)), cp.Snapshot()) + suite.Equal(fmt.Sprintf("%s", string(expected)), cp.Output()) } func (suite *AuthIntegrationTestSuite) TestAuth_JsonOutput() { diff --git a/test/integration/condition_int_test.go b/test/integration/condition_int_test.go index 32c86cf7dc..d69f00f599 100644 --- a/test/integration/condition_int_test.go +++ b/test/integration/condition_int_test.go @@ -66,8 +66,8 @@ func (suite *ConditionIntegrationTestSuite) TestMixin() { e2e.OptArgs("run", "MixinUser"), ) cp.ExpectExitCode(0) - suite.Assert().NotContains(cp.Snapshot(), "authenticated: yes", "expected not to be authenticated, output was:\n%s.", cp.Snapshot()) - suite.Assert().NotContains(cp.Snapshot(), e2e.PersistentUsername, "expected not to be authenticated, output was:\n%s", cp.Snapshot()) + suite.Assert().NotContains(cp.Output(), "authenticated: yes", "expected not to be authenticated, output was:\n%s.", cp.Output()) + suite.Assert().NotContains(cp.Output(), e2e.PersistentUsername, "expected not to be authenticated, output was:\n%s", cp.Output()) ts.LoginAsPersistentUser() defer ts.LogoutUser() diff --git a/test/integration/edit_int_test.go b/test/integration/edit_int_test.go index 6b48845e3c..f03e457d4c 100644 --- a/test/integration/edit_int_test.go +++ b/test/integration/edit_int_test.go @@ -115,7 +115,7 @@ func (suite *EditIntegrationTestSuite) TestEdit_UpdateCorrectPlatform() { suite.Require().NotNil(s, "test-script should not be empty") v, err := s.Value() suite.Require().NoError(err) - suite.Contains(v, "more info!", "Output of edit command:\n%s", cp.Snapshot()) + suite.Contains(v, "more info!", "Output of edit command:\n%s", cp.Output()) } func TestEditIntegrationTestSuite(t *testing.T) { diff --git a/test/integration/events_int_test.go b/test/integration/events_int_test.go index a690be9f0d..2c57e488df 100644 --- a/test/integration/events_int_test.go +++ b/test/integration/events_int_test.go @@ -59,7 +59,7 @@ events: cp.ExpectInput() cp.SendLine("exit") cp.ExpectExitCode(0) - output := cp.Snapshot() + output := cp.Output() if strings.Contains(output, "First activate event") { suite.T().Fatal("Output from second activate event should not contain first-activate output") } diff --git a/test/integration/exec_int_test.go b/test/integration/exec_int_test.go index edb53bc788..23c422ae4f 100644 --- a/test/integration/exec_int_test.go +++ b/test/integration/exec_int_test.go @@ -48,7 +48,7 @@ func (suite *ExecIntegrationTestSuite) TestExec_Environment() { e2e.OptArgs("exec", testScript), ) cp.ExpectExitCode(0) - output := cp.Snapshot() + output := cp.Output() suite.Contains(output, ts.Dirs.Bin, "PATH was not updated to contain cache directory, original PATH:", os.Getenv("PATH")) } diff --git a/test/integration/export_int_test.go b/test/integration/export_int_test.go index 2a6b15168f..cbccde418e 100644 --- a/test/integration/export_int_test.go +++ b/test/integration/export_int_test.go @@ -92,7 +92,7 @@ func (suite *ExportIntegrationTestSuite) TestExport_Env() { cp.Expect(`PATH: `) cp.ExpectExitCode(0) - suite.Assert().NotContains(cp.Snapshot(), "ACTIVESTATE_ACTIVATED") + suite.Assert().NotContains(cp.Output(), "ACTIVESTATE_ACTIVATED") } func (suite *ExportIntegrationTestSuite) TestJSON() { diff --git a/test/integration/history_int_test.go b/test/integration/history_int_test.go index bcc85d9aea..b701b42746 100644 --- a/test/integration/history_int_test.go +++ b/test/integration/history_int_test.go @@ -39,7 +39,7 @@ func (suite *HistoryIntegrationTestSuite) TestHistory_History() { cp.Expect("+ autopip 1.6.0") cp.Expect("- convertdate") cp.Expect(`+ Platform`) - suite.Assert().NotContains(cp.Snapshot(), "StructuredChanges") + suite.Assert().NotContains(cp.Output(), "StructuredChanges") cp.ExpectExitCode(0) } diff --git a/test/integration/install_scripts_int_test.go b/test/integration/install_scripts_int_test.go index 09c8e78ecd..504d7669cc 100644 --- a/test/integration/install_scripts_int_test.go +++ b/test/integration/install_scripts_int_test.go @@ -242,7 +242,7 @@ func (suite *InstallScriptsIntegrationTestSuite) assertCorrectVersion(ts *e2e.Se cp := ts.SpawnCmd(stateExec, "--version", "--output=json") cp.ExpectExitCode(0) actual := versionData{} - out := strings.Trim(cp.Snapshot(), "\x00") + out := strings.Trim(cp.Output(), "\x00") json.Unmarshal([]byte(out), &actual) if expectedVersion != "" { diff --git a/test/integration/languages_int_test.go b/test/integration/languages_int_test.go index 21f1bf17c9..801947c3c0 100644 --- a/test/integration/languages_int_test.go +++ b/test/integration/languages_int_test.go @@ -73,7 +73,7 @@ func (suite *LanguagesIntegrationTestSuite) TestLanguages_install() { cp.ExpectExitCode(0) // assert that version number changed - output := cp.Snapshot() + output := cp.Output() vs := versionRe.FindString(output) v, err := goversion.NewVersion(vs) suite.Require().NoError(err, "parsing version %s", vs) diff --git a/test/integration/msg_int_test.go b/test/integration/msg_int_test.go index dfafa3c3f5..dbb7d3ae94 100644 --- a/test/integration/msg_int_test.go +++ b/test/integration/msg_int_test.go @@ -89,7 +89,7 @@ func (suite *MsgIntegrationTestSuite) TestMessage_Basic() { } cp.ExpectExitCode(0) if !tt.ExpectRepeat { - suite.Require().NotContains(cp.Snapshot(), "This is a simple message", "Should not repeat as that's the default behavior") + suite.Require().NotContains(cp.Output(), "This is a simple message", "Should not repeat as that's the default behavior") } }) } @@ -136,7 +136,7 @@ func (suite *MsgIntegrationTestSuite) TestMessage_Basic_InterruptPrompt() { cp.Expect(`This is a simple message`) cp.Expect("Press ENTER to continue") time.Sleep(time.Millisecond * 100) - suite.Require().NotContains(cp.Snapshot(), "Usage:") + suite.Require().NotContains(cp.Output(), "Usage:") cp.SendLine("") cp.Expect("Usage:") cp.ExpectExitCode(0) @@ -146,7 +146,7 @@ func (suite *MsgIntegrationTestSuite) TestMessage_Basic_InterruptPrompt() { cp.Expect(`This is a simple message`) cp.Expect("Usage:") cp.ExpectExitCode(0) - suite.Require().NotContains(cp.Snapshot(), "Press ENTER to continue") + suite.Require().NotContains(cp.Output(), "Press ENTER to continue") } func (suite *MsgIntegrationTestSuite) TestMessage_Basic_InterruptExit() { @@ -166,7 +166,7 @@ func (suite *MsgIntegrationTestSuite) TestMessage_Basic_InterruptExit() { cp := ts.SpawnWithOpts(e2e.OptArgs("config"), e2e.OptAppendEnv(constants.MessagesOverrideEnvVarName+"="+msgFile)) cp.Expect(`This is a simple message`) cp.ExpectExitCode(1) - suite.Require().NotContains(cp.Snapshot(), "Usage:") + suite.Require().NotContains(cp.Output(), "Usage:") } func TestMsgIntegrationTestSuite(t *testing.T) { diff --git a/test/integration/package_int_test.go b/test/integration/package_int_test.go index 359816b4e7..7bf91d9865 100644 --- a/test/integration/package_int_test.go +++ b/test/integration/package_int_test.go @@ -566,7 +566,7 @@ func (suite *PackageIntegrationTestSuite) TestNormalize() { ) cp.Expect("charset-normalizer") cp.ExpectExitCode(0) - suite.NotContains(cp.Snapshot(), "is different") + suite.NotContains(cp.Output(), "is different") } func (suite *PackageIntegrationTestSuite) TestInstall_InvalidVersion() { diff --git a/test/integration/performance_int_test.go b/test/integration/performance_int_test.go index 912fbcca11..fac6438fe5 100644 --- a/test/integration/performance_int_test.go +++ b/test/integration/performance_int_test.go @@ -55,16 +55,16 @@ func performanceTest(commands []string, expect string, samples int, maxTime time cp.Expect(expect) } cp.ExpectExitCode(0) - v := rx.FindStringSubmatch(cp.Snapshot()) + v := rx.FindStringSubmatch(cp.Output()) if len(v) < 2 { - suite.T().Fatalf("Could not find '%s' in output: %s", rx.String(), cp.Snapshot()) + suite.T().Fatalf("Could not find '%s' in output: %s", rx.String(), cp.Output()) } durMS, err := strconv.Atoi(v[1]) suite.Require().NoError(err) dur := time.Millisecond * time.Duration(durMS) if firstEntry == "" { - firstEntry = cp.Snapshot() + firstEntry = cp.Output() firstLogs = ts.DebugLogs() } if x == 0 { diff --git a/test/integration/platforms_int_test.go b/test/integration/platforms_int_test.go index b4a1574be2..7d1dc6dd52 100644 --- a/test/integration/platforms_int_test.go +++ b/test/integration/platforms_int_test.go @@ -91,7 +91,7 @@ func (suite *PlatformsIntegrationTestSuite) TestPlatforms_addRemove() { cp = ts.Spawn("platforms") cp.ExpectExitCode(0) - output := cp.Snapshot() + output := cp.Output() if strings.Contains(output, "Windows") { suite.T().Fatal("Windows platform should not be present after removal") } @@ -127,7 +127,7 @@ func (suite *PlatformsIntegrationTestSuite) TestPlatforms_addRemoveLatest() { cp = ts.Spawn("platforms") cp.ExpectExitCode(0) - output := cp.Snapshot() + output := cp.Output() if strings.Contains(output, "Windows") { suite.T().Fatal("Windows platform should not be present after removal") } diff --git a/test/integration/progress_int_test.go b/test/integration/progress_int_test.go index 5e7b1612f7..7f772287bb 100644 --- a/test/integration/progress_int_test.go +++ b/test/integration/progress_int_test.go @@ -24,7 +24,7 @@ func (suite *ProgressIntegrationTestSuite) TestProgress() { ) cp.Expect(locale.T("setup_runtime")) cp.Expect("Checked out") - suite.Assert().NotContains(cp.Snapshot(), "...") + suite.Assert().NotContains(cp.Output(), "...") cp.ExpectExitCode(0) cp = ts.SpawnWithOpts( diff --git a/test/integration/projects_int_test.go b/test/integration/projects_int_test.go index be97ef356d..08e12e4a55 100644 --- a/test/integration/projects_int_test.go +++ b/test/integration/projects_int_test.go @@ -95,7 +95,7 @@ func (suite *ProjectsIntegrationTestSuite) TestEdit_Name() { // If the checkout failed, it's probably because the project name was changed // in a previous run of this test. Try again with the new name. - if strings.Contains(cp.Snapshot(), "Could not checkout project") { + if strings.Contains(cp.Output(), "Could not checkout project") { cp = ts.Spawn("checkout", fmt.Sprintf("ActiveState-CLI/%s", newName)) originalName = newName newName = originalName diff --git a/test/integration/refresh_int_test.go b/test/integration/refresh_int_test.go index fb1dc73e29..f4a75ffb78 100644 --- a/test/integration/refresh_int_test.go +++ b/test/integration/refresh_int_test.go @@ -51,7 +51,7 @@ func (suite *RefreshIntegrationTestSuite) TestRefresh() { cp.ExpectExitCode(0) cp = ts.Spawn("refresh") - suite.Assert().NotContains(cp.Snapshot(), "Setting Up Runtime", "Unchanged runtime should not refresh") + suite.Assert().NotContains(cp.Output(), "Setting Up Runtime", "Unchanged runtime should not refresh") cp.Expect("Runtime updated") cp.ExpectExitCode(0) } diff --git a/test/integration/revert_int_test.go b/test/integration/revert_int_test.go index 4873174b6f..3fee6c99c3 100644 --- a/test/integration/revert_int_test.go +++ b/test/integration/revert_int_test.go @@ -59,7 +59,7 @@ func (suite *RevertIntegrationTestSuite) TestRevert() { cp.SendLine("import urllib3") cp.Expect("No module named 'urllib3'") cp.SendLine("import argparse") - suite.Assert().NotContains(cp.Snapshot(), "No module named 'argparse'") + suite.Assert().NotContains(cp.Output(), "No module named 'argparse'") cp.SendLine("exit()") // exit python3 cp.SendLine("exit") // exit state shell cp.ExpectExitCode(0) diff --git a/test/integration/run_int_test.go b/test/integration/run_int_test.go index 4f85432251..f0e5a47706 100644 --- a/test/integration/run_int_test.go +++ b/test/integration/run_int_test.go @@ -125,7 +125,7 @@ func (suite *RunIntegrationTestSuite) TestInActivatedEnv() { cp.SendLine("exit 0") cp.ExpectExitCode(0) suite.Require().NotContains( - cp.Snapshot(), "not printed after second interrupt", + cp.Output(), "not printed after second interrupt", ) } @@ -196,7 +196,7 @@ func (suite *RunIntegrationTestSuite) TestTwoInterrupts() { suite.expectTerminateBatchJob(cp) cp.ExpectExitCode(123) suite.Require().NotContains( - cp.Snapshot(), "not printed after second interrupt", + cp.Output(), "not printed after second interrupt", ) } diff --git a/test/integration/secrets_int_test.go b/test/integration/secrets_int_test.go index 6674c0d1ba..18a7d2c4f1 100644 --- a/test/integration/secrets_int_test.go +++ b/test/integration/secrets_int_test.go @@ -42,7 +42,7 @@ func (suite *SecretsIntegrationTestSuite) TestSecrets_JSON() { cp = ts.Spawn("secrets", "get", "project.test-secret", "--output", "json") cp.ExpectExitCode(0) - suite.Equal(string(expected), cp.Snapshot()) + suite.Equal(string(expected), cp.Output()) cp = ts.Spawn("secrets", "sync") cp.Expect("Operating on project cli-integration-tests/Python3") diff --git a/test/integration/shell_int_test.go b/test/integration/shell_int_test.go index a6fbff19dc..44199904ef 100644 --- a/test/integration/shell_int_test.go +++ b/test/integration/shell_int_test.go @@ -317,7 +317,7 @@ func (suite *ShellIntegrationTestSuite) TestNestedShellNotification() { e2e.OptArgs("shell", "small-python"), e2e.OptAppendEnv(env...)) cp.Expect("Activated") - suite.Assert().NotContains(cp.Snapshot(), "State Tool is operating on project") + 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.) diff --git a/test/integration/update_int_test.go b/test/integration/update_int_test.go index 59b209ac3f..beb8e5cd46 100644 --- a/test/integration/update_int_test.go +++ b/test/integration/update_int_test.go @@ -73,7 +73,7 @@ func (suite *UpdateIntegrationTestSuite) versionCompare(ts *e2e.Session, expecte cp.ExpectExitCode(0) version := versionData{} - out := strings.Trim(cp.Snapshot(), "\x00") + out := strings.Trim(cp.Output(), "\x00") json.Unmarshal([]byte(out), &version) matcher(expected, version.Version, fmt.Sprintf("Version could not be matched, output:\n\n%s", out)) @@ -88,7 +88,7 @@ func (suite *UpdateIntegrationTestSuite) branchCompare(ts *e2e.Session, expected cp.ExpectExitCode(0, termtest.OptExpectTimeout(30*time.Second)) branch := branchData{} - out := strings.Trim(cp.Snapshot(), "\x00") + out := strings.Trim(cp.Output(), "\x00") json.Unmarshal([]byte(out), &branch) matcher(expected, branch.Branch, fmt.Sprintf("Branch could not be matched, output:\n\n%s", out)) diff --git a/test/integration/version_int_test.go b/test/integration/version_int_test.go index e22a1f38e4..002d82608b 100644 --- a/test/integration/version_int_test.go +++ b/test/integration/version_int_test.go @@ -21,7 +21,7 @@ func (suite *VersionIntegrationTestSuite) TestNotDev() { defer ts.Close() cp := ts.Spawn("--version") - suite.NotContains(cp.Snapshot(), "(dev)") + suite.NotContains(cp.Output(), "(dev)") cp.ExpectExitCode(0) } diff --git a/test/integration/vscode_int_test.go b/test/integration/vscode_int_test.go index 79005054f8..7d219ac02e 100644 --- a/test/integration/vscode_int_test.go +++ b/test/integration/vscode_int_test.go @@ -29,16 +29,16 @@ func (suite *PushIntegrationTestSuite) TestInitAndPush_VSCode() { filepath.Join(ts.Dirs.Work, namespace), ) cp.ExpectExitCode(0) - suite.Contains(cp.Snapshot(), "Skipping runtime setup because it was disabled by an environment variable") - suite.Contains(cp.Snapshot(), "{") - suite.Contains(cp.Snapshot(), "}") + suite.Contains(cp.Output(), "Skipping runtime setup because it was disabled by an environment variable") + suite.Contains(cp.Output(), "{") + suite.Contains(cp.Output(), "}") wd := filepath.Join(cp.WorkDirectory(), namespace) cp = ts.SpawnWithOpts( e2e.OptArgs("push", "--output", "editor"), e2e.OptWD(wd), ) cp.ExpectExitCode(0) - suite.Equal("", cp.Snapshot()) + suite.Equal("", cp.Output()) // check that pushed project exists cp = ts.Spawn("show", namespace) @@ -73,8 +73,8 @@ func (suite *ShowIntegrationTestSuite) TestShow_VSCode() { } var out ShowOutput - err := json.Unmarshal([]byte(cp.Snapshot()), &out) - suite.Require().NoError(err, "Failed to parse JSON from: %s", cp.Snapshot()) + err := json.Unmarshal([]byte(cp.Output()), &out) + suite.Require().NoError(err, "Failed to parse JSON from: %s", cp.Output()) suite.Equal("Show", out.Name) suite.Equal(e2e.PersistentUsername, out.Organization) suite.Equal("Public", out.Visibility) @@ -111,7 +111,7 @@ func (suite *PushIntegrationTestSuite) TestOrganizations_VSCode() { expected, err := json.Marshal(org) suite.Require().NoError(err) - suite.Contains(cp.Snapshot(), string(expected)) + suite.Contains(cp.Output(), string(expected)) } func (suite *AuthIntegrationTestSuite) TestAuth_VSCode() { @@ -136,11 +136,11 @@ func (suite *AuthIntegrationTestSuite) TestAuth_VSCode() { ) cp.Expect(`"privateProjects":false}`) cp.ExpectExitCode(0) - suite.Equal(string(expected), cp.Snapshot()) + suite.Equal(string(expected), cp.Output()) cp = ts.Spawn("export", "jwt", "--output", "editor") cp.ExpectExitCode(0) - suite.Assert().Greater(len(cp.Snapshot()), 3, "expected jwt token to be non-empty") + suite.Assert().Greater(len(cp.Output()), 3, "expected jwt token to be non-empty") } func (suite *PackageIntegrationTestSuite) TestPackages_VSCode() { @@ -165,8 +165,8 @@ func (suite *PackageIntegrationTestSuite) TestPackages_VSCode() { } var po []PackageOutput - err := json.Unmarshal([]byte(cp.Snapshot()), &po) - suite.Require().NoError(err, "Could not parse JSON from: %s", cp.Snapshot()) + err := json.Unmarshal([]byte(cp.Output()), &po) + suite.Require().NoError(err, "Could not parse JSON from: %s", cp.Output()) suite.Len(po, 2) }