mkcmp: download artifacts before timing starT
parent
df906e5895
commit
7750b3c445
|
@ -36,9 +36,13 @@ const (
|
|||
func CompareMinikubeStart(ctx context.Context, out io.Writer, binaries []*Binary) error {
|
||||
drivers := []string{"kvm2", "docker"}
|
||||
for _, d := range drivers {
|
||||
fmt.Printf("**%s Driver**\n", d)
|
||||
if err := downloadArtifacts(ctx, binaries, d); err != nil {
|
||||
fmt.Printf("error downloading artifacts: %v", err)
|
||||
continue
|
||||
}
|
||||
rm, err := collectResults(ctx, binaries, d)
|
||||
if err != nil {
|
||||
fmt.Printf("**%s Driver**\n", d)
|
||||
fmt.Printf("error collecting results for %s driver: %v\n", d, err)
|
||||
continue
|
||||
}
|
||||
|
@ -71,6 +75,16 @@ func average(nums []float64) float64 {
|
|||
return total / float64(len(nums))
|
||||
}
|
||||
|
||||
func downloadArtifacts(ctx context.Context, binaries []*Binary, driver string) error {
|
||||
for _, b := range binaries {
|
||||
c := exec.CommandContext(ctx, b.path, "start", fmt.Sprintf("--driver=%s", driver), "--download-only")
|
||||
if err := c.Run(); err != nil {
|
||||
return errors.Wrap(err, "downloading artifacts")
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// timeMinikubeStart returns the time it takes to execute `minikube start`
|
||||
// It deletes the VM after `minikube start`.
|
||||
func timeMinikubeStart(ctx context.Context, binary *Binary, driver string) (*result, error) {
|
||||
|
|
Loading…
Reference in New Issue