@@ -107,7 +107,7 @@ func TestPluginOneShot(t *testing.T) {
107107
108108 data , err := manager .Store .Read (ctx , txn , storage.Path {})
109109 expData := util .MustUnmarshalJSON ([]byte (`{
110- "foo": {"bar": 1, "baz": "qux"},
110+ "foo": {"bar": 1, "baz": "qux"},
111111 "system": {
112112 "bundles": {"test-bundle": {"etag": "foo", "manifest": {"revision": "quickbrownfaux", "roots": [""]}}},
113113 "modules": {"test-bundle/foo/bar": {"rego_version": 1}}
@@ -968,7 +968,7 @@ func TestPluginStartLazyLoadInMem(t *testing.T) {
968968 }
969969
970970 expected := `{
971- "p": "x1", "q": "x2",
971+ "p": "x1", "q": "x2",
972972 "system": {
973973 "bundles": {"test-1": {"etag": "", "manifest": {"revision": "", "roots": ["p", "authz"]}}, "test-2": {"etag": "", "manifest": {"revision": "", "roots": ["q"]}}},
974974 "modules": {"test-1/bar/policy.rego": {"rego_version": 1}}
@@ -1087,7 +1087,7 @@ func TestPluginOneShotDiskStorageMetrics(t *testing.T) {
10871087
10881088 data , err := manager .Store .Read (ctx , txn , storage.Path {})
10891089 expData := util .MustUnmarshalJSON ([]byte (`{
1090- "foo": {"bar": 1, "baz": "qux"},
1090+ "foo": {"bar": 1, "baz": "qux"},
10911091 "system": {
10921092 "bundles": {"test-bundle": {"etag": "", "manifest": {"revision": "quickbrownfaux", "roots": [""]}}},
10931093 "modules": {"test-bundle/foo/bar": {"rego_version": 1}}
@@ -1194,7 +1194,7 @@ func TestPluginOneShotDeltaBundle(t *testing.T) {
11941194 t .Fatal (err )
11951195 }
11961196 expData := util .MustUnmarshalJSON ([]byte (`{
1197- "a": {"baz": "bux", "foo": ["hello", "world"]},
1197+ "a": {"baz": "bux", "foo": ["hello", "world"]},
11981198 "system": {
11991199 "bundles": {"test-bundle": {"etag": "foo", "manifest": {"revision": "delta", "roots": ["a"]}}},
12001200 "modules": {"test-bundle/a/policy.rego": {"rego_version": 1}}
@@ -1299,7 +1299,7 @@ func TestPluginOneShotDeltaBundleWithAstStore(t *testing.T) {
12991299 t .Fatal (err )
13001300 }
13011301 expData := ast .MustParseTerm (`{
1302- "a": {"baz": "bux", "foo": ["hello", "world"]},
1302+ "a": {"baz": "bux", "foo": ["hello", "world"]},
13031303 "system": {
13041304 "bundles": {"test-bundle": {"etag": "foo", "manifest": {"revision": "delta", "roots": ["a"]}}},
13051305 "modules": {"test-bundle/a/policy.rego": {"rego_version": 1}}
@@ -1486,7 +1486,7 @@ func TestPluginOneShotBundlePersistence(t *testing.T) {
14861486
14871487 data , err := manager .Store .Read (ctx , txn , storage.Path {})
14881488 expData := util .MustUnmarshalJSON ([]byte (`{
1489- "foo": {"bar": 1, "baz": "qux"},
1489+ "foo": {"bar": 1, "baz": "qux"},
14901490 "system": {
14911491 "bundles": {"test-bundle": {"etag": "foo", "manifest": {"revision": "quickbrownfaux", "roots": [""]}}},
14921492 "modules": {"test-bundle/foo/bar.rego": {"rego_version": 1}}
@@ -1675,7 +1675,7 @@ corge contains 1 if {
16751675 }
16761676
16771677 expData := util .MustUnmarshalJSON ([]byte (`{
1678- "foo": {"bar": 1, "baz": "qux"},
1678+ "foo": {"bar": 1, "baz": "qux"},
16791679 "system": {
16801680 "bundles": {"test-bundle": {"etag": "foo", "manifest": {"revision": "quickbrownfaux", "roots": [""]}}}
16811681 }
@@ -1980,7 +1980,7 @@ corge contains 1 if {
19801980 }
19811981
19821982 expData := util .MustUnmarshalJSON ([]byte (fmt .Sprintf (`{
1983- "foo": {"bar": 1, "baz": "qux"},
1983+ "foo": {"bar": 1, "baz": "qux"},
19841984 "system": {
19851985 "bundles": {"test-bundle": {"etag": "foo", "manifest": {"revision": "quickbrownfaux"%s, "roots": [""]}}}%s
19861986 }
@@ -2169,7 +2169,7 @@ func TestLoadAndActivateBundlesFromDisk(t *testing.T) {
21692169
21702170 data , err := manager .Store .Read (ctx , txn , storage.Path {})
21712171 expData := util .MustUnmarshalJSON ([]byte (`{
2172- "foo": {"bar": 1, "baz": "qux"},
2172+ "foo": {"bar": 1, "baz": "qux"},
21732173 "system": {
21742174 "bundles": {"test-bundle": {"etag": "", "manifest": {"revision": "quickbrownfaux", "roots": [""]}}},
21752175 "modules": {"test-bundle/foo/bar.rego": {"rego_version": 1}}
@@ -2255,7 +2255,7 @@ func TestLoadAndActivateBundlesFromDiskReservedChars(t *testing.T) {
22552255
22562256 data , err := manager .Store .Read (ctx , txn , storage.Path {})
22572257 expData := util .MustUnmarshalJSON ([]byte (`{
2258- "foo": {"bar": 1, "baz": "qux"},
2258+ "foo": {"bar": 1, "baz": "qux"},
22592259 "system": {
22602260 "bundles": {"test?bundle=opa": {"etag": "", "manifest": {"revision": "quickbrownfaux", "roots": [""]}}},
22612261 "modules": {"test/foo/bar.rego": {"rego_version": 1}}
@@ -2504,7 +2504,7 @@ corge contains 2 if {
25042504 }
25052505
25062506 expData := util .MustUnmarshalJSON ([]byte (`{
2507- "foo": {"bar": 1, "baz": "qux"},
2507+ "foo": {"bar": 1, "baz": "qux"},
25082508 "system": {
25092509 "bundles": {"test-bundle": {"etag": "", "manifest": {"revision": "quickbrownfaux", "roots": [""]}}}
25102510 }
@@ -2739,7 +2739,7 @@ corge contains 1 if {
27392739 var expData any
27402740 if moduleRegoVersion != runtimeRegoVersion {
27412741 expData = util .MustUnmarshalJSON ([]byte (fmt .Sprintf (`{
2742- "foo": {"bar": 1, "baz": "qux"},
2742+ "foo": {"bar": 1, "baz": "qux"},
27432743 "system": {
27442744 "bundles": {"test-bundle": {"etag": "", "manifest": {"revision": "quickbrownfaux"%s, "roots": [""]}}},
27452745 "modules": {"test-bundle/foo/bar.rego": {"rego_version": %d}}
@@ -2748,7 +2748,7 @@ corge contains 1 if {
27482748 manifestRegoVersionStr , moduleRegoVersion )))
27492749 } else {
27502750 expData = util .MustUnmarshalJSON ([]byte (fmt .Sprintf (`{
2751- "foo": {"bar": 1, "baz": "qux"},
2751+ "foo": {"bar": 1, "baz": "qux"},
27522752 "system": {
27532753 "bundles": {"test-bundle": {"etag": "", "manifest": {"revision": "quickbrownfaux"%s, "roots": [""]}}}
27542754 }
@@ -3534,7 +3534,7 @@ p contains x if { x = 1 }`
35343534 t .Errorf ("Expected to have bundle status for %q included in update, got: %+v" , name , s1 )
35353535 }
35363536 // they should be defaults at this point
3537- if ! reflect . DeepEqual ( s , & Status {Name : name }) {
3537+ if ! s . Equal ( & Status {Name : name }) {
35383538 t .Errorf ("Expected bundle %q to have an empty status, got: %+v" , name , s1 )
35393539 }
35403540 }
@@ -3567,7 +3567,7 @@ p contains x`
35673567 t .Errorf ("Expected to have bundle status for %q included in update, got: %+v" , name , s2 )
35683568 }
35693569 // they should be still defaults
3570- if ! reflect . DeepEqual ( s , & Status {Name : name }) {
3570+ if ! s . Equal ( & Status {Name : name }) {
35713571 t .Errorf ("Expected bundle %q to have an empty status, got: %+v" , name , s2 )
35723572 }
35733573 }
@@ -3599,7 +3599,7 @@ p contains 1`
35993599 t .Errorf ("Expected to have bundle status for %q included in update, got: %+v" , name , s3 )
36003600 }
36013601 // they should still be defaults
3602- if ! reflect . DeepEqual ( s , & Status {Name : name }) {
3602+ if ! s . Equal ( & Status {Name : name }) {
36033603 t .Errorf ("Expected bundle %q to have an empty status, got: %+v" , name , s3 )
36043604 }
36053605 }
@@ -3645,7 +3645,7 @@ p contains x if { x = 1 }`
36453645 t .Fatal ("Unexpected status update, got:" , s5 )
36463646 }
36473647
3648- if ! reflect . DeepEqual ( s5 [bundleNames [0 ]], s4 [bundleNames [0 ]]) {
3648+ if ! s5 [bundleNames [0 ]]. Equal ( s4 [bundleNames [0 ]]) {
36493649 t .Fatalf ("Expected bundle %q to have the same status as before updating bundle %q, got: %+v" , bundleNames [0 ], bundleNames [1 ], s5 )
36503650 }
36513651
@@ -3656,7 +3656,7 @@ p contains x if { x = 1 }`
36563656 t .Errorf ("Expected to have bundle status for %q included in update, got: %+v" , name , s5 )
36573657 }
36583658 // they should still be defaults
3659- if ! reflect . DeepEqual ( s , & Status {Name : name }) {
3659+ if ! s . Equal ( & Status {Name : name }) {
36603660 t .Errorf ("Expected bundle %q to have an empty status, got: %+v" , name , s5 )
36613661 }
36623662 }
@@ -6858,7 +6858,7 @@ func TestPluginManualTriggerMultipleDiskStorage(t *testing.T) {
68586858
68596859 data , err := manager .Store .Read (ctx , txn , storage.Path {})
68606860 expData := util .MustUnmarshalJSON ([]byte (`{
6861- "p": "x1", "q": "x2",
6861+ "p": "x1", "q": "x2",
68626862 "system": {
68636863 "bundles": {"test-1": {"etag": "", "manifest": {"revision": "", "roots": ["p", "authz"]}}, "test-2": {"etag": "", "manifest": {"revision": "", "roots": ["q"]}}},
68646864 "modules": {"test-1/bar/policy.rego": {"rego_version": 1}}
0 commit comments