From e3cb1dc7c655d1fd8f1c60f7c40f93f45130e6bc Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Sun, 7 Jun 2026 07:03:26 +1000 Subject: [PATCH] Fixing build --- go_install_test.go | 6 ++++++ scripts/test.sh | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/go_install_test.go b/go_install_test.go index 0df50ecd..6e921bb6 100644 --- a/go_install_test.go +++ b/go_install_test.go @@ -1,3 +1,5 @@ +//go:build goinstall + package main import ( @@ -11,6 +13,10 @@ import ( // TestGoInstallCompatibility ensures the module can be zipped for go install. // This is an integration test that uses the same zip.CreateFromDir function // that go install uses internally. If this test fails, go install will fail. +// +// Built with the goinstall tag and run after the main test suite (see scripts/test.sh) +// so it does not race with pkg/yqlib tests that rewrite doc/*.md during execution. +// // See: https://github.com/mikefarah/yq/issues/2587 func TestGoInstallCompatibility(t *testing.T) { mod := module.Version{ diff --git a/scripts/test.sh b/scripts/test.sh index a18392cd..16a5a967 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -1,3 +1,7 @@ #!/bin/bash go test $(go list ./... | grep -v -E 'examples' | grep -v -E 'test') + +# Run after the main test suite: TestGoInstallCompatibility zips the module tree and +# must not run in parallel with pkg/yqlib tests that rewrite doc/*.md files. +go test -tags goinstall -run TestGoInstallCompatibility .