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

Revert "Skip LoadBalancer Test" #282

Merged
merged 1 commit into from
Oct 31, 2018
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
28 changes: 14 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ GOVERSION := 1.10.0-alpine
PULSAR := $(GOBUILDDIR)/bin/pulsar$(shell go env GOEXE)
GOASSETSBUILDER := $(GOBUILDDIR)/bin/go-assets-builder$(shell go env GOEXE)

DOCKERFILE := Dockerfile
DOCKERFILE := Dockerfile
DOCKERTESTFILE := Dockerfile.test
DOCKERDURATIONTESTFILE := tests/duration/Dockerfile

ifndef LOCALONLY
ifndef LOCALONLY
PUSHIMAGES := 1
IMAGESHA256 := true
else
IMAGESHA256 := false
endif

ifdef IMAGETAG
ifdef IMAGETAG
IMAGESUFFIX := :$(IMAGETAG)
else
else
IMAGESUFFIX := :dev
endif

Expand Down Expand Up @@ -84,8 +84,8 @@ TESTBINNAME := $(PROJECT)_test
TESTBIN := $(BINDIR)/$(TESTBINNAME)
DURATIONTESTBINNAME := $(PROJECT)_duration_test
DURATIONTESTBIN := $(BINDIR)/$(DURATIONTESTBINNAME)
RELEASE := $(GOBUILDDIR)/bin/release
GHRELEASE := $(GOBUILDDIR)/bin/github-release
RELEASE := $(GOBUILDDIR)/bin/release
GHRELEASE := $(GOBUILDDIR)/bin/github-release

TESTLENGTHOPTIONS := -test.short
TESTTIMEOUT := 20m
Expand All @@ -94,7 +94,7 @@ ifeq ($(LONG), 1)
TESTTIMEOUT := 180m
endif
ifdef VERBOSE
TESTVERBOSEOPTIONS := -v
TESTVERBOSEOPTIONS := -v
endif

SOURCES := $(shell find $(SRCDIR) -name '*.go' -not -path './test/*')
Expand Down Expand Up @@ -176,7 +176,7 @@ update-vendor:
# Manually restore arangosync vendor with: git checkout deps/github.com/arangodb/arangosync

.PHONY: update-generated
update-generated: $(GOBUILDDIR)
update-generated: $(GOBUILDDIR)
@docker build $(SRCDIR)/tools/codegen --build-arg GOVERSION=$(GOVERSION) -t k8s-codegen
docker run \
--rm \
Expand Down Expand Up @@ -232,7 +232,7 @@ ifdef PUSHIMAGES
docker push $(OPERATORIMAGE)
endif

# Manifests
# Manifests

.PHONY: manifests
manifests: $(GOBUILDDIR)
Expand Down Expand Up @@ -268,7 +268,7 @@ run-unit-tests: $(GOBUILDDIR) $(SOURCES)
$(REPOPATH)/pkg/util/k8sutil \
$(REPOPATH)/pkg/util/k8sutil/test \
$(REPOPATH)/pkg/util/probe \
$(REPOPATH)/pkg/util/validation
$(REPOPATH)/pkg/util/validation

$(TESTBIN): $(GOBUILDDIR) $(SOURCES)
@mkdir -p $(BINDIR)
Expand Down Expand Up @@ -376,20 +376,20 @@ $(RELEASE): $(GOBUILDDIR) $(SOURCES) $(GHRELEASE)
.PHONY: build-ghrelease
build-ghrelease: $(GHRELEASE)

$(GHRELEASE): $(GOBUILDDIR)
$(GHRELEASE): $(GOBUILDDIR)
GOPATH=$(GOBUILDDIR) go build -o $(GHRELEASE) github.com/aktau/github-release

.PHONY: release-patch
release-patch: $(RELEASE)
GOPATH=$(GOBUILDDIR) $(RELEASE) -type=patch
GOPATH=$(GOBUILDDIR) $(RELEASE) -type=patch

.PHONY: release-minor
release-minor: $(RELEASE)
GOPATH=$(GOBUILDDIR) $(RELEASE) -type=minor

.PHONY: release-major
release-major: $(RELEASE)
GOPATH=$(GOBUILDDIR) $(RELEASE) -type=major
GOPATH=$(GOBUILDDIR) $(RELEASE) -type=major

## Kubernetes utilities

Expand All @@ -410,4 +410,4 @@ redeploy-operator: delete-operator manifests
kubectl apply -f $(MANIFESTPATHDEPLOYMENT)
kubectl apply -f $(MANIFESTPATHDEPLOYMENTREPLICATION)
kubectl apply -f $(MANIFESTPATHTEST)
kubectl get pods
kubectl get pods
3 changes: 0 additions & 3 deletions tests/load_balancer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ func loadBalancingCursorSubtest(t *testing.T, useVst bool) {
t.Fatalf("Deployment not running in time: %v", err)
}

// check if the deployment got a load balancer, otherwise skip this test
isEaLoadBalancerOrSkip(depl.GetName(), t)

// Create a database client
ctx := context.Background()
clOpts := &DatabaseClientOptions{
Expand Down
15 changes: 0 additions & 15 deletions tests/test_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,21 +155,6 @@ func getEnterpriseImageOrSkip(t *testing.T) string {
return image
}

// isEaLoadBalancerOrSkip checks it the deployment
func isEaLoadBalancerOrSkip(deploymentName string, t *testing.T) {
kubecli := mustNewKubeClient(t)
ns := getNamespace(t)
eaServiceName := k8sutil.CreateDatabaseExternalAccessServiceName(deploymentName)
svcs := k8sutil.NewServiceCache(kubecli.CoreV1().Services(ns))
if existing, err := svcs.Get(eaServiceName, metav1.GetOptions{}); err == nil {
if existing.Spec.Type == v1.ServiceTypeLoadBalancer {
return
}
}

t.Skip("No load balancer deployed")
}

// shouldCleanDeployments returns true when deployments created
// by tests should be removed, even when the test fails.
func shouldCleanDeployments() bool {
Expand Down