diff --git a/Makefile b/Makefile index 7867c9cc7..49c4e80dd 100644 --- a/Makefile +++ b/Makefile @@ -65,3 +65,6 @@ unittest: CGO_ENABLED=$(CGO_ENABLED) $(GO) \ test --run UnitTest -v +functest: + CGO_ENABLED=$(CGO_ENABLED) $(GO) test -test.v --run FunctionalTest --cover + diff --git a/charts/go-demo-6/Makefile b/charts/go-demo-6/Makefile index 065274768..77af017d8 100755 --- a/charts/go-demo-6/Makefile +++ b/charts/go-demo-6/Makefile @@ -36,7 +36,7 @@ ifeq ($(OS),Darwin) sed -i "" -e "s/tag:.*/tag: $(VERSION)/" values.yaml else ifeq ($(OS),Linux) sed -i -e "s/version:.*/version: $(VERSION)/" Chart.yaml - sed -i -e "s|repository:.*|repository: $(DOCKER_REGISTRY)\/devops-26\/$(NAME)|" values.yaml + sed -i -e "s|repository:.*|repository: $(DOCKER_REGISTRY)\/vfarcic\/$(NAME)|" values.yaml sed -i -e "s/tag:.*/tag: $(VERSION)/" values.yaml else echo "platfrom $(OS) not supported to tag with" diff --git a/charts/go-demo-6/values.yaml b/charts/go-demo-6/values.yaml index eb3ae73de..f57374064 100755 --- a/charts/go-demo-6/values.yaml +++ b/charts/go-demo-6/values.yaml @@ -1,7 +1,7 @@ # Default values for Go projects. # This is a YAML-formatted file. # Declare variables to be passed into your templates. -replicaCount: 1 +replicaCount: 3 image: repository: draft tag: dev diff --git a/charts/preview/Makefile b/charts/preview/Makefile index 7663503a3..c8d4e60cd 100755 --- a/charts/preview/Makefile +++ b/charts/preview/Makefile @@ -8,7 +8,7 @@ ifeq ($(OS),Darwin) else ifeq ($(OS),Linux) sed -i -e "s/version:.*/version: $(PREVIEW_VERSION)/" Chart.yaml sed -i -e "s/version:.*/version: $(PREVIEW_VERSION)/" ../*/Chart.yaml - sed -i -e "s|repository:.*|repository: $(DOCKER_REGISTRY)\/devops-26\/go-demo-6|" values.yaml + sed -i -e "s|repository:.*|repository: $(DOCKER_REGISTRY)\/vfarcic\/go-demo-6|" values.yaml sed -i -e "s/tag:.*/tag: $(PREVIEW_VERSION)/" values.yaml else echo "platfrom $(OS) not supported to release from" diff --git a/functional_test.go b/functional_test.go index 2db2a18da..9b55736a0 100644 --- a/functional_test.go +++ b/functional_test.go @@ -31,7 +31,7 @@ func (s *FunctionalTestSuite) SetupTest() { // Functional func (s FunctionalTestSuite) Test_Hello_ReturnsStatus200() { - address := fmt.Sprintf("http://%s%s/hello", s.hostIp, s.servicePath) + address := fmt.Sprintf("%s%s/hello", s.hostIp, s.servicePath) logPrintf("Sending a request to %s\n", address) resp, err := http.Get(address) @@ -40,7 +40,7 @@ func (s FunctionalTestSuite) Test_Hello_ReturnsStatus200() { } func (s FunctionalTestSuite) Test_Person_ReturnsStatus200() { - address := fmt.Sprintf("http://%s%s/person", s.hostIp, s.servicePath) + address := fmt.Sprintf("%s%s/person", s.hostIp, s.servicePath) logPrintf("Sending a request to %s\n", address) resp, err := http.Get(address) diff --git a/jenkins-x.yml b/jenkins-x.yml index a121a198e..8826062b7 100755 --- a/jenkins-x.yml +++ b/jenkins-x.yml @@ -1 +1,7 @@ buildPack: go +pipelineConfig: + pipelines: + pullRequest: + build: + preSteps: + - command: make unittest diff --git a/production_test.go b/production_test.go index e0624ce8d..c655e84a5 100644 --- a/production_test.go +++ b/production_test.go @@ -34,7 +34,7 @@ func (s ProductionTestSuite) Test_Hello_ReturnsStatus200() { minutes := float64(0) counter := 0 for time.Since(start).Minutes() < max { - address := fmt.Sprintf("http://%s/demo/hello", s.hostIp) + address := fmt.Sprintf("%s/demo/hello", s.hostIp) resp, err := http.Get(address) counter++ if err != nil { @@ -57,7 +57,7 @@ func (s ProductionTestSuite) Test_Hello_ReturnsStatus200() { time.Sleep(1 * time.Second) } } else { - address := fmt.Sprintf("http://%s/demo/hello", s.hostIp) + address := fmt.Sprintf("%s/demo/hello", s.hostIp) resp, err := http.Get(address) if err != nil { diff --git a/skaffold.yaml b/skaffold.yaml index 7eaa482fe..83c8be6df 100644 --- a/skaffold.yaml +++ b/skaffold.yaml @@ -2,7 +2,7 @@ apiVersion: skaffold/v1beta2 kind: Config build: artifacts: - - image: devops-26/go-demo-6 + - image: vfarcic/go-demo-6 context: . docker: {} tagPolicy: