Setup TiDB for local testing

This commit is contained in:
Christian Beikov 2023-08-10 11:41:53 +02:00
parent e275d5820b
commit 5b2d347b6f
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( dbName: 'hana_cloud', dbLockableResource: 'hana-cloud', dbLockResourceAsHost: true ),
new BuildEnvironment( node: 's390x' ), new BuildEnvironment( node: 's390x' ),
new BuildEnvironment( dbName: 'tidb', node: 'tidb', new BuildEnvironment( dbName: 'tidb', node: 'tidb',
additionalOptions: '-DdbHost=localhost:4000',
notificationRecipients: 'tidb_hibernate@pingcap.com' ), notificationRecipients: 'tidb_hibernate@pingcap.com' ),
new BuildEnvironment( testJdkVersion: '17' ), new BuildEnvironment( testJdkVersion: '17' ),
// We want to enable preview features when testing newer builds of OpenJDK: // We want to enable preview features when testing newer builds of OpenJDK:

View File

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

View File

@ -839,6 +839,7 @@ tidb_5_1() {
echo "Waiting for TiDB to start..." echo "Waiting for TiDB to start..."
sleep 3 sleep 3
done 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 if [ "$n" -ge 5 ]; then
echo "TiDB failed to start and configure after 15 seconds" echo "TiDB failed to start and configure after 15 seconds"
else else

View File

@ -128,7 +128,7 @@ ext {
'jdbc.driver': 'com.mysql.jdbc.Driver', 'jdbc.driver': 'com.mysql.jdbc.Driver',
'jdbc.user' : 'hibernate_orm_test', 'jdbc.user' : 'hibernate_orm_test',
'jdbc.pass' : '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' : '' 'connection.init_sql' : ''
], ],
oracle : [ oracle : [