diff --git a/Makefile b/Makefile index 707657f0..4dcce352 100644 --- a/Makefile +++ b/Makefile @@ -2,12 +2,16 @@ IMAGE_NAME=opencodeco/rinha-de-backend:2023-q3 default: build push -.env: - cp .env.example .env - vendor/autoload.php: docker compose exec app composer install +.env: vendor/autoload.php + cp .env.example .env + +.PHONY: setup +setup: + sh setup.sh + .PHONY: build build: docker build -t $(IMAGE_NAME) . @@ -22,4 +26,8 @@ up: .env .PHONY: test test: vendor/autoload.php - docker compose exec api1 composer test + docker compose exec app1 composer test + +.PHONY: stress +stress: vendor/autoload.php + sh ./stress-test/run-test.sh diff --git a/README.md b/README.md index b7f7e4e9..e6279e6f 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,11 @@ PR da participação: [github.com/zanfranceschi/rinha-de-backend-2023-q3/pull/79 ### Primeiros passos +#### Preparar ambiente com o gatling +```shell +make setup +``` + #### Subir a aplicação ```shell make up @@ -19,3 +24,8 @@ make up ```shell make test ``` + +#### Executar os testes de stress +```shell +make stress +``` \ No newline at end of file diff --git a/setup.sh b/setup.sh new file mode 100644 index 00000000..9be4437c --- /dev/null +++ b/setup.sh @@ -0,0 +1,7 @@ +sleep 10 + +mkdir $HOME/gatling/3.9.5 +curl -L -o gatling.zip https://repo1.maven.org/maven2/io/gatling/highcharts/gatling-charts-highcharts-bundle/3.9.5/gatling-charts-highcharts-bundle-3.9.5-bundle.zip +mv ./gatling.zip $HOME/gatling/3.9.5/ +unzip $HOME/gatling/3.9.5/gatling.zip -d $HOME/gatling/3.9.5/ +mv $HOME/gatling/3.9.5/gatling*/* $HOME/gatling/3.9.5 \ No newline at end of file