diff --git a/bosh/deployed_instance_test.go b/bosh/deployed_instance_test.go index 495332173..0bc2d4e1c 100644 --- a/bosh/deployed_instance_test.go +++ b/bosh/deployed_instance_test.go @@ -469,7 +469,7 @@ var _ = Describe("Instance", func() { Context("when there are several scripts and one of them fails to run backup while another one causes an error", func() { expectedStdout := "some stdout" expectedStderr := "some stderr" - expectedError := fmt.Errorf("you are fake news") + expectedError := fmt.Errorf("I have a problem with your code") BeforeEach(func() { backupAndRestoreScripts = []instance.Script{ @@ -602,7 +602,7 @@ var _ = Describe("Instance", func() { Context("when there are several scripts and one of them fails to run post-backup-unlock while another one causes an error", func() { expectedStdout := "some stdout" expectedStderr := "some stderr" - expectedError := fmt.Errorf("you are fake news") + expectedError := fmt.Errorf("I still have a problem with your code") BeforeEach(func() { backupAndRestoreScripts = []instance.Script{ @@ -762,7 +762,7 @@ var _ = Describe("Instance", func() { Context("when there are several scripts and one of them fails to run restore while another one causes an error", func() { expectedStdout := "some stdout" expectedStderr := "some stderr" - expectedError := fmt.Errorf("i saw a million and a half people") + expectedError := fmt.Errorf("foo bar baz error") BeforeEach(func() { backupAndRestoreScripts = []instance.Script{ diff --git a/instance/blob_test.go b/instance/blob_test.go index 829019dc0..e6661f459 100644 --- a/instance/blob_test.go +++ b/instance/blob_test.go @@ -87,7 +87,7 @@ var _ = Describe("blob", func() { var sshError error BeforeEach(func() { - sshError = fmt.Errorf("I have the best SSH") + sshError = fmt.Errorf("SHH causing problems here") sshConnection.StreamReturns([]byte("not relevant"), 0, sshError) }) @@ -268,7 +268,7 @@ var _ = Describe("blob", func() { Context("when an error occurs", func() { var err error - var actualError = errors.New("we will load it up with some bad dudes") + var actualError = errors.New("oh noes, more errors") BeforeEach(func() { sshConnection.RunReturns(nil, nil, 0, actualError) @@ -315,23 +315,23 @@ var _ = Describe("blob", func() { Describe("when the remote side returns an error", func() { BeforeEach(func() { - sshConnection.StreamStdinReturns([]byte("not relevant"), []byte("The beauty of me is that I’m very rich."), 1, nil) + sshConnection.StreamStdinReturns([]byte("not relevant"), []byte("All the pies"), 1, nil) }) It("fails and return the error", func() { Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(ContainSubstring("The beauty of me is that I’m very rich.")) + Expect(err.Error()).To(ContainSubstring("All the pies")) }) }) Describe("when there is an error running the stream", func() { BeforeEach(func() { - sshConnection.StreamStdinReturns([]byte("not relevant"), []byte("not relevant"), 0, fmt.Errorf("My Twitter has become so powerful")) + sshConnection.StreamStdinReturns([]byte("not relevant"), []byte("not relevant"), 0, fmt.Errorf("Errorerrororororororor")) }) It("fails", func() { Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(ContainSubstring("My Twitter has become so powerful")) + Expect(err.Error()).To(ContainSubstring("Errorerrororororororor")) }) }) @@ -348,12 +348,12 @@ var _ = Describe("blob", func() { Describe("when creating the directory fails because of a connection error", func() { BeforeEach(func() { - sshConnection.RunReturns([]byte("not relevant"), []byte("not relevant"), 0, fmt.Errorf("These media people. The most dishonest people")) + sshConnection.RunReturns([]byte("not relevant"), []byte("not relevant"), 0, fmt.Errorf("I refuse to create you this directory.")) }) It("fails and returns the error", func() { Expect(err).To(HaveOccurred()) - Expect(err).To(MatchError("These media people. The most dishonest people")) + Expect(err).To(MatchError("I refuse to create you this directory.")) }) }) }) diff --git a/instance/job_finder_test.go b/instance/job_finder_test.go index 7ebc83ba1..3c2dde196 100644 --- a/instance/job_finder_test.go +++ b/instance/job_finder_test.go @@ -209,7 +209,7 @@ backup_name: consul_backup`), nil, 0, nil BeforeEach(func() { sshConnection.RunStub = func(cmd string) ([]byte, []byte, int, error) { if cmd == "/var/vcap/jobs/consul_agent/bin/b-metadata" { - return []byte(`they are being really unfair to me`), nil, 0, nil + return []byte(`this is very disappointing`), nil, 0, nil } return []byte("/var/vcap/jobs/consul_agent/bin/b-metadata"), nil, 0, nil } diff --git a/orchestrator/backuper_test.go b/orchestrator/backuper_test.go index 93baf4873..91725d8b6 100644 --- a/orchestrator/backuper_test.go +++ b/orchestrator/backuper_test.go @@ -104,9 +104,9 @@ var _ = Describe("Backup", func() { }) Describe("failures", func() { - var expectedError = fmt.Errorf("Jesus!") + var expectedError = fmt.Errorf("Profanity") var assertCleanupError = func() { - var cleanupError = fmt.Errorf("he was born in kenya") + var cleanupError = fmt.Errorf("gosh, it's a bit filthy in here") BeforeEach(func() { deployment.CleanupReturns(cleanupError) }) @@ -141,7 +141,7 @@ var _ = Describe("Backup", func() { }) Context("fails if manifest can't be downloaded", func() { - var expectedError = fmt.Errorf("he the founder of isis") + var expectedError = fmt.Errorf("source of the nile") BeforeEach(func() { deploymentManager.FindReturns(deployment, nil) deployment.IsBackupableReturns(true) @@ -156,7 +156,7 @@ var _ = Describe("Backup", func() { }) Context("fails if manifest can't be saved", func() { - var expectedError = fmt.Errorf("he the founder of isis") + var expectedError = fmt.Errorf("source of the nile") BeforeEach(func() { deploymentManager.FindReturns(deployment, nil) @@ -207,7 +207,7 @@ var _ = Describe("Backup", func() { }) Context("fails if pre-backup-lock fails", func() { - var lockError = orchestrator.NewLockError("it was going to be a smooth transition - NOT") + var lockError = orchestrator.NewLockError("smoooooooth jazz") BeforeEach(func() { boshClient.GetManifestReturns(deploymentManifest, nil) @@ -236,7 +236,7 @@ var _ = Describe("Backup", func() { var unlockError orchestrator.PostBackupUnlockError BeforeEach(func() { - unlockError = orchestrator.NewPostBackupUnlockError("it was going to be a smooth transition - NOT") + unlockError = orchestrator.NewPostBackupUnlockError("lalalalala") boshClient.GetManifestReturns(deploymentManifest, nil) artifactManager.CreateReturns(artifact, nil) artifactManager.ExistsReturns(false) @@ -260,7 +260,7 @@ var _ = Describe("Backup", func() { }) Context("when the drain artifact fails as well", func() { - var drainError = fmt.Errorf("i don't do email but i know about hacking") + var drainError = fmt.Errorf("just weird") BeforeEach(func() { deployment.CopyRemoteBackupToLocalReturns(drainError) @@ -272,7 +272,7 @@ var _ = Describe("Backup", func() { }) Context("cleanup fails as well", func() { - var cleanupError = orchestrator.NewCleanupError("he was born in kenya") + var cleanupError = orchestrator.NewCleanupError("here we go again") BeforeEach(func() { deployment.CleanupReturns(cleanupError) }) @@ -293,7 +293,7 @@ var _ = Describe("Backup", func() { }) Context("cleanup fails as well", func() { - var cleanupError = fmt.Errorf("he was born in kenya") + var cleanupError = fmt.Errorf("leave me alone") BeforeEach(func() { deployment.CleanupReturns(cleanupError) }) @@ -309,7 +309,7 @@ var _ = Describe("Backup", func() { }) Context("fails if backup cannot be drained", func() { - var drainError = fmt.Errorf("they are bringing crime") + var drainError = fmt.Errorf("I would like a sandwich") BeforeEach(func() { deploymentManager.FindReturns(deployment, nil) deployment.IsBackupableReturns(true) @@ -339,7 +339,7 @@ var _ = Describe("Backup", func() { }) Context("fails if artifact cannot be created", func() { - var artifactError = fmt.Errorf("they are bringing crime") + var artifactError = fmt.Errorf("I would like a sandwich") BeforeEach(func() { deploymentManager.FindReturns(deployment, nil) deployment.IsBackupableReturns(true) @@ -368,7 +368,7 @@ var _ = Describe("Backup", func() { }) Context("fails if the cleanup cannot be completed", func() { - var cleanupError = fmt.Errorf("why doesn't he show his birth certificate?") + var cleanupError = fmt.Errorf("a tuna sandwich") BeforeEach(func() { deploymentManager.FindReturns(deployment, nil) deployment.IsBackupableReturns(true) @@ -402,7 +402,7 @@ var _ = Describe("Backup", func() { }) Context("fails if backup is not a success", func() { - var backupError = fmt.Errorf("i have the best words") + var backupError = fmt.Errorf("syzygy") BeforeEach(func() { deploymentManager.FindReturns(deployment, nil) deployment.IsBackupableReturns(true) diff --git a/orchestrator/deployment_manager_test.go b/orchestrator/deployment_manager_test.go index 75fd5d47d..fb81a77b6 100644 --- a/orchestrator/deployment_manager_test.go +++ b/orchestrator/deployment_manager_test.go @@ -44,7 +44,7 @@ var _ = Describe("DeploymentManager", func() { }) Context("error finding instances", func() { - var expectedFindError = fmt.Errorf("some I assume are good people") + var expectedFindError = fmt.Errorf("a tuna sandwich") BeforeEach(func() { boshClient.FindInstancesReturns(nil, expectedFindError) }) diff --git a/orchestrator/deployment_test.go b/orchestrator/deployment_test.go index 3431e084e..bb8577734 100644 --- a/orchestrator/deployment_test.go +++ b/orchestrator/deployment_test.go @@ -144,7 +144,7 @@ var _ = Describe("Deployment", func() { Context("Multiple instances, some failing to backup", func() { BeforeEach(func() { - backupError := fmt.Errorf("My IQ is one of the highest — and you all know it!") + backupError := fmt.Errorf("very clever sandwich") instance1.IsBackupableReturns(true) instance2.IsBackupableReturns(true) instance1.BackupReturns(backupError) @@ -511,7 +511,7 @@ var _ = Describe("Deployment", func() { }) Context("Multiple instances, some failing to restore", func() { - var restoreError = fmt.Errorf("I have a plan, but I dont want to tell ISIS what it is") + var restoreError = fmt.Errorf("and some salt and vinegar crisps") BeforeEach(func() { instance1.IsRestorableReturns(true) @@ -590,16 +590,16 @@ var _ = Describe("Deployment", func() { Context("problem occurs streaming to instance", func() { BeforeEach(func() { - backupBlob.StreamToRemoteReturns(fmt.Errorf("Tiny children are not horses")) + backupBlob.StreamToRemoteReturns(fmt.Errorf("streaming had a problem")) }) It("fails", func() { Expect(copyLocalBackupToRemoteError).To(HaveOccurred()) - Expect(copyLocalBackupToRemoteError).To(MatchError("Tiny children are not horses")) + Expect(copyLocalBackupToRemoteError).To(MatchError("streaming had a problem")) }) }) Context("problem calculating shasum on local", func() { - var checksumError = fmt.Errorf("because i am smart") + var checksumError = fmt.Errorf("I am so clever") BeforeEach(func() { artifact.FetchChecksumReturns(nil, checksumError) }) @@ -633,12 +633,12 @@ var _ = Describe("Deployment", func() { Context("problem occurs while reading from backup", func() { BeforeEach(func() { - artifact.ReadFileReturns(nil, fmt.Errorf("an overrated clown")) + artifact.ReadFileReturns(nil, fmt.Errorf("leave me alone")) }) It("fails", func() { Expect(copyLocalBackupToRemoteError).To(HaveOccurred()) - Expect(copyLocalBackupToRemoteError).To(MatchError("an overrated clown")) + Expect(copyLocalBackupToRemoteError).To(MatchError("leave me alone")) }) }) }) @@ -679,16 +679,16 @@ var _ = Describe("Deployment", func() { Context("problem occurs streaming to instance", func() { BeforeEach(func() { - backupBlob.StreamToRemoteReturns(fmt.Errorf("Tiny children are not horses")) + backupBlob.StreamToRemoteReturns(fmt.Errorf("I'm still here")) }) It("fails", func() { Expect(copyLocalBackupToRemoteError).To(HaveOccurred()) - Expect(copyLocalBackupToRemoteError).To(MatchError("Tiny children are not horses")) + Expect(copyLocalBackupToRemoteError).To(MatchError("I'm still here")) }) }) Context("problem calculating shasum on local", func() { - var checksumError = fmt.Errorf("because i am smart") + var checksumError = fmt.Errorf("oh well") BeforeEach(func() { artifact.FetchChecksumReturns(nil, checksumError) }) @@ -722,12 +722,12 @@ var _ = Describe("Deployment", func() { Context("problem occurs while reading from backup", func() { BeforeEach(func() { - artifact.ReadFileReturns(nil, fmt.Errorf("an overrated clown")) + artifact.ReadFileReturns(nil, fmt.Errorf("foo bar baz read error")) }) It("fails", func() { Expect(copyLocalBackupToRemoteError).To(HaveOccurred()) - Expect(copyLocalBackupToRemoteError).To(MatchError("an overrated clown")) + Expect(copyLocalBackupToRemoteError).To(MatchError("foo bar baz read error")) }) }) }) @@ -767,16 +767,16 @@ var _ = Describe("Deployment", func() { Context("problem occurs streaming to instance", func() { BeforeEach(func() { - backupBlob.StreamToRemoteReturns(fmt.Errorf("Tiny children are not horses")) + backupBlob.StreamToRemoteReturns(fmt.Errorf("this is a problem")) }) It("fails", func() { Expect(copyLocalBackupToRemoteError).To(HaveOccurred()) - Expect(copyLocalBackupToRemoteError).To(MatchError("Tiny children are not horses")) + Expect(copyLocalBackupToRemoteError).To(MatchError("this is a problem")) }) }) Context("problem calculating shasum on local", func() { - var checksumError = fmt.Errorf("because i am smart") + var checksumError = fmt.Errorf("checksum error occurred") BeforeEach(func() { artifact.FetchChecksumReturns(nil, checksumError) }) @@ -810,12 +810,12 @@ var _ = Describe("Deployment", func() { Context("problem occurs while reading from backup", func() { BeforeEach(func() { - artifact.ReadFileReturns(nil, fmt.Errorf("an overrated clown")) + artifact.ReadFileReturns(nil, fmt.Errorf("a huge problem")) }) It("fails", func() { Expect(copyLocalBackupToRemoteError).To(HaveOccurred()) - Expect(copyLocalBackupToRemoteError).To(MatchError("an overrated clown")) + Expect(copyLocalBackupToRemoteError).To(MatchError("a huge problem")) }) }) }) @@ -1183,7 +1183,7 @@ var _ = Describe("Deployment", func() { Describe("failures", func() { Context("fails if backup cannot be drained", func() { - var drainError = fmt.Errorf("they are bringing crime") + var drainError = fmt.Errorf("please make it stop") BeforeEach(func() { backupBlob = new(fakes.FakeBackupBlob) @@ -1201,7 +1201,7 @@ var _ = Describe("Deployment", func() { }) Context("fails if file cannot be created", func() { - var fileError = fmt.Errorf("i have a very good brain") + var fileError = fmt.Errorf("not a good file") BeforeEach(func() { instances = []orchestrator.Instance{instance1} instance1.BlobsToBackupReturns([]orchestrator.BackupBlob{backupBlob}) @@ -1235,7 +1235,7 @@ var _ = Describe("Deployment", func() { }) Context("fails if the remote shasum cant be calulated", func() { - remoteShasumError := fmt.Errorf("i have created so many jobs") + remoteShasumError := fmt.Errorf("this shasum is not happy") var writeCloser1 *fakes.FakeWriteCloser BeforeEach(func() { diff --git a/orchestrator/error_test.go b/orchestrator/error_test.go index fdc0a65e7..36a47a577 100644 --- a/orchestrator/error_test.go +++ b/orchestrator/error_test.go @@ -19,7 +19,7 @@ type ErrorCase struct { } var _ = Describe("Error", func() { - var genericError = errors.New("You are fake news") + var genericError = errors.New("Just a little error") var lockError = orchestrator.NewLockError("LOCK_ERROR") var backupError = orchestrator.NewBackupError("BACKUP_ERROR") @@ -108,7 +108,7 @@ var _ = Describe("Error", func() { Context("errors", func() { errorCases := []ErrorCase{ - {"genericError", []error{genericError}, 1, "You are fake news"}, + {"genericError", []error{genericError}, 1, "borked"}, {"backupError", []error{backupError}, 1, "BACKUP_ERROR"}, {"lockError", []error{lockError}, 4, "LOCK_ERROR"}, {"unlockError", []error{postBackupUnlockError}, 8, "POST_BACKUP_ERROR"}, @@ -159,7 +159,7 @@ var _ = Describe("Error", func() { It("returns exit code 17 (16 | 1)", func() { exitCode, errorMessage := orchestrator.ProcessBackupError([]error{cleanupError, genericError}) Expect(exitCode).To(Equal(17)) - Expect(errorMessage).To(ContainSubstring("You are fake news")) + Expect(errorMessage).To(ContainSubstring("Just a little error")) Expect(errorMessage).To(ContainSubstring("CLEANUP_ERROR")) }) }) diff --git a/orchestrator/restorer_test.go b/orchestrator/restorer_test.go index dd2cc549b..026f0d404 100644 --- a/orchestrator/restorer_test.go +++ b/orchestrator/restorer_test.go @@ -92,7 +92,7 @@ var _ = Describe("restorer", func() { Describe("failures", func() { var assertCleanupError = func() { - var cleanupError = fmt.Errorf("he was born in kenya") + var cleanupError = fmt.Errorf("too dirty") BeforeEach(func() { deployment.CleanupReturns(cleanupError) }) @@ -104,16 +104,16 @@ var _ = Describe("restorer", func() { Context("fails to find deployment", func() { BeforeEach(func() { - deploymentManager.FindReturns(nil, fmt.Errorf("they will pay for the wall")) + deploymentManager.FindReturns(nil, fmt.Errorf("no deployment here")) }) It("returns an error", func() { - Expect(restoreError).To(MatchError("they will pay for the wall")) + Expect(restoreError).To(MatchError("no deployment here")) }) }) Context("fails if the artifact cant be opened", func() { - var artifactOpenError = fmt.Errorf("i have the best brain") + var artifactOpenError = fmt.Errorf("I can't open this") BeforeEach(func() { deploymentManager.FindReturns(deployment, nil) artifactManager.OpenReturns(nil, artifactOpenError) @@ -134,7 +134,7 @@ var _ = Describe("restorer", func() { }) Context("fails, if the cleanup fails", func() { - var cleanupError = fmt.Errorf("we gotta deal with china") + var cleanupError = fmt.Errorf("still too dirty") BeforeEach(func() { deploymentManager.FindReturns(deployment, nil) artifactManager.OpenReturns(artifact, nil) @@ -151,7 +151,7 @@ var _ = Describe("restorer", func() { }) }) Context("fails if can't check if artifact is valid", func() { - var artifactValidError = fmt.Errorf("we will win so much") + var artifactValidError = fmt.Errorf("I don't like this artifact") BeforeEach(func() { deploymentManager.FindReturns(deployment, nil) @@ -195,7 +195,7 @@ var _ = Describe("restorer", func() { Context("if checking the deployment topology fails", func() { BeforeEach(func() { - artifact.DeploymentMatchesReturns(true, fmt.Errorf("my fingers are long and beautiful")) + artifact.DeploymentMatchesReturns(true, fmt.Errorf("I am not the same")) }) It("returns an error", func() { @@ -224,7 +224,7 @@ var _ = Describe("restorer", func() { }) Context("if running the restore script fails", func() { - var restoreError = fmt.Errorf("there is something in that birth certificate") + var restoreError = fmt.Errorf("I will not restore this thing") BeforeEach(func() { deployment.RestoreReturns(restoreError) }) diff --git a/ssh/connection_test.go b/ssh/connection_test.go index e3bb4f809..680afc55e 100644 --- a/ssh/connection_test.go +++ b/ssh/connection_test.go @@ -240,7 +240,7 @@ var _ = Describe("Connection", func() { }) BeforeEach(func() { - reader = bytes.NewBufferString("they will pay for the wall") + reader = bytes.NewBufferString("I am from the reader") command = "cat > /tmp/foo; echo 'here is something on stdout'; echo 'here is something on stderr' >&2" }) @@ -254,7 +254,7 @@ var _ = Describe("Connection", func() { It("reads stdout from the reader", func() { stdout, _, _, _ := conn.Run("cat /tmp/foo") - Expect(string(stdout)).To(Equal("they will pay for the wall")) + Expect(string(stdout)).To(Equal("I am from the reader")) }) It("drains stdout", func() {