Minor test cleanup
This commit is contained in:
parent
e67422a803
commit
cf342648cd
@ -23,8 +23,8 @@ install:
|
|||||||
- export PATH=$HOME/.local/bin:$PATH
|
- export PATH=$HOME/.local/bin:$PATH
|
||||||
- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
|
- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
|
||||||
- stack --version
|
- stack --version
|
||||||
- createuser -s --no-password test
|
- echo "CREATE USER esqutest WITH PASSWORD 'esqutest';" | sudo -u postgres psql
|
||||||
- createdb -O test test
|
- sudo -u postgres createdb -O esqutest esqutest
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- stack setup
|
- stack setup
|
||||||
|
|||||||
15
Makefile
15
Makefile
@ -12,5 +12,20 @@ ghci:
|
|||||||
test:
|
test:
|
||||||
stack test
|
stack test
|
||||||
|
|
||||||
|
test-postgresql:
|
||||||
|
stack test --flag esqueleto:postgresql
|
||||||
|
|
||||||
|
test-mysql:
|
||||||
|
stack test --flag esqueleto:mysql
|
||||||
|
|
||||||
test-ghci:
|
test-ghci:
|
||||||
stack ghci esqueleto:test:test
|
stack ghci esqueleto:test:test
|
||||||
|
|
||||||
|
# sudo -u postgres createuser -s - esqueleto-test
|
||||||
|
reset-pgsql:
|
||||||
|
-sudo -u postgres dropdb esqutest
|
||||||
|
-sudo -u postgres dropuser esqutest
|
||||||
|
echo "CREATE USER esqutest WITH PASSWORD 'esqutest';" | sudo -u postgres psql
|
||||||
|
sudo -u postgres createdb -O esqutest esqutest
|
||||||
|
|
||||||
|
.PHONY: build build-7.10 build-8.0 ghci test test-ghci
|
||||||
|
|||||||
@ -1528,13 +1528,13 @@ withConn :: RunDbMonad m => (SqlBackend -> R.ResourceT m a) -> m a
|
|||||||
withConn =
|
withConn =
|
||||||
R.runResourceT .
|
R.runResourceT .
|
||||||
#if defined(WITH_POSTGRESQL)
|
#if defined(WITH_POSTGRESQL)
|
||||||
withPostgresqlConn "host=localhost port=5432 user=test dbname=test"
|
withPostgresqlConn "host=localhost port=5432 user=esqutest password=esqutest dbname=esqutest"
|
||||||
#elif defined (WITH_MYSQL)
|
#elif defined (WITH_MYSQL)
|
||||||
withMySQLConn defaultConnectInfo
|
withMySQLConn defaultConnectInfo
|
||||||
{ connectHost = "localhost"
|
{ connectHost = "localhost"
|
||||||
, connectUser = "test"
|
, connectUser = "esqutest"
|
||||||
, connectPassword = "test"
|
, connectPassword = "esqutest"
|
||||||
, connectDatabase = "test"
|
, connectDatabase = "esqutest"
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
withSqliteConn ":memory:"
|
withSqliteConn ":memory:"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user