diff --git a/Jenkinsfile b/Jenkinsfile index 63a8738..6898983 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -21,6 +21,7 @@ pipeline { container('go') { dir('/home/jenkins/go/src/github.com/clementfrancon/mulder') { checkout scm + sh "make test-unit" sh "make linux" sh "export VERSION=$PREVIEW_VERSION && skaffold build -f skaffold.yaml" sh "jx step post build --image $DOCKER_REGISTRY/$ORG/$APP_NAME:$PREVIEW_VERSION" @@ -30,7 +31,12 @@ pipeline { } dir('/home/jenkins/go/src/github.com/clementfrancon/mulder/charts/preview') { sh "make preview" - sh "jx preview --app $APP_NAME --dir ../.." + sh "jx preview --app $APP_NAME --namespace $PREVIEW_NAMESPACE --dir ../.." + sh "wget --server-response --output-document=/dev/null --timeout=60 --tries=10 --retry-connrefused http://mulder.$PREVIEW_NAMESPACE/" + + } + dir('/home/jenkins/go/src/github.com/clementfrancon/mulder') { + sh "make test-integration MULDER_ADDR=mulder.$PREVIEW_NAMESPACE" } } } diff --git a/Makefile b/Makefile index f5f6356..18b783f 100644 --- a/Makefile +++ b/Makefile @@ -59,4 +59,7 @@ lint: vendor | $(PKGS) $(GOLINT) # ❷ @cd $(BASE) && ret=0 && for pkg in $(PKGS); do \ test -z "$$($(GOLINT) $$pkg | tee /dev/stderr)" || ret=1 ; \ done ; exit $$ret - +test-unit: + $(GO) test -v . +test-integration: + $(GO) test -v ./tests -addr ${MULDER_ADDR}