From 615f42a91b3d1260b6cda612699d6bd01e5fe87b Mon Sep 17 00:00:00 2001 From: Maximiliano Redigonda Date: Thu, 5 May 2022 15:19:16 -0300 Subject: [PATCH] [DEV-190] Fix tests (mysql socket error, initialize mysqld first) (#1202) * [DEV-190] Fix tests v2 * Try changing to 127.0.0.1 * Try maybe 0.0.0.0 ? * Try forcing tcp protocol * Test with equal symbol * Try with starting the service first * Add command to start mysqld to both install actions in Makefile * Remove mounting volume to check who's the culprit --- server/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/Makefile b/server/Makefile index 57469c15..ad735b44 100644 --- a/server/Makefile +++ b/server/Makefile @@ -11,16 +11,15 @@ build: install: @docker exec -it opensupports-srv bash -c "cd /var/www/html && composer install" || echo "${red}Please execute 'make run' first${reset}" - @docker exec -it opensupports-db bash -c "mysql -u root -e \"CREATE DATABASE IF NOT EXISTS development;\" " || echo "${red}Please execute 'make run' first${reset}" + @docker exec -it opensupports-db bash -c "service mysqld start; mysql -u root -e \"CREATE DATABASE IF NOT EXISTS development;\" " || echo "${red}Please execute 'make run' first${reset}" install-not-interactive: @docker exec opensupports-srv bash -c "cd /var/www/html && composer install" || echo "${red}Please execute 'make run' first${reset}" - @docker exec opensupports-db bash -c "mysql -u root -e \"CREATE DATABASE IF NOT EXISTS development;\" " || echo "${red}Please execute 'make run' first${reset}" + @docker exec opensupports-db bash -c "service mysqld start; mysql -u root -e \"CREATE DATABASE IF NOT EXISTS development;\" " || echo "${red}Please execute 'make run' first${reset}" setup-vendor-permissions: @docker exec opensupports-srv bash -c "cd /var/www/html && chmod 777 -R vendor/ezyang" || echo "${red}Please execute 'make run' first${reset}" @docker exec opensupports-srv bash -c "cd /var/www/html && chmod 777 -R files" || echo "${red}Please execute 'make run' first${reset}" - @docker exec opensupports-db bash -c "mysql -u root -e \"CREATE DATABASE IF NOT EXISTS development\"" || echo "${red}Please execute 'make run' first${reset}" run: stop @docker run --platform=linux/amd64 -d --network os-net --name opensupports-db -p 4040:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -v $(PWD)/.dbdata/:/var/lib/mysql mysql:5.6