Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e: Improve e2e test pipeline #1180

Merged
merged 4 commits into from
Nov 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 35 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
environment:
- TEST_DATABASE_POSTGRESQL=postgres://test:test@localhost:5432/hydra?sslmode=disable
- TEST_DATABASE_MYSQL=root:test@(localhost:3306)/mysql?parseTime=true
- image: postgres:9.5
- image: postgres:9.6
environment:
- POSTGRES_USER=test
- POSTGRES_PASSWORD=test
Expand All @@ -50,12 +50,11 @@ jobs:
echo 'export GO111MODULE=on' >> $BASH_ENV
source $BASH_ENV
- checkout
- run: go mod verify
- run: go mod download
- run: go get -u github.com/mattn/goveralls golang.org/x/tools/cmd/cover github.com/ory/go-acc
- run: go install github.com/ory/hydra
- run: go install github.com/ory/hydra/test/mock-lcp
- run: go-acc -o coverage.txt ./... -- -failfast -v -timeout=20m
- run: go test -race -short $(go list ./... | grep -v cmd)
- run: go-acc -o coverage.txt ./... -- -failfast -timeout=20m
# Running race conditions requires parallel tests, otherwise it's worthless (which is the case)
# - run: go test -race -short $(go list ./... | grep -v cmd)
- run: test -z "$CIRCLE_PR_NUMBER" && goveralls -service=circle-ci -coverprofile=coverage.txt -repotoken=$COVERALLS_REPO_TOKEN || echo "forks are not allowed to push to coveralls"

test-e2e-opaque:
Expand All @@ -81,15 +80,28 @@ jobs:
source $BASH_ENV
- checkout
- run: go mod verify
- run: go get -u github.com/mattn/goveralls golang.org/x/tools/cmd/cover github.com/ory/go-acc
- run: go install github.com/ory/hydra
- run: go install github.com/ory/hydra/test/mock-lcp
- run: hydra migrate sql $DATABASE_URL_POSTGRES
- run: hydra migrate sql $DATABASE_URL_MYSQL
- run: DATABASE_URL=$DATABASE_URL_POSTGRES ./scripts/test-e2e-opaque.sh
- run: DATABASE_URL=$DATABASE_URL_MYSQL ./scripts/test-e2e-opaque.sh
- run: DATABASE_URL=memory ./scripts/test-e2e-opaque.sh
- run: DATABASE_URL=memory ./scripts/test-e2e-opaque.sh
- run: DATABASE_URL=$DATABASE_URL_POSTGRES ./scripts/test-e2e.sh
- run: DATABASE_URL=$DATABASE_URL_MYSQL ./scripts/test-e2e.sh
# See https://github.com/ory/hydra/issues/1179
# - run: DATABASE_URL=memory ./scripts/test-e2e.sh

test-e2e-plugin:
docker:
- image: circleci/golang:1.11
working_directory: /go/src/github.com/ory/hydra
steps:
- run:
name: Enable go1.11 modules
command: |
echo 'export GO111MODULE=on' >> $BASH_ENV
source $BASH_ENV
- checkout
- run: go mod verify
- run: go install github.com/ory/hydra
- run: OAUTH2_ACCESS_TOKEN_STRATEGY=jwt ./scripts/test-e2e-plugin.sh
- run: ./scripts/test-e2e-plugin.sh

test-e2e-jwt:
Expand All @@ -115,16 +127,13 @@ jobs:
source $BASH_ENV
- checkout
- run: go mod verify
- run: go get -u github.com/mattn/goveralls golang.org/x/tools/cmd/cover github.com/ory/go-acc
- run: go install github.com/ory/hydra
- run: go install github.com/ory/hydra/test/mock-lcp
- run: hydra migrate sql $DATABASE_URL_POSTGRES
- run: hydra migrate sql $DATABASE_URL_MYSQL
- run: DATABASE_URL=$DATABASE_URL_POSTGRES ./scripts/test-e2e-jwt.sh
- run: DATABASE_URL=$DATABASE_URL_MYSQL ./scripts/test-e2e-jwt.sh
- run: DATABASE_URL=memory ./scripts/test-e2e-opaque.sh
- run: DATABASE_URL=memory ./scripts/test-e2e-opaque.sh
- run: ./scripts/test-e2e-plugin.sh
- run: OAUTH2_ACCESS_TOKEN_STRATEGY=jwt DATABASE_URL=$DATABASE_URL_POSTGRES ./scripts/test-e2e.sh
- run: OAUTH2_ACCESS_TOKEN_STRATEGY=jwt DATABASE_URL=$DATABASE_URL_MYSQL ./scripts/test-e2e.sh
# See https://github.com/ory/hydra/issues/1179
# - run: OAUTH2_ACCESS_TOKEN_STRATEGY=jwt DATABASE_URL=memory ./scripts/test-e2e.sh

# This test is really useless because there are always changes (usually timestamps in the generated code)
# generators:
Expand Down Expand Up @@ -285,6 +294,12 @@ workflows:
filters:
tags:
only: /.*/
- test-e2e-plugin:
requires:
- test
filters:
tags:
only: /.*/
- release-docs:
filters:
branches:
Expand All @@ -306,6 +321,7 @@ workflows:
# - generators
- format
- test-e2e-opaque
- test-e2e-plugin
- test-e2e-jwt
filters:
tags:
Expand Down
58 changes: 29 additions & 29 deletions client/sql_migration_files.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions consent/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,15 @@ import (
"testing"
"time"

"github.com/stretchr/testify/require"

"github.com/ory/hydra/pkg"

_ "github.com/go-sql-driver/mysql"
_ "github.com/lib/pq"
"github.com/stretchr/testify/require"

"github.com/ory/fosite"
"github.com/ory/hydra/client"
. "github.com/ory/hydra/consent"
"github.com/ory/hydra/oauth2"
"github.com/ory/hydra/pkg"
"github.com/ory/x/sqlcon/dockertest"
)

Expand Down
Loading