Skip to content

Commit bffbf30

Browse files
authored
Merge pull request #11 from hellofresh/patch/mongo-driver
Switched to official mongo driver
2 parents 164fd82 + 72495b0 commit bffbf30

31 files changed

+864
-211
lines changed

.travis.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,21 @@ services:
44
- docker
55

66
go:
7-
- "1.9"
8-
- "1.10"
97
- "1.11"
108
- "stable"
119

10+
env:
11+
- MAKE_TASK=test-unit
12+
- MAKE_TASK=test-integration
13+
14+
before_install:
15+
- docker-compose up -d
16+
1217
install:
13-
- go get -v -d
14-
- go get -u github.com/onsi/ginkgo/ginkgo
15-
- go get -u github.com/onsi/gomega
18+
- make deps
19+
20+
script:
21+
- make $MAKE_TASK
1622

17-
script: ginkgo -r
23+
after_script:
24+
- docker-compose down -v

Gopkg.lock

Lines changed: 255 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Gopkg.toml example
2+
#
3+
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
4+
# for detailed Gopkg.toml documentation.
5+
#
6+
# required = ["github.com/user/thing/cmd/thing"]
7+
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
8+
#
9+
# [[constraint]]
10+
# name = "github.com/user/project"
11+
# version = "1.0.0"
12+
#
13+
# [[constraint]]
14+
# name = "github.com/user/project2"
15+
# branch = "dev"
16+
# source = "github.com/myfork/project2"
17+
#
18+
# [[override]]
19+
# name = "github.com/x/y"
20+
# version = "2.4.0"
21+
#
22+
# [prune]
23+
# non-go = false
24+
# go-tests = true
25+
# unused-packages = true
26+
27+
28+
[[constraint]]
29+
name = "github.com/onsi/ginkgo"
30+
version = "1.7.0"
31+
32+
[[constraint]]
33+
name = "github.com/onsi/gomega"
34+
version = "1.4.3"
35+
36+
[[constraint]]
37+
branch = "master"
38+
name = "github.com/streadway/amqp"
39+
40+
[prune]
41+
go-tests = true
42+
unused-packages = true
43+
44+
[[constraint]]
45+
name = "github.com/gofrs/uuid"
46+
version = "3.2.0"
47+
48+
[[constraint]]
49+
name = "github.com/mongodb/mongo-go-driver"
50+
version = "0.2.0"

Makefile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
NO_COLOR=\033[0m
2+
OK_COLOR=\033[32;01m
3+
4+
PKG_SRC := github.com/hellofresh/goengine
5+
6+
deps:
7+
@echo "$(OK_COLOR)==> Installing dependencies$(NO_COLOR)"
8+
@go get -u github.com/golang/dep/cmd/dep
9+
@go get -u github.com/onsi/ginkgo/ginkgo
10+
@go get -u github.com/onsi/gomega
11+
@dep ensure -v -vendor-only
12+
13+
vet:
14+
@echo "$(OK_COLOR)==> checking code correctness with 'go vet' tool$(NO_COLOR)"
15+
@go vet ./...
16+
17+
lint: tools.golint
18+
@echo "$(OK_COLOR)==> checking code style with 'golint' tool$(NO_COLOR)"
19+
@go list ./... | xargs -n 1 golint -set_exit_status
20+
21+
test-integration: lint vet
22+
@echo "$(OK_COLOR)==> Running integration tests$(NO_COLOR)"
23+
@STORAGE_DSN=mongodb://localhost:27017/ BROKER_DSN=amqp://guest:guest@localhost:5672/ go run $(PKG_SRC)/cmd/goengine/...
24+
25+
test-unit: lint vet
26+
@echo "$(OK_COLOR)==> Running unit tests$(NO_COLOR)"
27+
@ginkgo -r
28+
29+
#---------------
30+
#-- tools
31+
#---------------
32+
33+
tools: tools.golint
34+
35+
tools.golint:
36+
@command -v golint >/dev/null ; if [ $$? -ne 0 ]; then \
37+
echo "--> installing golint"; \
38+
go get github.com/golang/lint/golint; \
39+
fi

0 commit comments

Comments
 (0)