Skip to content

Commit

Permalink
chore(deps): refactor load_test so that OLM is no longer imported at all
Browse files Browse the repository at this point in the history
  • Loading branch information
ecordell committed Sep 25, 2019
1 parent 7bafd22 commit afb7ad1
Show file tree
Hide file tree
Showing 35 changed files with 9 additions and 15,610 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ require (
github.com/grpc-ecosystem/grpc-health-probe v0.2.1-0.20181220223928-2bf0a5b182db
github.com/imdario/mergo v0.3.7 // indirect
github.com/mattn/go-sqlite3 v1.10.0
github.com/operator-framework/operator-lifecycle-manager v3.11.0+incompatible
github.com/otiai10/copy v1.0.1
github.com/otiai10/curr v0.0.0-20190513014714-f5a3d24e5776 // indirect
github.com/sirupsen/logrus v1.4.2
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,6 @@ github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo=
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/operator-framework/operator-lifecycle-manager v3.11.0+incompatible h1:Po8C8RVLRWq7pNQ5pKonM9CXpC/osoBWbmsuf+HJnSI=
github.com/operator-framework/operator-lifecycle-manager v3.11.0+incompatible/go.mod h1:Ma5ZXd4S1vmMyewWlF7aO8CZiokR7Sd8dhSfkGkNU4U=
github.com/otiai10/copy v1.0.1 h1:gtBjD8aq4nychvRZ2CyJvFWAw0aja+VHazDdruZKGZA=
github.com/otiai10/copy v1.0.1/go.mod h1:8bMCJrAqOtN/d9oyh5HR7HhLQMvcGMpGdwRDYsfOCHc=
github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE=
Expand Down
22 changes: 9 additions & 13 deletions pkg/sqlite/load_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package sqlite

import (
"context"
"encoding/json"
"fmt"
"math/rand"
"os"
"testing"

"github.com/operator-framework/operator-lifecycle-manager/pkg/api/apis/operators/v1alpha1"
"github.com/stretchr/testify/require"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
Expand All @@ -16,11 +16,6 @@ import (
"github.com/operator-framework/operator-registry/pkg/registry"
)

var testScheme = runtime.NewScheme()

func init() {
v1alpha1.AddToScheme(testScheme)
}

func TestAddPackageChannels(t *testing.T) {
type fields struct {
Expand Down Expand Up @@ -150,7 +145,8 @@ func TestAddPackageChannels(t *testing.T) {
}

for i, pkg := range tt.args.pkgs {
require.Equal(t, tt.expected.errs[i], store.AddPackageChannels(pkg))
errs := store.AddPackageChannels(pkg)
require.Equal(t, tt.expected.errs[i], errs, "expected %v, got %v", tt.expected.errs[i], errs)
}

// Ensure expected packages were loaded
Expand All @@ -165,14 +161,14 @@ func TestAddPackageChannels(t *testing.T) {
}

func newUnstructuredCSV(t *testing.T, name, replaces string) *unstructured.Unstructured {
csv := &v1alpha1.ClusterServiceVersion{}
csv := &registry.ClusterServiceVersion{}
csv.TypeMeta.Kind = "ClusterServiceVersion"
csv.SetName(name)
csv.Spec.Replaces = replaces
csv.Spec = json.RawMessage(fmt.Sprintf(`{"replaces": "%s"}`, replaces))

out := &unstructured.Unstructured{}
require.NoError(t, testScheme.Convert(csv, out, nil))

return out
out, err := runtime.DefaultUnstructuredConverter.ToUnstructured(csv)
require.NoError(t, err)
return &unstructured.Unstructured{Object:out}
}

func newBundle(t *testing.T, name, pkgName, channelName string, objs ...*unstructured.Unstructured) *registry.Bundle {
Expand Down
202 changes: 0 additions & 202 deletions vendor/github.com/coreos/go-semver/LICENSE

This file was deleted.

5 changes: 0 additions & 5 deletions vendor/github.com/coreos/go-semver/NOTICE

This file was deleted.

Loading

0 comments on commit afb7ad1

Please sign in to comment.