@@ -37,18 +37,15 @@ var _ = ginkgo.Describe("NPD should export Prometheus metrics.", func() {
37
37
var instance gce.Instance
38
38
39
39
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 ))
51
46
}
47
+ * image = gceImage .Name
48
+ fmt .Printf ("Using image %s from image family %s at project %s\n " , * image , imageFamily , imageProject )
52
49
instance , err = gce .CreateInstance (
53
50
gce.Instance {
54
51
Name : "npd-metrics-" + * image + "-" + uuid .NewUUID ().String ()[:8 ],
@@ -59,7 +56,7 @@ var _ = ginkgo.Describe("NPD should export Prometheus metrics.", func() {
59
56
ComputeService : computeService ,
60
57
},
61
58
* image ,
62
- * imageProject )
59
+ imageProject )
63
60
Expect (err ).NotTo (HaveOccurred (), fmt .Sprintf ("Unable to create test instance: %v" , err ))
64
61
65
62
err = npd .SetupNPD (instance , * npdBuildTar )
0 commit comments