Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include missing unit test #344

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ IMG ?= $(IMAGE_TAG_BASE):$(IMAGE_TAG)
ENVTEST_K8S_VERSION = 1.22

# Directories containing unit & integration test packages
UNIT_DIRS := ./pkg/... ./api/...
UNIT_DIRS := ./pkg/... ./api/... ./controllers/...
INTEGRATION_DIRS := ./controllers...

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
Expand Down
18 changes: 9 additions & 9 deletions controllers/authpolicy_authconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ func TestAuthorinoConditionsFromHTTPRouteRule(t *testing.T) {
{
PatternExpressionOrRef: authorinoapi.PatternExpressionOrRef{
PatternExpression: authorinoapi.PatternExpression{
Selector: `request.path.@extract:{"sep":"?x-foo=","pos":1}.@extract:{"sep":"&"}`,
Selector: `request.path.@extract:{"sep":"?x-foo=","pos":1}|@extract:{"sep":"&"}`,
Operator: "eq",
Value: "a-value",
},
Expand All @@ -576,7 +576,7 @@ func TestAuthorinoConditionsFromHTTPRouteRule(t *testing.T) {
{
PatternExpressionOrRef: authorinoapi.PatternExpressionOrRef{
PatternExpression: authorinoapi.PatternExpression{
Selector: `request.path.@extract:{"sep":"&x-foo=","pos":1}.@extract:{"sep":"&"}`,
Selector: `request.path.@extract:{"sep":"&x-foo=","pos":1}|@extract:{"sep":"&"}`,
Operator: "eq",
Value: "a-value",
},
Expand Down Expand Up @@ -624,7 +624,7 @@ func TestAuthorinoConditionsFromHTTPRouteRule(t *testing.T) {
{
PatternExpressionOrRef: authorinoapi.PatternExpressionOrRef{
PatternExpression: authorinoapi.PatternExpression{
Selector: `request.path.@extract:{"sep":"?x-foo=","pos":1}.@extract:{"sep":"&"}`,
Selector: `request.path.@extract:{"sep":"?x-foo=","pos":1}|@extract:{"sep":"&"}`,
Operator: "eq",
Value: "a-value",
},
Expand All @@ -633,7 +633,7 @@ func TestAuthorinoConditionsFromHTTPRouteRule(t *testing.T) {
{
PatternExpressionOrRef: authorinoapi.PatternExpressionOrRef{
PatternExpression: authorinoapi.PatternExpression{
Selector: `request.path.@extract:{"sep":"&x-foo=","pos":1}.@extract:{"sep":"&"}`,
Selector: `request.path.@extract:{"sep":"&x-foo=","pos":1}|@extract:{"sep":"&"}`,
Operator: "eq",
Value: "a-value",
},
Expand All @@ -648,7 +648,7 @@ func TestAuthorinoConditionsFromHTTPRouteRule(t *testing.T) {
{
PatternExpressionOrRef: authorinoapi.PatternExpressionOrRef{
PatternExpression: authorinoapi.PatternExpression{
Selector: `request.path.@extract:{"sep":"?x-bar=","pos":1}.@extract:{"sep":"&"}`,
Selector: `request.path.@extract:{"sep":"?x-bar=","pos":1}|@extract:{"sep":"&"}`,
Operator: "eq",
Value: "other-value",
},
Expand All @@ -657,7 +657,7 @@ func TestAuthorinoConditionsFromHTTPRouteRule(t *testing.T) {
{
PatternExpressionOrRef: authorinoapi.PatternExpressionOrRef{
PatternExpression: authorinoapi.PatternExpression{
Selector: `request.path.@extract:{"sep":"&x-bar=","pos":1}.@extract:{"sep":"&"}`,
Selector: `request.path.@extract:{"sep":"&x-bar=","pos":1}|@extract:{"sep":"&"}`,
Operator: "eq",
Value: "other-value",
},
Expand Down Expand Up @@ -700,7 +700,7 @@ func TestAuthorinoConditionsFromHTTPRouteRule(t *testing.T) {
{
PatternExpressionOrRef: authorinoapi.PatternExpressionOrRef{
PatternExpression: authorinoapi.PatternExpression{
Selector: `request.path.@extract:{"sep":"?x-foo=","pos":1}.@extract:{"sep":"&"}`,
Selector: `request.path.@extract:{"sep":"?x-foo=","pos":1}|@extract:{"sep":"&"}`,
Operator: "matches",
Value: "^a+.*$",
},
Expand All @@ -709,7 +709,7 @@ func TestAuthorinoConditionsFromHTTPRouteRule(t *testing.T) {
{
PatternExpressionOrRef: authorinoapi.PatternExpressionOrRef{
PatternExpression: authorinoapi.PatternExpression{
Selector: `request.path.@extract:{"sep":"&x-foo=","pos":1}.@extract:{"sep":"&"}`,
Selector: `request.path.@extract:{"sep":"&x-foo=","pos":1}|@extract:{"sep":"&"}`,
Operator: "matches",
Value: "^a+.*$",
},
Expand All @@ -735,7 +735,7 @@ func TestAuthorinoConditionsFromHTTPRouteRule(t *testing.T) {
}
for i := range result {
if !reflect.DeepEqual(result[i], tc.expected[i]) {
t.Errorf("Expected rule %d to be %v, got %v", i, tc.expected[i], result[i])
t.Errorf("Expected rule %d to \nbe\t%v, \ngot\t%v", i, tc.expected[i], result[i])
}
}
})
Expand Down
Loading