flink-cdc
flink-cdc copied to clipboard
[test][mysql] add env variables to support executing the test cases locally
Modifications:
- Add
TestEnvUtilsto get environment variables for testing. - Always using
MySqlTestUtils.createMySqlContainerto createMySqlContainerinstances, which ensures that the same configurations (init sql, user and password) are used. - Modified the
MySqlContainerand overrided thestartandstopmethod for local testing. - Moved the
mysqluser/mysqlpwconsts toUniqueDatabase, and mocked the getters by environment variables. - Always using
UniqueDatabaseinstance instead of usingMySqlContainerdirectly in test cases, which ensures the mocked getters works properly.
Env usage:
test.mode=local
test.host=
test.port=
test.user=
test.password=
Close #2922