GeoDienstenCentrum / schemaspy-maven-plugin

Maven reporting plugin for Schemaspy
https://geodienstencentrum.github.io/schemaspy-maven-plugin/
Other
4 stars 3 forks source link

MySQL test fails with "Unknown table 'address' in information_schema" #32

Closed mprins closed 3 years ago

mprins commented 6 years ago

Problem

The MysqlExternalDatabaseTest is curently ignored because it throws an error, details below, it means we don't get test coverage for MySQL

Version

versie info: 5.1.0

Server log

server log: ``` [INFO] ------------------------------------------------------- [INFO] T E S T S [INFO] ------------------------------------------------------- [INFO] Running com.wakaleo.schemaspy.MysqlExternalDatabaseTest [INFO] Generating SchemaSpy report with parameters: [INFO] -db=test [INFO] -host=127.0.0.1 [INFO] -t=mysql [INFO] -u=root [INFO] -s=test [INFO] -o=/mnt/tera1/home/mark/workspace/schemaspy-maven-plugin/target/reports/mysql-test/schemaspy [INFO] -desc=Maven Plugin SchemaSpy test Using database properties: [/mnt/tera1/home/mark/workspace/schemaspy-maven-plugin/target/classes]/net/sourceforge/schemaspy/dbTypes/mysql.properties Thu Oct 04 11:35:15 CEST 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification. Gathering schema details...[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.79 s <<< FAILURE! - in com.wakaleo.schemaspy.MysqlExternalDatabaseTest [ERROR] testMySqlConfiguration(com.wakaleo.schemaspy.MysqlExternalDatabaseTest) Time elapsed: 1.719 s <<< ERROR! org.apache.maven.reporting.MavenReportException: Unknown table 'address' in information_schema at com.wakaleo.schemaspy.MysqlExternalDatabaseTest.testMySqlConfiguration(MysqlExternalDatabaseTest.java:45) Caused by: java.sql.SQLSyntaxErrorException: Unknown table 'address' in information_schema at com.wakaleo.schemaspy.MysqlExternalDatabaseTest.testMySqlConfiguration(MysqlExternalDatabaseTest.java:45) ```

Spin up a myql docker image

https://hub.docker.com/r/mysql/mysql-server/

Use any of the following command to spin up a dockerized MySQL of the specified version with empty root account that you can connect to at 127.0.0.1:3306

#  note `--rm` option which removes container after stopping
docker run --rm --env "MYSQL_ROOT_HOST=%" --env "MYSQL_ALLOW_EMPTY_PASSWORD=true" --name mysql1 -p 3306:3306 --expose=3306 -d mysql/mysql-server:5.6

docker run --rm --env "MYSQL_ROOT_HOST=%" --env "MYSQL_ALLOW_EMPTY_PASSWORD=true" --name mysql1 -p 3306:3306 --expose=3306 -d mysql/mysql-server:5.7

docker run --rm --env "MYSQL_ROOT_HOST=%" --env "MYSQL_ALLOW_EMPTY_PASSWORD=true" --name mysql1 -p 3306:3306 --expose=3306 -d mysql/mysql-server:8.0

docker stop mysql1

You can then use

mysql -e 'CREATE DATABASE IF NOT EXISTS test;'
mysql test < ./src/test/resources/sql/mysql.sql

or similar to create the database and schema for the test.

mprins commented 3 years ago

seems resolved after #177

github-actions[bot] commented 3 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.