flink-cdc icon indicating copy to clipboard operation
flink-cdc copied to clipboard

[test][mysql] add env variables to support executing the test cases locally

Open whhe opened this issue 2 years ago • 0 comments

Modifications:

  • Add TestEnvUtils to get environment variables for testing.
  • Always using MySqlTestUtils.createMySqlContainer to create MySqlContainer instances, which ensures that the same configurations (init sql, user and password) are used.
  • Modified the MySqlContainer and overrided the start and stop method for local testing.
  • Moved the mysqluser/mysqlpw consts to UniqueDatabase, and mocked the getters by environment variables.
  • Always using UniqueDatabase instance instead of using MySqlContainer directly 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

whhe avatar Dec 26 '23 08:12 whhe