Add some debug logging to measure how long the CLI build takes.

Signed-off-by: Matt Moyer <moyerm@vmware.com>
This commit is contained in:
Matt Moyer 2021-03-23 12:06:35 -05:00
parent 176fb6a139
commit ce5b05f912
No known key found for this signature in database
GPG Key ID: EAE88AD172C5AE2D

View File

@ -1,4 +1,4 @@
// Copyright 2020 the Pinniped contributors. All Rights Reserved. // Copyright 2020-2021 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
package library package library
@ -9,6 +9,7 @@ import (
"path/filepath" "path/filepath"
"sync" "sync"
"testing" "testing"
"time"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
@ -34,8 +35,10 @@ func PinnipedCLIPath(t *testing.T) string {
} }
t.Log("building pinniped CLI binary") t.Log("building pinniped CLI binary")
start := time.Now()
output, err := exec.Command("go", "build", "-o", path, "go.pinniped.dev/cmd/pinniped").CombinedOutput() output, err := exec.Command("go", "build", "-o", path, "go.pinniped.dev/cmd/pinniped").CombinedOutput()
require.NoError(t, err, string(output)) require.NoError(t, err, string(output))
t.Logf("built CLI binary in %s", time.Since(start).Round(time.Millisecond))
// Fill our cache so we don't have to do this again. // Fill our cache so we don't have to do this again.
pinnipedCLIBinaryCache.buf, err = ioutil.ReadFile(path) pinnipedCLIBinaryCache.buf, err = ioutil.ReadFile(path)