Setup TiDB for local testing

This commit is contained in:
Christian Beikov 2023-08-10 11:41:53 +02:00
parent 173e247812
commit d4abf0819a
4 changed files with 6 additions and 2 deletions

1
Jenkinsfile vendored
View File

@ -41,7 +41,6 @@ stage('Configure') {
// new BuildEnvironment( dbName: 'hana_cloud', dbLockableResource: 'hana-cloud', dbLockResourceAsHost: true ),
new BuildEnvironment( node: 's390x' ),
new BuildEnvironment( dbName: 'tidb', node: 'tidb',
additionalOptions: '-DdbHost=localhost:4000',
notificationRecipients: 'tidb_hibernate@pingcap.com' ),
new BuildEnvironment( testJdkVersion: '17' ),
// We want to enable preview features when testing newer builds of OpenJDK:

View File

@ -203,6 +203,10 @@ The following table illustrates a list of commands for various databases that ca
|CockroachDB
|`./docker_db.sh cockroachdb`
|`./gradlew test -Pdb=cockroachdb`
|TiDB
|`./docker_db.sh tidb`
|`./gradlew test -Pdb=tidb`
|===
To stop a container started by `docker`, use the command

View File

@ -799,6 +799,7 @@ tidb_5_1() {
echo "Waiting for TiDB to start..."
sleep 3
done
$CONTAINER_CLI run --link tidb:tidb -it --rm docker.io/mysql:8.0.31 mysql -htidb -P4000 -uroot -e "create database hibernate_orm_test; create user 'hibernate_orm_test' identified by 'hibernate_orm_test'; grant all on hibernate_orm_test.* to 'hibernate_orm_test';"
if [ "$n" -ge 5 ]; then
echo "TiDB failed to start and configure after 15 seconds"
else

View File

@ -128,7 +128,7 @@ ext {
'jdbc.driver': 'com.mysql.jdbc.Driver',
'jdbc.user' : 'hibernate_orm_test',
'jdbc.pass' : 'hibernate_orm_test',
'jdbc.url' : 'jdbc:mysql://' + dbHost + '/hibernate_orm_test',
'jdbc.url' : 'jdbc:mysql://' + dbHost + ':4000/hibernate_orm_test',
'connection.init_sql' : ''
],
oracle : [