@@ -58,6 +58,11 @@ func collectResults(ctx context.Context, binaries []*Binary, driver string) (*re
58
58
return nil , errors .Wrapf (err , "timing run %d with %s" , run , binary .Name ())
59
59
}
60
60
rm .addResult (binary , r )
61
+ r , err = timeEnableIngress (ctx , binary )
62
+ if err != nil {
63
+ return nil , errors .Wrapf (err , "timing run %d with %s" , run , binary .Name ())
64
+ }
65
+ rm .addResult (binary , r )
61
66
}
62
67
}
63
68
return rm , nil
@@ -72,22 +77,35 @@ func average(nums []float64) float64 {
72
77
}
73
78
74
79
// timeMinikubeStart returns the time it takes to execute `minikube start`
75
- // It deletes the VM after `minikube start`.
76
80
func timeMinikubeStart (ctx context.Context , binary * Binary , driver string ) (* result , error ) {
77
81
startCmd := exec .CommandContext (ctx , binary .path , "start" , fmt .Sprintf ("--driver=%s" , driver ))
78
82
startCmd .Stderr = os .Stderr
79
83
84
+ log .Printf ("Running: %v..." , startCmd .Args )
85
+ r , err := timeCommandLogs (startCmd )
86
+ if err != nil {
87
+ return nil , errors .Wrapf (err , "timing cmd: %v" , startCmd .Args )
88
+ }
89
+ return r , nil
90
+ }
91
+
92
+ // timeEnableIngress returns the time it takes to execute `minikube addons enable ingress`
93
+ // It deletes the VM after `minikube addons enable ingress`.
94
+ func timeEnableIngress (ctx context.Context , binary * Binary ) (* result , error ) {
95
+ enableCmd := exec .CommandContext (ctx , binary .path , "addons enable ingress" )
96
+ enableCmd .Stderr = os .Stderr
97
+
80
98
deleteCmd := exec .CommandContext (ctx , binary .path , "delete" )
81
99
defer func () {
82
100
if err := deleteCmd .Run (); err != nil {
83
101
log .Printf ("error deleting minikube: %v" , err )
84
102
}
85
103
}()
86
104
87
- log .Printf ("Running: %v..." , startCmd .Args )
88
- r , err := timeCommandLogs (startCmd )
105
+ log .Printf ("Running: %v..." , enableCmd .Args )
106
+ r , err := timeCommandLogs (enableCmd )
89
107
if err != nil {
90
- return nil , errors .Wrapf (err , "timing cmd: %v" , startCmd .Args )
108
+ return nil , errors .Wrapf (err , "timing cmd: %v" , enableCmd .Args )
91
109
}
92
110
return r , nil
93
111
}
0 commit comments