コード例 #1
0
ファイル: app_examiner_test.go プロジェクト: rowhit/lattice
						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",
					},
				))
コード例 #2
0
ファイル: app_examiner_test.go プロジェクト: Klaudit/lattice
						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",
					},
				))