@@ -17,6 +17,10 @@ contains() {
1717# Return true if the current OS is not Windows
1818WAF_ENABLED=$( [ " $GOOS " = " windows" ] && echo false || echo true)
1919
20+ if $( contains " $GOVERSION " devel) ; then
21+ WAF_ENABLED=false
22+ fi
23+
2024# run is the main function that runs the tests
2125# It takes 2 arguments:
2226# - $1: whether the WAF is enabled or not (true or false)
@@ -28,11 +32,6 @@ run() {
2832 test_tags=" $2 ,$GOOS ,$GOARCH "
2933 cgo=$( $( contains " $2 " cgo) && echo 1 || echo 0)
3034
31- # Go 1.23 does not allow go version build tags
32- if $( contains " $GOVERSION " go1.23) && $( contains " $test_tags " go1) ; then
33- return
34- fi
35-
3635 echo " Running matrix $test_tags where the WAF is" " $( $waf_enabled && echo " supported" || echo " not supported" ) " " ..."
3736 env CGO_ENABLED=" $cgo " go test -shuffle=on -tags=" $tags " -args -waf-build-tags=" $test_tags " -waf-supported=" $waf_enabled " ./...
3837
@@ -41,32 +40,23 @@ run() {
4140 fi
4241
4342 if [ " $cgo " = " 1" ]; then
44- echo " Running again with cgocheck enabled..."
45- env " GOEXPERIMENT=cgocheck2" CGO_ENABLED=1 go test -shuffle=on -tags=" $tags " -args -waf-build-tags=" $test_tags " -waf-supported=" $waf_enabled " ./...
43+ echo " Running again with cgo options ( cgocheck & race) enabled..."
44+ env " GOEXPERIMENT=cgocheck2" CGO_ENABLED=1 go test -race - shuffle=on -tags=" $tags " -args -waf-build-tags=" $test_tags " -waf-supported=" $waf_enabled " ./...
4645 fi
4746
48- # TODO: remove condition once we have native arm64 linux runners
49- if [ " $GOARCH " = " amd64" ]; then
50- echo " Running again $nproc times in parralel"
51- env CGO_ENABLED=" $cgo " go test -shuffle=on -parallel $(( nproc / 4 + 1 )) -count=" $nproc " -tags=" $tags " -args -waf-build-tags=" $test_tags " -waf-supported=" $waf_enabled " ./...
52- fi
47+ echo " Running again $nproc times in parralel"
48+ env CGO_ENABLED=" $cgo " go test -shuffle=on -parallel $(( nproc / 4 + 1 )) -count=" $nproc " -tags=" $tags " -args -waf-build-tags=" $test_tags " -waf-supported=" $waf_enabled " ./...
5349}
5450
5551run " $WAF_ENABLED " appsec # WAF enabled (but not on windows)
5652run false # CGO Disabled
57- run false go1.24 # Too recent go version (not tested)
58- run false go1.24,appsec # CGO disabled with appsec explicitely enabled but too recent go version
5953run false datadog.no_waf # WAF manually disabled
6054run false datadog.no_waf,appsec # CGO disabled with appsec explicitely enabled but WAF manually disabled
61- run false datadog.no_waf,go1.24 # WAF manually disabled and go version to recent
62- run false datadog.no_waf,go1.24,appsec # CGO disabled, WAF manually disabled, too recent go version with appsec explicitely enabled
6355
6456# Check if we are running on Alpine and install the required dependencies for cgo
6557if [ -f /etc/os-release ] && grep -q Alpine < /etc/os-release; then
6658 apk add gcc musl-dev libc6-compat
6759fi
6860
6961run " $WAF_ENABLED " cgo # WAF enabled (but not on windows)
70- run false go1.24,cgo # CGO enabled and too recent go version
7162run false datadog.no_waf,cgo # WAF manually disabled and CGO enabled
72- run false datadog.no_waf,go1.24,cgo # CGO enabled, WAF manually disabled, too recent go version
0 commit comments