Skip to content

Commit 74a047e

Browse files
committed
Fix e2e test
1 parent dea6d70 commit 74a047e

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

test/e2e/metriconly/metrics_test.go

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,15 @@ var _ = ginkgo.Describe("NPD should export Prometheus metrics.", func() {
3737
var instance gce.Instance
3838

3939
ginkgo.BeforeEach(func() {
40-
var err error
41-
// TODO(xueweiz): Creating instance for each test case is slow. We should either reuse the instance
42-
// between tests, or have a way to run these tests in parallel.
43-
if *imageFamily != "" && *image == "" {
44-
gceImage, err := computeService.Images.GetFromFamily(*imageProject, *imageFamily).Do()
45-
if err != nil {
46-
ginkgo.Fail(fmt.Sprintf("Unable to get image from family %s at project %s: %v",
47-
*imageFamily, *imageProject, err))
48-
}
49-
*image = gceImage.Name
50-
fmt.Printf("Using image %s from image family %s at project %s\n", *image, *imageFamily, *imageProject)
40+
imageProject := "ubuntu-os-gke-cloud"
41+
imageFamily := "ubuntu"
42+
gceImage, err := computeService.Images.GetFromFamily(imageProject, imageFamily).Do()
43+
if err != nil {
44+
ginkgo.Fail(fmt.Sprintf("Unable to get image from family %s at project %s: %v",
45+
imageFamily, imageProject, err))
5146
}
47+
*image = gceImage.Name
48+
fmt.Printf("Using image %s from image family %s at project %s\n", *image, imageFamily, imageProject)
5249
instance, err = gce.CreateInstance(
5350
gce.Instance{
5451
Name: "npd-metrics-" + *image + "-" + uuid.NewUUID().String()[:8],
@@ -59,7 +56,7 @@ var _ = ginkgo.Describe("NPD should export Prometheus metrics.", func() {
5956
ComputeService: computeService,
6057
},
6158
*image,
62-
*imageProject)
59+
imageProject)
6360
Expect(err).NotTo(HaveOccurred(), fmt.Sprintf("Unable to create test instance: %v", err))
6461

6562
err = npd.SetupNPD(instance, *npdBuildTar)

0 commit comments

Comments
 (0)