[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
This commit is contained in:
Maximiliano Redigonda 2022-05-05 15:19:16 -03:00 committed by GitHub
parent 39f8a601db
commit 615f42a91b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -11,16 +11,15 @@ build:
install: 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-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: 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-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: 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 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-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 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 @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