From 70efe9f721d70f57eba8896ffd3939723e0f0b4a Mon Sep 17 00:00:00 2001 From: Roland Shoemaker Date: Wed, 1 Mar 2023 11:50:10 -0800 Subject: [PATCH] crypto/x509: make TestIssue51759 builder only Since we can't gate tests on the macOS version on normal machines, restrict TestIssue51759 to only run on builders, where we have a way to do this. Change-Id: I70fc83c587689b499b6a38864973a77bb3e52596 Reviewed-on: https://go-review.googlesource.com/c/go/+/472619 TryBot-Result: Gopher Robot Reviewed-by: Bryan Mills Run-TryBot: Roland Shoemaker Reviewed-by: Dmitri Shuralyov --- src/crypto/x509/verify_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/crypto/x509/verify_test.go b/src/crypto/x509/verify_test.go index 22312ef910..164c47fd6d 100644 --- a/src/crypto/x509/verify_test.go +++ b/src/crypto/x509/verify_test.go @@ -1860,7 +1860,11 @@ func TestIssue51759(t *testing.T) { if runtime.GOOS != "darwin" { t.Skip("only affects darwin") } - if builder := testenv.Builder(); builder == "darwin-amd64-10_14" || builder == "darwin-amd64-10_15" { + builder := testenv.Builder() + if builder == "" { + t.Skip("only run this test on the builders, as we have no reasonable way to gate tests on macOS versions elsewhere") + } + if builder == "darwin-amd64-10_14" || builder == "darwin-amd64-10_15" { t.Skip("behavior only enforced in macOS 11 and after") } // badCertData contains a cert that we parse as valid