Exemplo n.º 1
0
						State:       "CRASHED",
						CrashCount:  7,
					},
				}

				containerMetrics = []*events.ContainerMetric{
					buildContainerMetric("peekaboo-app", 0, 0.018138574, 798729, 32768),
				}
			})

			It("returns a fully populated AppInfo with instances sorted by index", func() {
				fakeReceptorClient.GetDesiredLRPReturns(getDesiredLRPResponse, nil)
				fakeReceptorClient.ActualLRPsByProcessGuidReturns(actualLRPsByProcessGuidResponse, nil)
				fakeNoaaConsumer.GetContainerMetricsReturns(containerMetrics, nil)

				appInfo, err := appExaminer.AppStatus("peekaboo-app")
				Expect(err).NotTo(HaveOccurred())

				Expect(appInfo.ProcessGuid).To(Equal("peekaboo-app"))
				Expect(appInfo.DesiredInstances).To(Equal(4))
				Expect(appInfo.ActualRunningInstances).To(Equal(1))
				Expect(appInfo.EnvironmentVariables).To(ConsistOf(
					app_examiner.EnvironmentVariable{
						Name:  "API_TOKEN",
						Value: "98weufsa",
					},
					app_examiner.EnvironmentVariable{
						Name:  "PEEKABOO_APP_NICKNAME",
						Value: "Bugs McGee",
					},
				))
Exemplo n.º 2
0
						State:       "CRASHED",
						CrashCount:  7,
					},
				}

				containerMetrics = []*events.ContainerMetric{
					buildContainerMetric("peekaboo-app", 0, 0.018138574, 798729, 32768),
				}
			})

			It("returns a fully populated AppInfo with instances sorted by index", func() {
				fakeReceptorClient.GetDesiredLRPReturns(getDesiredLRPResponse, nil)
				fakeReceptorClient.ActualLRPsByProcessGuidReturns(actualLRPsByProcessGuidResponse, nil)
				fakeNoaaConsumer.GetContainerMetricsReturns(containerMetrics, nil)

				appInfo, err := appExaminer.AppStatus("peekaboo-app")
				Expect(err).NotTo(HaveOccurred())

				Expect(appInfo.ProcessGuid).To(Equal("peekaboo-app"))
				Expect(appInfo.DesiredInstances).To(Equal(4))
				Expect(appInfo.ActualRunningInstances).To(Equal(1))
				Expect(appInfo.EnvironmentVariables).To(ConsistOf(
					app_examiner.EnvironmentVariable{
						Name:  "API_TOKEN",
						Value: "98weufsa",
					},
					app_examiner.EnvironmentVariable{
						Name:  "PEEKABOO_APP_NICKNAME",
						Value: "Bugs McGee",
					},
				))