Skip to content

Commit

Permalink
Change error condition check to use expected error
Browse files Browse the repository at this point in the history
Signed-off-by: jubittajohn <jujohn@redhat.com>
  • Loading branch information
jubittajohn committed Jun 5, 2023
1 parent c98acaf commit 3ab4a87
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions internal/resolution/resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ import (

func TestOperatorResolver(t *testing.T) {

testEntityCache := map[deppy.Identifier]input.Entity{"operatorhub/prometheus/0.37.0": *input.NewEntity("operatorhub/prometheus/0.37.0", map[string]string{
"olm.bundle.path": `"quay.io/operatorhubio/prometheus@sha256:3e281e587de3d03011440685fc4fb782672beab044c1ebadc42788ce05a21c35"`,
"olm.channel": "{\"channelName\":\"beta\",\"priority\":0,\"replaces\":\"prometheusoperator.0.32.0\"}",
"olm.gvk": "[{\"group\":\"monitoring.coreos.com\",\"kind\":\"Alertmanager\",\"version\":\"v1\"}, {\"group\":\"monitoring.coreos.com\",\"kind\":\"Prometheus\",\"version\":\"v1\"}]",
"olm.package": "{\"packageName\":\"prometheus\",\"version\":\"0.37.0\"}",
}),
testEntityCache := map[deppy.Identifier]input.Entity{"operatorhub/prometheus/0.37.0": *input.NewEntity(
"operatorhub/prometheus/0.37.0", map[string]string{
"olm.bundle.path": `"quay.io/operatorhubio/prometheus@sha256:3e281e587de3d03011440685fc4fb782672beab044c1ebadc42788ce05a21c35"`,
"olm.channel": "{\"channelName\":\"beta\",\"priority\":0,\"replaces\":\"prometheusoperator.0.32.0\"}",
"olm.gvk": "[{\"group\":\"monitoring.coreos.com\",\"kind\":\"Alertmanager\",\"version\":\"v1\"}, {\"group\":\"monitoring.coreos.com\",\"kind\":\"Prometheus\",\"version\":\"v1\"}]",
"olm.package": "{\"packageName\":\"prometheus\",\"version\":\"0.37.0\"}",
}),
"operatorhub/prometheus/0.47.0": *input.NewEntity("operatorhub/prometheus/0.47.0", map[string]string{
"olm.bundle.path": `"quay.io/operatorhubio/prometheus@sha256:5b04c49d8d3eff6a338b56ec90bdf491d501fe301c9cdfb740e5bff6769a21ed"`,
"olm.channel": "{\"channelName\":\"beta\",\"priority\":0,\"replaces\":\"prometheusoperator.0.37.0\"}",
Expand Down Expand Up @@ -103,7 +104,7 @@ func TestOperatorResolver(t *testing.T) {
resolver := resolution.NewOperatorResolver(client, entitySource)
solution, err := resolver.Resolve(context.Background())

if err != nil {
if tt.ExpectedError != nil {
assert.Equal(t, err, tt.ExpectedError)
assert.Nil(t, solution)
} else {
Expand Down

0 comments on commit 3ab4a87

Please sign in to comment.