Skip to content
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
6 changes: 6 additions & 0 deletions build/github/unit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,14 @@ if [ -n "${BASE_SHA:-}" ]; then
fi
fi

# Note: --remote_download_minimal is intentionally present despite the warning
# from bazel about conflict with --remote_download_toplevel (from
# --config=engflowpublic via engflow-args.sh). Bazel gives explicit command-line
# flags precedence over config expansions, so 'minimal' is in effect. The warning
# can be ignored.
bazel test $TEST_TARGETS //pkg/ui:lint //pkg/ui:test \
--config crosslinux --jobs 200 --remote_download_minimal \
Comment thread
tbg marked this conversation as resolved.
--bes_keywords ci-unit-test --config=use_ci_timeouts \
--build_event_binary_file=bes.bin $(./build/github/engflow-args.sh) \
--test_output=summary --test_summary=terse --noshow_progress \
$EXTRA_PARAMS
14 changes: 14 additions & 0 deletions pkg/util/metamorphic/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"os"
"strconv"
"strings"
"testing"

"github.com/cockroachdb/cockroach/pkg/build/bazel"
"github.com/cockroachdb/cockroach/pkg/util/buildutil"
Expand Down Expand Up @@ -232,6 +233,19 @@ func metamorphicEligible() bool {
return false
}

// Skip when the binary is not a Go test binary. The `crdb_test` build tag
// is inherited by non-test binaries built from packages that transitively
// import this one — most notably the gomock reflect helpers that rules_go
// links and executes at build time to generate mock sources. Those
// processes have no reason to randomize constants, and their stderr is
// captured into bazel's stdout, producing many "INFO: From
// GoMockReflectExecOnlyGen ..." blocks of metamorphic preamble in CI
// logs. testing.Testing() is set by a linker-injected var in `go test`
// binaries and is safe to read from init().
if !testing.Testing() {
return false
}

return true
}

Expand Down
Loading