@@ -268,6 +268,7 @@ impl Database for Mysql {
268
268
mod tests {
269
269
use std:: sync:: Arc ;
270
270
271
+ use testcontainers:: core:: IntoContainerPort ;
271
272
/*
272
273
We run a MySQL container and run all the tests against the same container and database.
273
274
@@ -285,7 +286,7 @@ mod tests {
285
286
If we increase the number of methods or the number or drivers.
286
287
*/
287
288
use testcontainers:: runners:: AsyncRunner ;
288
- use testcontainers:: { ContainerAsync , GenericImage } ;
289
+ use testcontainers:: { ContainerAsync , GenericImage , ImageExt } ;
289
290
use torrust_tracker_configuration:: Core ;
290
291
291
292
use super :: Mysql ;
@@ -298,12 +299,12 @@ mod tests {
298
299
impl StoppedMysqlContainer {
299
300
async fn run ( self , config : & MysqlConfiguration ) -> Result < RunningMysqlContainer , Box < dyn std:: error:: Error + ' static > > {
300
301
let container = GenericImage :: new ( "mysql" , "8.0" )
302
+ . with_exposed_port ( config. internal_port . tcp ( ) )
303
+ // todo: this does not work
304
+ //.with_wait_for(WaitFor::message_on_stdout("ready for connections"))
301
305
. with_env_var ( "MYSQL_ROOT_PASSWORD" , config. db_root_password . clone ( ) )
302
306
. with_env_var ( "MYSQL_DATABASE" , config. database . clone ( ) )
303
307
. with_env_var ( "MYSQL_ROOT_HOST" , "%" )
304
- . with_exposed_port ( config. internal_port )
305
- // todo: this doesn't work
306
- //.with_wait_for(WaitFor::message_on_stdout("ready for connections"))
307
308
. start ( )
308
309
. await ?;
309
310
0 commit comments