Skip to content

Commit

Permalink
Merge pull request #4 from vfarcic/my-pr
Browse files Browse the repository at this point in the history
This is a PR
  • Loading branch information
vfarcic authored Jan 6, 2019
2 parents 630e1b1 + 44c1b9d commit 71cf7b0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pipeline {
container('go') {
dir('/home/jenkins/go/src/github.com/vfarcic/go-demo-6') {
checkout scm
sh "make unit-test"
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"
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,5 @@ lint: vendor | $(PKGS) $(GOLINT) # ❷
test -z "$$($(GOLINT) $$pkg | tee /dev/stderr)" || ret=1 ; \
done ; exit $$ret

unit-test:
CGO_ENABLED=$(CGO_ENABLED) $(GO) test $(PACKAGE_DIRS) -test.v --run UnitTest --cover
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func HelloServer(w http.ResponseWriter, req *http.Request) {
delayNum, _ := strconv.Atoi(delay)
sleep(time.Duration(delayNum) * time.Millisecond)
}
io.WriteString(w, "hello, world!\n")
io.WriteString(w, "hello, PR!\n")
}

func RandomErrorServer(w http.ResponseWriter, req *http.Request) {
Expand Down
2 changes: 1 addition & 1 deletion main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (s *MainTestSuite) Test_HelloServer_WritesHelloWorld() {

HelloServer(w, req)

w.AssertCalled(s.T(), "Write", []byte("hello, world!\n"))
w.AssertCalled(s.T(), "Write", []byte("hello, PR!\n"))
}

func (s *MainTestSuite) Test_HelloServer_Waits_WhenDelayIsPresent() {
Expand Down

0 comments on commit 71cf7b0

Please sign in to comment.