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

Merged
merged 7 commits into from
Nov 25, 2024
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 .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
go-version: '1.22'
- run: go run mage.go lint
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
go-version: '1.22'

- name: setup environment
run: |
Expand Down
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.22 AS build

WORKDIR /go/src/app
COPY . .
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,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
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -56,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