Skip to content

Commit 9f65d34

Browse files
split FIPS unit tests from fips140=only test (#4766)
split FIPS unit tests from fips140=only test
1 parent 77ee566 commit 9f65d34

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

.buildkite/pipeline.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,18 @@ steps:
9898
- build/*.xml
9999
- build/coverage*.out
100100

101+
- label: ":smartbear-testexecute: Run fips140=only unit tests"
102+
key: unit-test-fips140-only
103+
command: ".buildkite/scripts/unit_test.sh"
104+
env:
105+
FIPS: "true"
106+
GODEBUG: "fips140=only"
107+
agents:
108+
provider: "gcp"
109+
artifact_paths:
110+
- build/*.xml
111+
- build/coverage*.out
112+
101113
- label: ":smartbear-testexecute: Run unit tests: MacOS 13"
102114
key: unit-test-macos-13
103115
command: ".buildkite/scripts/unit_test.sh"

.buildkite/scripts/unit_test.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,4 @@ add_bin_path
99
with_go
1010

1111
echo "Starting the unit tests..."
12-
if [[ ${FIPS:-} == "true" ]]; then
13-
make test-unit-fips junit-report
14-
else
15-
make test-unit junit-report
16-
fi
12+
make test-unit junit-report

Makefile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,16 +221,13 @@ test: prepare-test-context ## - Run all tests
221221
test-release: ## - Check that all release binaries are created
222222
./.buildkite/scripts/test-release.sh $(DEFAULT_VERSION)
223223

224-
# If FIPS=true unit tests need microsoft/go + OpenSSL with FIPS
225224
.PHONY: test-unit
226225
test-unit: prepare-test-context ## - Run unit tests only
227-
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
226+
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
228227

229-
# FIPS unit tests are meant to use go v1.24 to check FIPS compliance.
230-
# This check is very strict, and should be thought of as a static-code analysis tool.
231-
.PHONY: test-unit-fips
232-
test-unit-fips: prepare-test-context ## - Run unit tests with go 1.24's fips140=only for testing
233-
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
228+
.PHONY: test-fips-provider-unit
229+
test-fips-provider-unit: prepare-test-context ## - Run unit tests with GOEXPERIMENT=systemcrypto to check that system FIPS provider works
230+
set -o pipefail; GOEXPERIMENT=systemcrypto CGO_ENABLED=1 go test ${GO_TEST_FLAG} -tags=$(GOBUILDTAGS) -v -race -coverprofile=build/coverage-${OS_NAME}.out ./... | tee build/test-unit-${OS_NAME}.out
234231

235232
.PHONY: benchmark
236233
benchmark: prepare-test-context ## - Run benchmark tests only

0 commit comments

Comments
 (0)