use xenial on travis CI for systemd required by minikube

parent cc48490c
dist: xenial
language: go
sudo: required
addons:
......
......@@ -6,9 +6,11 @@ curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.12
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.35.0/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
sudo minikube start --vm-driver=none --kubernetes-version=$KUBERNETES_VERSION
# Fix the kubectl context, as it's often stale.
minikube update-context
sudo minikube update-context
sudo chown -R $(id -un):$(id -gn) /home/travis/.minikube
# Wait for Kubernetes to be up and ready.
JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1; done
JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do echo 'node not ready yet'; kubectl describe nodes; sleep 10; done
make build
kubectl create namespace nginx-operator-integration
......
......@@ -7,6 +7,7 @@ import (
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/tsuru/nginx-operator/pkg/apis/nginx/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
......@@ -36,8 +37,8 @@ func Test_Operator(t *testing.T) {
}
nginx, err := getReadyNginx("simple", 2, 1)
assert.Nil(t, err)
assert.NotNil(t, nginx)
require.NoError(t, err)
require.NotNil(t, nginx)
assert.Equal(t, 2, len(nginx.Status.Pods))
assert.Equal(t, 1, len(nginx.Status.Services))
})
......@@ -56,7 +57,7 @@ func getReadyNginx(name string, expectedPods int, expectedSvcs int) (*v1alpha1.N
}
select {
case <-timeout:
return nil, fmt.Errorf("Timeout waiting for nginx status. Last status: %v. Last error: %v", nginx.Status, err)
return nil, fmt.Errorf("Timeout waiting for nginx status. Last nginx object: %#v. Last error: %v", nginx, err)
case <-time.After(time.Millisecond * 100):
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment