Skip to content

Commit

Permalink
Merge pull request #434 from hellofresh/patch/rm-comply
Browse files Browse the repository at this point in the history
Delete .comply.yaml
  • Loading branch information
vgarvardt authored Mar 20, 2020
2 parents 85fea61 + 46ad4d0 commit 1858bba
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 86 deletions.
31 changes: 0 additions & 31 deletions .comply.yaml

This file was deleted.

5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ services:
- docker

go:
- 1.12
- "1.12"
- "1.13"
- "1.14"
- "stable"

env:
- MAKE_TASK=test
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ all: clean deps test build
deps:
@echo "$(OK_COLOR)==> Installing dependencies$(NO_COLOR)"
@go get -u golang.org/x/lint/golint
@go get -u github.com/DATA-DOG/godog/cmd/godog
@go get -u github.com/cucumber/godog/cmd/godog

build:
@echo "$(OK_COLOR)==> Building... $(NO_COLOR)"
@/bin/sh -c "JANUS_BUILD_ONLY_DEFAULT=$(JANUS_BUILD_ONLY_DEFAULT) PKG_SRC=$(PKG_SRC) VERSION=$(VERSION) ./build/build.sh"

test: lint format vet
@echo "$(OK_COLOR)==> Running tests$(NO_COLOR)"
@go test -v -cover ./...
@go test -cover ./...

test-integration: lint format vet
@echo "$(OK_COLOR)==> Running tests$(NO_COLOR)"
@go test -v -cover -tags=integration ./...
@go test -cover -tags=integration ./...

test-features:
@/bin/sh -c "JANUS_BUILD_ONLY_DEFAULT=1 PKG_SRC=$(PKG_SRC) ./build/build.sh"
Expand Down
2 changes: 1 addition & 1 deletion build/features.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export API_PORT=${API_PORT_PRIMARY}
# make sure app started
sleep 1

go test -godog -stop-on-failure
godog --format=pretty --random --stop-on-failure --strict
exit_code=$?

kill ${pid_janus}
Expand Down
5 changes: 3 additions & 2 deletions features/bootstrap/context_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package bootstrap
import (
"time"

"github.com/DATA-DOG/godog"
"github.com/hellofresh/janus/pkg/api"
"github.com/cucumber/godog"
"github.com/pkg/errors"

"github.com/hellofresh/janus/pkg/api"
)

// RegisterAPIContext registers godog suite context for handling API related steps
Expand Down
2 changes: 1 addition & 1 deletion features/bootstrap/context_misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package bootstrap
import (
"time"

"github.com/DATA-DOG/godog"
"github.com/cucumber/godog"
)

const durationAWhile = time.Second
Expand Down
11 changes: 6 additions & 5 deletions features/bootstrap/context_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ import (
"strings"
"time"

"github.com/DATA-DOG/godog"
"github.com/DATA-DOG/godog/gherkin"
jwtgo "github.com/dgrijalva/jwt-go"
"github.com/cucumber/godog"
"github.com/cucumber/godog/gherkin"
jwtGo "github.com/dgrijalva/jwt-go"
"github.com/tidwall/gjson"

"github.com/hellofresh/janus/pkg/config"
"github.com/hellofresh/janus/pkg/jwt"
"github.com/tidwall/gjson"
)

