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

test: enable response checks as required by e2e tests #135

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 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 example/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2023 The OWASP Coraza contributors
# SPDX-License-Identifier: Apache-2.0

FROM golang:1.21 as build
FROM golang:1.23 AS build
fionera marked this conversation as resolved.
Show resolved Hide resolved

WORKDIR /go/src/app
COPY . .
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ require (
github.com/jcchavezs/mergefs v0.0.0-20230503083351-07f27d256761
github.com/magefile/mage v1.15.0
github.com/mccutchen/go-httpbin/v2 v2.14.0
github.com/pires/go-proxyproto v0.8.0
github.com/rs/zerolog v1.33.0
gopkg.in/yaml.v3 v3.0.1
istio.io/istio v0.0.0-20240218163812-d80ef7b19049
Expand All @@ -24,7 +23,7 @@ require (
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.25.0 // indirect
rsc.io/binaryregexp v0.2.0 // indirect
)
7 changes: 2 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ github.com/miekg/dns v1.1.58 h1:ca2Hdkz+cDg/7eNF6V56jjzuZ4aCAE+DbVkILdQWG/4=
github.com/miekg/dns v1.1.58/go.mod h1:Ypv+3b/KadlvW9vJfXOTf300O4UqaHFzFCuHz+rPkBY=
github.com/petar-dambovaliev/aho-corasick v0.0.0-20240411101913-e07a1f0e8eb4 h1:1Kw2vDBXmjop+LclnzCb/fFy+sgb3gYARwfmoUcQe6o=
github.com/petar-dambovaliev/aho-corasick v0.0.0-20240411101913-e07a1f0e8eb4/go.mod h1:EHPiTAKtiFmrMldLUNswFwfZ2eJIYBHktdaUTZxYWRw=
github.com/pires/go-proxyproto v0.7.0 h1:IukmRewDQFWC7kfnb66CSomk2q/seBuilHBYFwyq0Hs=
github.com/pires/go-proxyproto v0.7.0/go.mod h1:Vz/1JPY/OACxWGQNIRY2BeyDmpoaWmEP40O9LbuiFR4=
github.com/pires/go-proxyproto v0.8.0/go.mod h1:iknsfgnH8EkjrMeMyvfKByp9TiBZCKZM0jx2xmKqnVY=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
Expand All @@ -59,8 +56,8 @@ golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo=
golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand Down
7 changes: 3 additions & 4 deletions internal/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestE2E(t *testing.T) {
t.Fatalf("e2e tests failed: %v", err)
}
})
t.Run("high request rate", func(*testing.T) {
t.Run("high request rate", func(t *testing.T) {
config, _, _ := runCoraza(t)

if os.Getenv("CI") != "" {
Expand Down Expand Up @@ -66,7 +66,7 @@ func runCoraza(tb testing.TB) (testutil.HAProxyConfig, string, string) {

appCfg := AppConfig{
Directives: e2e.Directives,
ResponseCheck: false,
ResponseCheck: true,
Logger: logger,
TransactionTTL: 10 * time.Second,
}
Expand Down Expand Up @@ -117,8 +117,7 @@ func runCoraza(tb testing.TB) (testutil.HAProxyConfig, string, string) {
EngineConfig: `
[e2e]
spoe-agent e2e
# messages coraza-req coraza-res
messages coraza-req
messages coraza-req coraza-res
option var-prefix e2e
option set-on-error error
timeout hello 2s
Expand Down
6 changes: 1 addition & 5 deletions magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

var addLicenseVersion = "v1.1.1" // https://github.com/google/addlicense/releases
var gosImportsVer = "v0.3.7" // https://github.com/rinchsan/gosimports/releases
var golangCILintVer = "v1.54.0" // https://github.com/golangci/golangci-lint/releases
var golangCILintVer = "v1.62.0" // https://github.com/golangci/golangci-lint/releases
var errNoGitDir = errors.New("no .git directory found")
var errUpdateGeneratedFiles = errors.New("generated files need to be updated")

Expand Down Expand Up @@ -76,10 +76,6 @@ func Lint() error {
return err
}

if err := sh.RunV("go", "work", "sync"); err != nil {
return err
}

if err := filepath.WalkDir(".", func(path string, d os.DirEntry, err error) error {
if err != nil {
return err
Expand Down
Loading