Fixing build

This commit is contained in:
Mike Farah 2026-06-07 07:03:26 +10:00
parent 1b9b4ac518
commit e3cb1dc7c6
2 changed files with 10 additions and 0 deletions

View File

@ -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{

View File

@ -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 .