Skip to content

Commit

Permalink
Issue #1516 #1516
Browse files Browse the repository at this point in the history
* introduction of build tags [grpc_plugin_storage_integration, badger_storage_integration] for better control over badgerstore_test.go and grpc_test.go  which being fairly light-weight can be run along with the main make target `test`
  • Loading branch information
rbroggi committed Oct 28, 2021
1 parent e9bf6ed commit 7af3a5c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 40 deletions.
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)"

.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
2 changes: 2 additions & 0 deletions examples/memstore-plugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,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 main

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

0 comments on commit 7af3a5c

Please sign in to comment.