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

[9.0](backport #4581) Add go1.24 GODEBUG=fips140=only test #4613

Merged
merged 2 commits into from
Mar 19, 2025
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
11 changes: 11 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,17 @@ steps:
- build/*.xml
- build/coverage*.out

- label: ":smartbear-testexecute: Run FIPS unit tests"
key: unit-test-fips
command: ".buildkite/scripts/unit_test.sh"
env:
FIPS: "true"
agents:
provider: "gcp"
artifact_paths:
- build/*.xml
- build/coverage*.out

- label: ":smartbear-testexecute: Run unit tests: MacOS 13"
key: unit-test-macos-13
command: ".buildkite/scripts/unit_test.sh"
Expand Down
6 changes: 5 additions & 1 deletion .buildkite/scripts/unit_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ add_bin_path
with_go

echo "Starting the unit tests..."
make test-unit junit-report
if [[ ${FIPS:-} == "true" ]]; then
make test-unit-fips junit-report
else
make test-unit junit-report
fi
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,16 @@ test: prepare-test-context ## - Run all tests
test-release: ## - Check that all release binaries are created
./.buildkite/scripts/test-release.sh $(DEFAULT_VERSION)

# If FIPS=true unit tests need microsoft/go + OpenSSL with FIPS
.PHONY: test-unit
test-unit: prepare-test-context ## - Run unit tests only
set -o pipefail; go test ${GO_TEST_FLAG} -tags=$(GOBUILDTAGS) -v -race -coverprofile=build/coverage-${OS_NAME}.out ./... | tee build/test-unit-${OS_NAME}.out
set -o pipefail; ${GOFIPSEXPERIMENT} go test ${GO_TEST_FLAG} -tags=$(GOBUILDTAGS) -v -race -coverprofile=build/coverage-${OS_NAME}.out ./... | tee build/test-unit-${OS_NAME}.out

# FIPS unit tests are meant to use go v1.24 to check FIPS compliance.
# This check is very strict, and should be thought of as a static-code analysis tool.
.PHONY: test-unit-fips
test-unit-fips: prepare-test-context ## - Run unit tests with go 1.24's fips140=only for testing
set -o pipefail; GOFIPS140=latest GODEBUG=fips140=only go test ${GO_TEST_FLAG} -tags=$(GOBUILDTAGS) -v -race -coverprofile=build/coverage-${OS_NAME}.out ./... | tee build/test-unit-fips-${OS_NAME}.out

.PHONY: benchmark
benchmark: prepare-test-context install-benchstat ## - Run benchmark tests only
Expand Down
Loading