Skip to content

Commit

Permalink
test: replace e2e-memory with unit test
Browse files Browse the repository at this point in the history
Closes #580
  • Loading branch information
aeneasr committed Jul 27, 2020
1 parent aea1fb8 commit 52bd839
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
21 changes: 10 additions & 11 deletions .circleci/config.yml
Expand Up @@ -133,30 +133,34 @@ workflows:
- test-e2e:
name: test-e2e-sqlite
flavor: sqlite
filters:
tags:
only: /.*/
- test-e2e:
name: test-e2e-memory
flavor: memory
requires:
- test
- nancy/test
- gloangci/lint
filters:
tags:
only: /.*/
- test-e2e:
name: test-e2e-postgres
flavor: postgres
requires:
- test-e2e-postgres
filters:
tags:
only: /.*/
- test-e2e:
name: test-e2e-mysql
flavor: mysql
requires:
- test-e2e-mysql
filters:
tags:
only: /.*/
- test-e2e:
name: test-e2e-cockroach
flavor: cockroach
requires:
- test-e2e-cockroach
filters:
tags:
only: /.*/
Expand All @@ -170,7 +174,6 @@ workflows:
requires:
- test
- test-e2e-sqlite
- test-e2e-memory
- test-e2e-postgres
- test-e2e-mysql
- test-e2e-cockroach
Expand All @@ -184,7 +187,6 @@ workflows:
requires:
- test
- test-e2e-sqlite
- test-e2e-memory
- test-e2e-postgres
- test-e2e-mysql
- test-e2e-cockroach
Expand All @@ -198,7 +200,6 @@ workflows:
requires:
- test
- test-e2e-sqlite
- test-e2e-memory
- test-e2e-postgres
- test-e2e-mysql
- test-e2e-cockroach
Expand All @@ -214,7 +215,6 @@ workflows:
requires:
- test
- test-e2e-sqlite
- test-e2e-memory
- test-e2e-postgres
- test-e2e-mysql
- test-e2e-cockroach
Expand All @@ -235,7 +235,6 @@ workflows:
- goreleaser/test
- test
- test-e2e-sqlite
- test-e2e-memory
- test-e2e-postgres
- test-e2e-mysql
- test-e2e-cockroach
Expand Down
14 changes: 14 additions & 0 deletions driver/driver_default_test.go
@@ -1,10 +1,15 @@
package driver_test

import (
"context"
"fmt"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/ory/viper"
"github.com/ory/x/logrusx"

driver "github.com/ory/kratos/driver"
"github.com/ory/kratos/driver/configuration"
Expand All @@ -27,3 +32,12 @@ func TestDriverDefault_SQLiteMemoryMode(t *testing.T) {
}
})
}

func TestDriverNew(t *testing.T) {
viper.Set("dsn", "memory")
d, err := driver.NewDefaultDriver(logrusx.New("", ""),
"", "", "", true)
require.NoError(t, err)
assert.EqualValues(t, configuration.DefaultSQLiteMemoryDSN, d.Configuration().DSN())
require.NoError(t, d.Registry().Persister().Ping(context.Background()))
}
6 changes: 1 addition & 5 deletions test/e2e/run.sh
Expand Up @@ -112,7 +112,7 @@ run() {

yq merge test/e2e/profiles/kratos.base.yml "test/e2e/profiles/${profile}/.kratos.yml" > test/e2e/kratos.generated.yml
($kratos serve --dev -c test/e2e/kratos.generated.yml > "${base}/test/e2e/kratos.${profile}.e2e.log" 2>&1 &)

npm run wait-on -- -t 10000 http-get://127.0.0.1:4434/health/ready \
http-get://127.0.0.1:4455/health \
http-get://127.0.0.1:4445/health/ready \
Expand Down Expand Up @@ -189,10 +189,6 @@ case "$1" in
db="${TEST_DATABASE_SQLITE}"
;;

memory)
db="${TEST_DATABASE_MEMORY}"
;;

mysql)
db="${TEST_DATABASE_MYSQL}"
;;
Expand Down

0 comments on commit 52bd839

Please sign in to comment.