Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
imjasonh committed Mar 21, 2019
1 parent b1ce051 commit d580f39
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions pkg/build/gobuild_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ func TestGoBuildIsSupportedRef(t *testing.T) {

// Supported import paths.
for _, importpath := range []string{
filepath.FromSlash("github.com/google/go-containerregistry/cmd/crane"),
filepath.FromSlash("github.com/google/go-containerregistry/vendor/k8s.io/code-generator/cmd/deepcopy-gen"), // vendored commands work too.
filepath.FromSlash("github.com/google/ko/cmd"),
filepath.FromSlash("github.com/google/ko/cmd/ko"),
filepath.FromSlash("github.com/google/ko/vendor/github.com/googleapis/gnostic/compiler"), // vendored commands work too.
} {
t.Run(importpath, func(t *testing.T) {
if !ng.IsSupportedReference(importpath) {
Expand All @@ -53,8 +52,8 @@ func TestGoBuildIsSupportedRef(t *testing.T) {

// Unsupported import paths.
for _, importpath := range []string{
filepath.FromSlash("github.com/google/go-containerregistry/v1/remote"), // not a command.
filepath.FromSlash("github.com/google/go-containerregistry/pkg/foo"), // does not exist.
filepath.FromSlash("github.com/google/ko/pkg/build"), // not a command.
filepath.FromSlash("github.com/google/ko/pkg/nonexistent"), // does not exist.
} {
t.Run(importpath, func(t *testing.T) {
if ng.IsSupportedReference(importpath) {
Expand Down Expand Up @@ -88,7 +87,7 @@ func TestGoBuildNoKoData(t *testing.T) {
if err != nil {
t.Fatalf("random.Image() = %v", err)
}
importpath := "github.com/google/go-containerregistry"
importpath := "github.com/google/ko"

creationTime := v1.Time{time.Unix(5000, 0)}
ng, err := NewGo(
Expand Down Expand Up @@ -165,7 +164,7 @@ func TestGoBuild(t *testing.T) {
if err != nil {
t.Fatalf("random.Image() = %v", err)
}
importpath := "github.com/google/go-containerregistry"
importpath := "github.com/google/ko"

creationTime := v1.Time{time.Unix(5000, 0)}
ng, err := NewGo(
Expand Down

0 comments on commit d580f39

Please sign in to comment.