add ebean-test properties for various containers and adjusted documentation

This commit is contained in:
Roland Praml
2021-11-26 15:32:11 +01:00
parent 2581d82cff
commit f8253a1252
14 changed files with 74 additions and 136 deletions
@@ -0,0 +1,5 @@
ebean.test.platform=clickhouse
ebean.test.dbName=clickhouse
datasource.default=clickhouse
datasource.clickhouse.autocommit=true
@@ -0,0 +1,4 @@
ebean.test.platform=cockroach
ebean.test.dbName=unit
datasource.default=cockroach
@@ -0,0 +1,4 @@
ebean.test.platform=db2
ebean.test.dbName=unit
ebean.test.dbPassword=unit
datasource.default=db2-11
@@ -0,0 +1,3 @@
ebean.test.platform=h2
datasource.default=h2-local
ebean.test.dbName=test
@@ -0,0 +1,8 @@
# This starts an alternative mariadb version on port 7306
ebean.test.platform=mariadb
ebean.test.dbName=test_ebean
ebean.test.dbPassword=unit
ebean.test.mariadb.version=10.3
ebean.test.mariadb.containerName=ut_mariadb-10-3
ebean.test.sqlserver.port = 7306
datasource.default=mariadb-103
@@ -0,0 +1,5 @@
ebean.test.platform=mariadb
ebean.test.dbName=test_ebean
ebean.test.mariadb.version=10.6
ebean.test.mariadb.containerName=ut_mariadb-10-6
datasource.default=mariadb-106
@@ -0,0 +1,6 @@
# this starts a mysql instance on port 13306
ebean.test.platform=mysql
ebean.test.dbName=test_ebean
# note: do not conflict with mariadb port
ebean.test.sqlserver.port = 13306
datasource.default=mysql-docker
@@ -0,0 +1,3 @@
ebean.test.platform=nuodb
ebean.test.dbName=testdb
ebean.test.nuodb.version=latest
@@ -0,0 +1,3 @@
ebean.test.platform=oracle
ebean.test.dbName=oracle
datasource.default=oracle-docker
@@ -0,0 +1,3 @@
ebean.test.platform=postgres
datasource.default=postgres
ebean.test.dbName=unit
@@ -0,0 +1,4 @@
ebean.test.platform=sqlite
datasource.default=sqlite-local
ebean.test.dbName=test.sqlite
ebean.autoReadOnlyDataSource=false
@@ -0,0 +1,6 @@
ebean.test.platform=sqlserver
ebean.test.dbName=test_ebean
ebean.test.sqlserver.version=2019-latest
ebean.test.sqlserver.containerName=ut_sqlserver2019
datasource.default=sqlserver2019
ebean.sqlserver2019.databasePlatformName=sqlserver17
@@ -0,0 +1,7 @@
ebean.test.platform=sqlserver
ebean.test.dbName=test_ebean
ebean.test.sqlserver.version=2017-latest
ebean.test.sqlserver.containerName=ut_sqlserver2017
ebean.test.sqlserver.port=1434
datasource.default=sqlserver2017
ebean.sqlserver2017.databasePlatformName=sqlserver17
+13 -136
View File
@@ -24,145 +24,22 @@ your run configuration:
Platform Tests
==============
By default, the `h2` platform is used. To test a different platform, add
`-Ddatasource.default=xxx` to your maven command or JVM arguments.
'h2' platform
-------------
Reqires no setup
run: `mvn clean test`
Current status: PASS
Tests run: 1986, Failures: 0, Errors: 0, Skipped: 16
'pg' platform
-------------
Reqirements
- a locally installed PostgreSQL server with PostGis.
- Create a user "unit" with password "unit" and a database "unit"
- Give the user all permissions to that db
run: `mvn clean test -Ddatasource.default=pg`
Current status: PASS
Tests run: 2166, Failures: 0, Errors: 0, Skipped: 25
By default, the `h2` platform is used. To test a different platform, you can change the
`datasource.default` in the `ebean.properties` file.
Docker
------
Ebean 12 provides preconfigured docker containers now. To start a docker container,
you can use the starters in `src/test/java/main` or specify one of the starter
properties in the `testconfig` directory with `-Dprops.file=testconfig/ebean-XXX.properties`
'mysql' platform
-------------
Note: You will have to install docker on your system.
- For debian, you can use `apt install docker.io`
- For windows, install docker for windows https://docs.docker.com/desktop/windows/install/
Reqirements
- a locally installed MySQL server.
- Create a user "unit" with password "unit" and a database "unit"
- Give the user all permissions to that db
run: `mvn clean test -Ddatasource.default=mysql`
Current status: PASS
Tests run: 2166, Failures: 0, Errors: 0, Skipped: 33
'sqlserver' platform
--------------------
Reqires an installed sqlserver - e.g. https://hub.docker.com/r/microsoft/mssql-server-linux/
- Create a user "ebean" with password "ebean" and a database "ebean_unittest"
- Adjust the connection string and/or username in ebean.properties
run: `mvn clean test -Ddatasource.default=mssql`
Current status: PASS
Tests run: 2166, Failures: 0, Errors: 0, Skipped: 39
'oracle' platform
-----------------
Reqires a locally installed Oracle server.
- Create a user "unit" with password "unit" with all permissions
- The test wirtes directly to the "xe" SID - so do not use a productive server!
- As the Oracle JDBC driver is only available on an oracle repository,
you need a special maven setup as described [here](http://docs.oracle.com/middleware/1213/core/MAVEN/config_maven_repo.htm#MAVEN9010)
run: `mvn clean test -Ddatasource.default=ora -Poracle`
Current status: FAIL
Tests run: 1986, Failures: 17, Errors: 34, Skipped: 16
'db2' platform
--------------
Reqires a locally installed DB2 Express-C server.
- Create a user "unit" with password "unit" with all permissions
- Install the db2jcc4 driver (see pom.xml)
run: `mvn clean test -Ddatasource.default=db2 -Pdb2`
Current status: FAIL
Tests run: 2166, Failures: 29, Errors: 58, Skipped: 30
'sqlite' platform
-----------------
Reqires no setup
run: `mvn clean test -Ddatasource.default=sqlite`
Current status: FAIL
Tests run: 1986, Failures: 24, Errors: 86, Skipped: 16
After some time, the db locks up, every test takes 3 seconds and fails with
"the database file is locked"
'hsqldb' platform
-----------------
Reqires no setup
run: `mvn clean test -Ddatasource.default=hsqldb`
Current status: FAIL
Tests run: 1980, Failures: 3, Errors: 657, Skipped: 16
@Rob FYI
The problem is https://sourceforge.net/p/hsqldb/bugs/1364/
In `InsertHandler.getPstmt` the `meta.getIdentityDbColumns()` contains
'id' in lowercase. Changing that to uppercase gives me this result:
`Tests run: 1986, Failures: 2, Errors: 18, Skipped: 16`
(as quick hack I added temporary a toUpperCase to BindableIdScalar.getIdentityColumn)
'sqlanywhere' platform
----------------------
TODO: not yet tested
'hana' platform
--------------------
Requires an installed SAP HANA server - e.g. https://store.docker.com/images/sap-hana-express-edition
- Create a user `EBEAN_TEST` with password `Eb3an_test` in the tenant database `HXE`
- Adjust the connection string and/or username in `ebean.properties`
run: `mvn clean test -Ddatasource.default=hana`
Current status: PASS
Tests run: 2486, Failures: 0, Errors: 0, Skipped: 84
Maven
-----
Use the `-Dprops.file` parameter to start the test cases for a certain platform.