const (
Expand Down Expand Up @@ -233,7 +234,7 @@ func (c *requestContext) requestJWTTokenIsNotSet() error {

func (c *requestContext) requestJWTTokenIsValidAdminToken() error {
jwtConfig := jwt.NewGuard(c.adminCred)
accessToken, err := jwt.IssueAdminToken(jwtConfig.SigningMethod, jwtgo.MapClaims{}, jwtConfig.Timeout)
accessToken, err := jwt.IssueAdminToken(jwtConfig.SigningMethod, jwtGo.MapClaims{}, jwtConfig.Timeout)
if nil != err {
return fmt.Errorf("failed to issue JWT: %v", err)
}
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ go 1.12
require (
code.cloudfoundry.org/bytefmt v0.0.0-20180108190415-b31f603f5e1e
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/DATA-DOG/godog v0.7.13
github.com/DataDog/datadog-go v0.0.0-20180330214955-e67964b4021a // indirect
github.com/Knetic/govaluate v3.0.0+incompatible
github.com/afex/hystrix-go v0.0.0-20180406012432-f86abeeb9f72
github.com/asaskevich/govalidator v0.0.0-20171111151018-521b25f4b05f
github.com/bshuster-repo/logrus-logstash-hook v0.4.1 // indirect
github.com/cactus/go-statsd-client v3.1.1+incompatible // indirect
github.com/cucumber/godog v0.8.1
github.com/davecgh/go-spew v1.1.0 // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/felixge/httpsnoop v1.0.0
Expand Down Expand Up @@ -58,12 +58,12 @@ require (
github.com/tidwall/match v1.0.0 // indirect
github.com/ulule/limiter v2.2.2+incompatible
go.opencensus.io v0.18.0
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 // indirect
golang.org/x/net v0.0.0-20191003171128-d98b1b443823
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b
golang.org/x/oauth2 v0.0.0-20180118004544-b28fcf2b08a1
golang.org/x/sync v0.0.0-20190423024810-112230192c58 // indirect
golang.org/x/sys v0.0.0-20190825160603-fb81701db80f // indirect
golang.org/x/text v0.3.2 // indirect
golang.org/x/tools v0.0.0-20200319210407-521f4a0cd458 // indirect
google.golang.org/appengine v1.0.0 // indirect
gopkg.in/airbrake/gobrake.v2 v2.0.9 // indirect
gopkg.in/alexcesaro/statsd.v2 v2.0.0 // indirect
Expand Down
24 changes: 22 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ code.cloudfoundry.org/bytefmt v0.0.0-20180108190415-b31f603f5e1e h1:R3Kkucb2Lbd/
code.cloudfoundry.org/bytefmt v0.0.0-20180108190415-b31f603f5e1e/go.mod h1:wN/zk7mhREp/oviagqUXY3EwuHhWyOvAdsn5Y4CzOrc=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/DATA-DOG/godog v0.7.13 h1:JmgpKcra7Vf3yzI9vPsWyoQRx13tyKziHtXWDCUUgok=
github.com/DATA-DOG/godog v0.7.13/go.mod h1:z2OZ6a3X0/YAKVqLfVzYBwFt3j6uSt3Xrqa7XTtcQE0=
github.com/DataDog/datadog-go v0.0.0-20180330214955-e67964b4021a h1:zpQSzEApXM0qkXcpdjeJ4OpnBWhD/X8zT/iT1wYLiVU=
github.com/DataDog/datadog-go v0.0.0-20180330214955-e67964b4021a/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/Knetic/govaluate v3.0.0+incompatible h1:7o6+MAPhYTCF0+fdvoz1xDedhRb4f6s9Tn1Tt7/WTEg=
Expand All @@ -20,6 +18,8 @@ github.com/bshuster-repo/logrus-logstash-hook v0.4.1 h1:pgAtgj+A31JBVtEHu2uHuEx0
github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk=
github.com/cactus/go-statsd-client v3.1.1+incompatible h1:p97okCU2aaeSxQ6KzMdGEwQkiGBMys71/J0XWoirbJY=
github.com/cactus/go-statsd-client v3.1.1+incompatible/go.mod h1:cMRcwZDklk7hXp+Law83urTHUiHMzCev/r4JMYr/zU0=
github.com/cucumber/godog v0.8.1 h1:lVb+X41I4YDreE+ibZ50bdXmySxgRviYFgKY6Aw4XE8=
github.com/cucumber/godog v0.8.1/go.mod h1:vSh3r/lM+psC1BPXvdkSEuNjmXfpVqrMGYAElF6hxnA=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
Expand Down Expand Up @@ -136,24 +136,36 @@ github.com/tidwall/match v1.0.0 h1:Ym1EcFkp+UQ4ptxfWlW+iMdq5cPH5nEuGzdf/Pb7VmI=
github.com/tidwall/match v1.0.0/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E=
github.com/ulule/limiter v2.2.2+incompatible h1:1lk9jesmps1ziYHHb4doL7l5hFkYYYA3T8dkNyw7ffY=
github.com/ulule/limiter v2.2.2+incompatible/go.mod h1:VJx/ZNGmClQDS5F6EmsGqK8j3jz1qJYZ6D9+MdAD+kw=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
go.opencensus.io v0.10.0/go.mod h1:UffZAU+4sDEINUGP/B7UfBBkq4fqLu9zXAX7ke6CHW0=
go.opencensus.io v0.18.0 h1:Mk5rgZcggtbvtAun5aJzAtjKKN/t0R3jJPlWILlv938=
go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 h1:7KByu05hhLed2MO29w7p1XfZvZ13m8mub3shuVftRs0=
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191003171128-d98b1b443823 h1:Ypyv6BNJh07T1pUSrehkLemqPKXhus2MkfktJ91kRh4=
golang.org/x/net v0.0.0-20191003171128-d98b1b443823/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/oauth2 v0.0.0-20180118004544-b28fcf2b08a1 h1:gRThnsUxGd2h5EB2AOiqLcAxfMF3Y2LQCeru8REL+p0=
golang.org/x/oauth2 v0.0.0-20180118004544-b28fcf2b08a1/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e h1:o3PsSEY8E4eXWkXrIP9YJALUkVZqzHJT5DOasTyn8Vs=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand All @@ -167,6 +179,14 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7 h1:EBZoQjiKKPaLbPrbpssUfuHtwM6KV/vb4U85g/cigFY=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200319210407-521f4a0cd458 h1:DgonIcqC7u+gVZX7lpuReBil5B/i8fvW/hAQdhT6/ao=
golang.org/x/tools v0.0.0-20200319210407-521f4a0cd458/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf h1:rjxqQmxjyqerRKEj+tZW+MCm4LgpFXu18bsEoCMgDsk=
google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/appengine v1.0.0 h1:dN4LljjBKVChsv0XCSI+zbyzdqrkEwX5LQFUMRSGqOc=
Expand Down
43 changes: 7 additions & 36 deletions godog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,19 @@ package main

import (
"context"
"flag"
"net/url"
"os"
"strconv"
"testing"
"time"

"github.com/DATA-DOG/godog"
"github.com/cucumber/godog"
"github.com/stretchr/testify/assert"

"github.com/hellofresh/janus/features/bootstrap"
"github.com/hellofresh/janus/pkg/api"
"github.com/hellofresh/janus/pkg/config"
"github.com/stretchr/testify/assert"
)

var (
runGoDogTests bool
stopOnFailure bool
)

func init() {
flag.BoolVar(&runGoDogTests, "godog", false, "Set this flag is you want to run godog BDD tests")
flag.BoolVar(&stopOnFailure, "stop-on-failure", false, "Stop processing on first failed scenario.. Flag is passed to godog")
flag.Parse()
}

func FeatureContext(s *godog.Suite) {
c, err := config.LoadEnv()
if nil != err {
Expand All @@ -36,6 +24,10 @@ func FeatureContext(s *godog.Suite) {
var apiRepo api.Repository

dsnURL, err := url.Parse(c.Database.DSN)
if nil != err {
panic(err)
}

switch dsnURL.Scheme {
case "mongodb":
apiRepo, err = api.NewMongoAppRepository(c.Database.DSN, c.BackendFlushInterval)
Expand Down Expand Up @@ -76,24 +68,3 @@ func FeatureContext(s *godog.Suite) {
func Test_Fake(t *testing.T) {
assert.True(t, true)
}

func TestMain(m *testing.M) {
if !runGoDogTests {
os.Exit(m.Run())
}

status := godog.RunWithOptions("Janus", func(s *godog.Suite) {
FeatureContext(s)
}, godog.Options{
Format: "pretty",
Paths: []string{"features"},
Randomize: time.Now().UTC().UnixNano(),
StopOnFailure: stopOnFailure,
})

if st := m.Run(); st > status {
status = st
}

os.Exit(status)
}

0 comments on commit 1858bba

Please sign in to comment.