Beispiel #1
0
	Context("when logged in", func() {
		var (
			app models.Application
		)

		BeforeEach(func() {
			requirementsFactory.LoginSuccess = true
			requirementsFactory.TargetedSpaceSuccess = true

			app = models.Application{}
			app.Name = "my-app"
			app.Guid = "my-app-guid"

			currentTime := time.Now()
			recentLogs := []*logmessage.LogMessage{
				testlogs.NewOldLogMessage("Log Line 1", app.Guid, "DEA", currentTime),
				testlogs.NewOldLogMessage("Log Line 2", app.Guid, "DEA", currentTime),
			}

			appLogs := []*logmessage.LogMessage{
				testlogs.NewOldLogMessage("Log Line 1", app.Guid, "DEA", time.Now()),
			}
			// recentLogs := []*events.LogMessage{
			// 	testlogs.NewNoaaLogMessage("Log Line 1", app.Guid, "DEA", currentTime),
			// 	testlogs.NewNoaaLogMessage("Log Line 2", app.Guid, "DEA", currentTime),
			// }

			// appLogs := []*events.LogMessage{
			// 	testlogs.NewNoaaLogMessage("Log Line 1", app.Guid, "DEA", time.Now()),
			// }
Beispiel #2
0
			))
		})

		It("only displays staging logs when an app is starting", func() {
			requirementsFactory.Application = defaultAppForStart
			appRepo = &testApplication.FakeApplicationRepository{
				UpdateAppResult: defaultAppForStart,
			}
			appRepo.ReadReturns.App = defaultAppForStart

			currentTime := time.Now()
			wrongSourceName := "DEA"
			correctSourceName := "STG"

			oldLogsForTail = []*logmessage.LogMessage{
				testlogs.NewOldLogMessage("Log Line 1", defaultAppForStart.Guid, wrongSourceName, currentTime),
				testlogs.NewOldLogMessage("Log Line 2", defaultAppForStart.Guid, correctSourceName, currentTime),
				testlogs.NewOldLogMessage("Log Line 3", defaultAppForStart.Guid, correctSourceName, currentTime),
				testlogs.NewOldLogMessage("Log Line 4", defaultAppForStart.Guid, wrongSourceName, currentTime),
			}

			logsForTail = []*events.LogMessage{
				testlogs.NewNoaaLogMessage("Log Line 1", defaultAppForStart.Guid, wrongSourceName, currentTime),
				testlogs.NewNoaaLogMessage("Log Line 2", defaultAppForStart.Guid, correctSourceName, currentTime),
				testlogs.NewNoaaLogMessage("Log Line 3", defaultAppForStart.Guid, correctSourceName, currentTime),
				testlogs.NewNoaaLogMessage("Log Line 4", defaultAppForStart.Guid, wrongSourceName, currentTime),
			}

			callStart([]string{"my-app"})

			Expect(ui.Outputs).To(ContainSubstrings(