Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control lightweight storage integration tests via build tags #3346

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
20 changes: 0 additions & 20 deletions .github/workflows/ci-memory-badger.yml

This file was deleted.

14 changes: 1 addition & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ clean:

.PHONY: test
test: go-gen
bash -c "set -e; set -o pipefail; $(GOTEST) ./... | $(COLORIZE)"
bash -c "set -e; set -o pipefail; $(GOTEST) -tags=badger_storage_integration,grpc_plugin_storage_integration ./... | $(COLORIZE)"
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved

.PHONY: all-in-one-integration-test
all-in-one-integration-test: go-gen
Expand All @@ -97,18 +97,6 @@ storage-integration-test: go-gen
go clean -testcache
bash -c "set -e; set -o pipefail; $(GOTEST) $(STORAGE_PKGS) | $(COLORIZE)"

.PHONY: mem-and-badger-storage-integration-test
mem-and-badger-storage-integration-test: badger-storage-integration-test grpc-plugin-storage-integration-test

.PHONY: badger-storage-integration-test
badger-storage-integration-test:
STORAGE=badger $(MAKE) storage-integration-test

.PHONY: grpc-plugin-storage-integration-test
grpc-plugin-storage-integration-test:
(cd examples/memstore-plugin/ && go build .)
STORAGE=grpc-plugin $(MAKE) storage-integration-test

.PHONY: index-cleaner-integration-test
index-cleaner-integration-test: docker-images-elastic
# Expire test results for storage integration tests since the environment might change
Expand Down
6 changes: 2 additions & 4 deletions plugin/storage/integration/badgerstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build badger_storage_integration
// +build badger_storage_integration

package integration

import (
"os"
"testing"

assert "github.com/stretchr/testify/require"
Expand Down Expand Up @@ -80,9 +81,6 @@ func (s *BadgerIntegrationStorage) refresh() error {
}

func TestBadgerStorage(t *testing.T) {
if os.Getenv("STORAGE") != "badger" {
t.Skip("Integration test against Badger skipped; set STORAGE env var to badger to run this")
}
s := &BadgerIntegrationStorage{}
assert.NoError(t, s.initialize())
s.IntegrationTestAll(t)
Expand Down
5 changes: 2 additions & 3 deletions plugin/storage/integration/grpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build grpc_plugin_storage_integration
// +build grpc_plugin_storage_integration

package integration

Expand Down Expand Up @@ -86,9 +88,6 @@ func (s *GRPCStorageIntegrationTestSuite) cleanUp() error {
}

func TestGRPCStorage(t *testing.T) {
if os.Getenv("STORAGE") != "grpc-plugin" {
t.Skip("Integration test against grpc skipped; set STORAGE env var to grpc-plugin to run this")
}
binaryPath := os.Getenv("PLUGIN_BINARY_PATH")
if binaryPath == "" {
t.Logf("PLUGIN_BINARY_PATH env var not set, using %s", defaultPluginBinaryPath)
Expand Down