Skip to content

Commit f74a55b

Browse files
committed
chore: fixed testdata mutator with regal
1 parent 1f01d66 commit f74a55b

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

admissionctrl/mutator/opa_json_patch_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func TestJSONPatcher_Mutate(t *testing.T) {
2929

3030
{
3131
name: "hello world",
32-
j: newMutator(t, testutil.Filepath(t, "opa/mutators/opajsonpatchtesting.rego"),
32+
j: newMutator(t, testutil.Filepath(t, "opa/mutators/opajsonpatchtesting/opajsonpatchtesting.rego"),
3333
"patch = data.opajsonpatchtesting.patch",
3434
),
3535

@@ -47,7 +47,7 @@ func TestJSONPatcher_Mutate(t *testing.T) {
4747
},
4848
{
4949
name: "warning",
50-
j: newMutator(t, testutil.Filepath(t, "opa/mutators/opajsonpatchtesting.rego"),
50+
j: newMutator(t, testutil.Filepath(t, "opa/mutators/opajsonpatchtesting/opajsonpatchtesting.rego"),
5151
`warnings = data.opajsonpatchtesting.warnings`,
5252
),
5353

@@ -61,7 +61,7 @@ func TestJSONPatcher_Mutate(t *testing.T) {
6161
},
6262
{
6363
name: "warning and hello world",
64-
j: newMutator(t, testutil.Filepath(t, "opa/mutators/opajsonpatchtesting.rego"),
64+
j: newMutator(t, testutil.Filepath(t, "opa/mutators/opajsonpatchtesting/opajsonpatchtesting.rego"),
6565
`
6666
patch = data.opajsonpatchtesting.patch
6767
warnings = data.opajsonpatchtesting.warnings
@@ -82,7 +82,7 @@ func TestJSONPatcher_Mutate(t *testing.T) {
8282
},
8383
{
8484
name: "error",
85-
j: newMutator(t, testutil.Filepath(t, "opa/mutators/opajsonpatchtesting.rego"),
85+
j: newMutator(t, testutil.Filepath(t, "opa/mutators/opajsonpatchtesting/opajsonpatchtesting.rego"),
8686
`errors = data.opajsonpatchtesting.errors`,
8787
),
8888

@@ -97,7 +97,7 @@ func TestJSONPatcher_Mutate(t *testing.T) {
9797
{
9898
name: "error when elements are not queryable",
9999
//faultypatch has only a patch, no errors or warnings
100-
j: newMutator(t, testutil.Filepath(t, "opa/mutators/faultypatch.rego"),
100+
j: newMutator(t, testutil.Filepath(t, "opa/mutators/faultypatch/faultypatch.rego"),
101101
`errors = data.faultypatch.errors`,
102102
),
103103

@@ -112,7 +112,7 @@ func TestJSONPatcher_Mutate(t *testing.T) {
112112
{
113113
name: "error when result is not a patch",
114114
//faultypatch has only a patch does not contain valid patch data
115-
j: newMutator(t, testutil.Filepath(t, "opa/mutators/faultypatch.rego"),
115+
j: newMutator(t, testutil.Filepath(t, "opa/mutators/faultypatch/faultypatch.rego"),
116116
`patch = data.faultypatch.patch`,
117117
),
118118

File renamed without changes.
File renamed without changes.

testdata/opa/mutators/hello_world_meta_test.rego renamed to testdata/opa/mutators/hello_world_meta/hello_world_meta_test.rego

File renamed without changes.

testdata/opa/mutators/opajsonpatchtesting.rego renamed to testdata/opa/mutators/opajsonpatchtesting/opajsonpatchtesting.rego

File renamed without changes.

0 commit comments

Comments
 (0)