@@ -174,24 +174,30 @@ with, and then get an instance of the test database running on your
174
174
machine.
175
175
176
176
By default, the tests will be run against PostgreSQL. To test against
177
- MySQL, MariaDB, or Db2, you must explicitly specify ` -Pdb=mysql ` ,
178
- ` -Pdb=maria ` , or ` -Pdb=db2 ` , for example:
179
-
180
- ./gradlew test -Pdb=db2
181
-
182
- It's also possible to run all tests or only selected tests on
177
+ a different database, you must explicitly specify it using the property
178
+ ` -Pdb ` , as shown in the table below.
179
+
180
+ | Database | Command |
181
+ | ------------| ------------------------------|
182
+ | PostgreSQL | ` ./gradlew test -Pdb=pg ` |
183
+ | MySQL | ` ./gradlew test -Pdb=mysql ` |
184
+ | MariaDB | ` ./gradlew test -Pdb=maria ` |
185
+ | DB2 | ` ./gradlew test -Pdb=db2 ` |
186
+ | SQL Server | ` ./gradlew test -Pdb=mssql ` |
187
+ | Oracle | ` ./gradlew test -Pdb=oracle ` |
188
+
189
+ It's even possible to run all tests or certain selected tests on
183
190
all available databases:
184
191
185
192
./gradlew testAll -PincludeTests=DefaultPortTest
186
193
187
- the property ` includeTests ` represents the name of the test to run
188
- and can contain the wildcard '* '. The property is optional but
189
- running all tests on all databases might take a lot of time.
190
-
191
- You can also enable/disable logging standard output streams for your
192
- tests by adding the following property:
194
+ The property ` includeTests ` specifies the name of the test to run
195
+ and may contain the wildcard ` * ` . This property is optional, but
196
+ very useful, since running all tests on all databases might take
197
+ a lot of time.
193
198
194
- -PshowStandardOutput
199
+ To enable logging of the standard output streams, add the property
200
+ ` -PshowStandardOutput ` .
195
201
196
202
There are three ways to start the test database.
197
203
@@ -202,23 +208,18 @@ don't need to create the test databases manually. Just type:
202
208
203
209
./gradlew test -Pdocker
204
210
205
- The above command will start a PostgreSQL instance, which is the default target.
206
-
207
- Or:
208
-
209
- ./gradlew test -Pdocker -Pdb=mysql
210
-
211
- Or:
212
-
213
- ./gradlew test -Pdocker -Pdb=maria
214
-
215
- Or:
216
-
217
- ./gradlew test -Pdocker -Pdb=db2
218
-
219
- Or:
220
-
221
- ./gradlew test -Pdocker -Pdb=oracle
211
+ The above command will start an instance of PostgreSQL in a Docker
212
+ container. You may specify a different database using one of the
213
+ commands show in the table below.
214
+
215
+ | Database | Command |
216
+ | ------------| ---------------------------------------|
217
+ | PostgreSQL | ` ./gradlew test -Pdocker -Pdb=pg ` |
218
+ | MySQL | ` ./gradlew test -Pdocker -Pdb=mysql ` |
219
+ | MariaDB | ` ./gradlew test -Pdocker -Pdb=maria ` |
220
+ | DB2 | ` ./gradlew test -Pdocker -Pdb=db2 ` |
221
+ | SQL Server | ` ./gradlew test -Pdocker -Pdb=mssql ` |
222
+ | Oracle | ` ./gradlew test -Pdocker -Pdb=oracle ` |
222
223
223
224
The tests will run faster if you reuse the same containers across
224
225
multiple test runs. To do this, edit the testcontainers configuration
0 commit comments