Skip to content

Commit 3ab4a87

Browse files
committed
Change error condition check to use expected error
Signed-off-by: jubittajohn <[email protected]>
1 parent c98acaf commit 3ab4a87

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

internal/resolution/resolver_test.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@ import (
1919

2020
func TestOperatorResolver(t *testing.T) {
2121

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

106-
if err != nil {
107+
if tt.ExpectedError != nil {
107108
assert.Equal(t, err, tt.ExpectedError)
108109
assert.Nil(t, solution)
109110
} else {

0 commit comments

Comments
 (0)