From b2c4128ac0d6e538dbd1a1d23ed364244c043d33 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 18 Jan 2022 21:36:33 -0800 Subject: [PATCH] build: Make sure to test packages with external tests (backport #7608) (#7635) * build: Make sure to test packages with external tests (#7608) The test filter was looking for "TestGoFiles", which does not include tests in a separate package (e.g., "package foo_test" for "package foo"). This caused several packages not to be tested in CI, including: github.com/tendermint/tendermint/abci/client github.com/tendermint/tendermint/crypto github.com/tendermint/tendermint/crypto/tmhash github.com/tendermint/tendermint/internal/eventbus github.com/tendermint/tendermint/internal/evidence github.com/tendermint/tendermint/internal/inspect github.com/tendermint/tendermint/internal/jsontypes github.com/tendermint/tendermint/internal/libs/protoio github.com/tendermint/tendermint/internal/libs/sync github.com/tendermint/tendermint/internal/p2p/pex github.com/tendermint/tendermint/internal/pubsub github.com/tendermint/tendermint/internal/pubsub/query github.com/tendermint/tendermint/internal/pubsub/query/syntax github.com/tendermint/tendermint/internal/state/indexer github.com/tendermint/tendermint/internal/state/indexer/block/kv github.com/tendermint/tendermint/libs/json github.com/tendermint/tendermint/libs/log github.com/tendermint/tendermint/libs/os github.com/tendermint/tendermint/light github.com/tendermint/tendermint/light/provider/http github.com/tendermint/tendermint/privval/grpc github.com/tendermint/tendermint/proto/tendermint/blocksync github.com/tendermint/tendermint/proto/tendermint/consensus github.com/tendermint/tendermint/proto/tendermint/statesync github.com/tendermint/tendermint/rpc/client github.com/tendermint/tendermint/rpc/client/mock github.com/tendermint/tendermint/test/e2e/tests github.com/tendermint/tendermint/test/fuzz/mempool github.com/tendermint/tendermint/test/fuzz/p2p/secretconnection github.com/tendermint/tendermint/test/fuzz/rpc/jsonrpc/server Updates #7626 and #7634. (cherry picked from commit aea428d322a557c1618e2a39882c683684c2ebb4) * Fix build tags to satisfy Go 1.16. Co-authored-by: M. J. Fromberger --- Makefile | 6 ++++-- internal/p2p/pex/reactor_test.go | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1176ea844..64a50669c 100644 --- a/Makefile +++ b/Makefile @@ -318,9 +318,11 @@ NUM_SPLIT ?= 4 $(BUILDDIR): mkdir -p $@ -# the format statement filters out all packages that don't have tests. +# The format statement filters out all packages that don't have tests. +# Note we need to check for both in-package tests (.TestGoFiles) and +# out-of-package tests (.XTestGoFiles). $(BUILDDIR)/packages.txt:$(GO_TEST_FILES) $(BUILDDIR) - go list -f "{{ if .TestGoFiles }}{{ .ImportPath }}{{ end }}" ./... | sort > $@ + go list -f "{{ if (or .TestGoFiles .XTestGoFiles) }}{{ .ImportPath }}{{ end }}" ./... | sort > $@ split-test-packages:$(BUILDDIR)/packages.txt split -d -n l/$(NUM_SPLIT) $< $<. diff --git a/internal/p2p/pex/reactor_test.go b/internal/p2p/pex/reactor_test.go index 63e479e6a..cb1cf117d 100644 --- a/internal/p2p/pex/reactor_test.go +++ b/internal/p2p/pex/reactor_test.go @@ -1,3 +1,7 @@ +// Temporarily disabled pending ttps://github.com/tendermint/tendermint/issues/7626. +//go:build issue7626 +//+build issue7626 + package pex_test import (