diff --git a/.travis.yml b/.travis.yml index dec34d4..736787e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,8 @@ matrix: - php: 7.0 fast_finish: true sudo: false +services: + - docker cache: directories: - $HOME/.composer/cache diff --git a/resources/conf/mysql.cnf b/resources/conf/mysql.cnf index 591d91a..b5713a7 100644 --- a/resources/conf/mysql.cnf +++ b/resources/conf/mysql.cnf @@ -8,7 +8,7 @@ socket = /var/run/mysqld/mysqld.sock nice = 0 [mysqld] -user = root +user = mysql pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock port = 3306 diff --git a/src/Docker/ComposeContainers.php b/src/Docker/ComposeContainers.php index 67ffeca..f80ad2e 100644 --- a/src/Docker/ComposeContainers.php +++ b/src/Docker/ComposeContainers.php @@ -80,7 +80,7 @@ public function addDatabase() { $this->config['mariadb'] = [ // @todo if comman run with verbose, tag verbose. - 'command' => 'mysqld --user=root --verbose', + 'command' => 'mysqld --verbose', 'image' => 'mariadb', 'ports' => [ '3306', diff --git a/tests/Utils/BaseUtilsTest.php b/tests/BaseTest.php similarity index 61% rename from tests/Utils/BaseUtilsTest.php rename to tests/BaseTest.php index f295c9c..77aefb8 100644 --- a/tests/Utils/BaseUtilsTest.php +++ b/tests/BaseTest.php @@ -1,18 +1,13 @@ execute([], ['interactive' => true]); + // Let all containers boot + sleep(20); + + $dir_path = explode(DIRECTORY_SEPARATOR, self::$tmpName); + $project_prefix = strtolower(end($dir_path)); + $process = Docker::inspect(['--format="{{ .State.Running }}"', $project_prefix . '_nginx_1'], true); + $this->assertTrue(trim($process->getOutput()) == '"true"', $project_prefix . '_nginx_1 as not running'); + $process = Docker::inspect(['--format="{{ .State.Running }}"', $project_prefix . '_phpfpm_1'], true); + $this->assertTrue(trim($process->getOutput()) == '"true"', $project_prefix . '_phpfpm_1 as not running'); + // MariaDB takes a little. + $process = Docker::inspect(['--format="{{ .State.Running }}"', $project_prefix . '_mariadb_1'], true); + $this->assertTrue(trim($process->getOutput()) == '"true"', $project_prefix . '_mariadb_1 as not running'); + } +} \ No newline at end of file diff --git a/tests/Utils/ComposeContainersTest.php b/tests/Utils/ComposeContainersTest.php index 1eed16a..d1b1a12 100644 --- a/tests/Utils/ComposeContainersTest.php +++ b/tests/Utils/ComposeContainersTest.php @@ -1,19 +1,14 @@