Skip to content

Commit 2f92346

Browse files
committed
improve make recipes
1 parent 27df895 commit 2f92346

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

tests/performance/Makefile

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ export LOCUST_VERSION
99
ENV_FILE=$(shell pwd)/.env
1010
export ENV_FILE
1111

12+
KERNEL_NAME=$(shell uname -s)
13+
1214
NETWORK_NAME=dashboards_timenet
1315

1416
# UTILS
@@ -44,22 +46,17 @@ build: ## builds distributed osparc locust docker image
4446
push:
4547
docker push itisfoundation/locust:$(LOCUST_VERSION)
4648

47-
48-
49-
.PHONY: down
50-
down: ## stops and removes osparc locust containers
51-
docker compose --file docker-compose.yml down
52-
53-
.PHONY: test
54-
test: ## runs osparc locust. Locust and test configuration are specified in ENV_FILE
49+
.PHONY: test-up test-down
50+
test-up: ## runs osparc locust. Locust and test configuration are specified in ENV_FILE
5551
@if [ ! -f $${ENV_FILE} ]; then echo "You must generate a .env file before running tests!!! See the README..." && exit 1; fi;
5652
@if ! docker network ls | grep -q $(NETWORK_NAME); then \
5753
docker network create $(NETWORK_NAME); \
5854
echo "Created docker network $(NETWORK_NAME)"; \
5955
fi
6056
docker compose --file docker-compose.yml up --scale worker=4 --exit-code-from=master
6157

62-
58+
test-down: ## stops and removes osparc locust containers
59+
@docker compose --file docker-compose.yml down
6360

6461
.PHONY: dashboards-up dashboards-down
6562

@@ -69,13 +66,15 @@ dashboards-up: ## Create Grafana dashboard for inspecting locust results. See da
6966
docker network rm $(NETWORK_NAME); \
7067
echo "Removed docker network $(NETWORK_NAME)"; \
7168
fi
69+
@if [[ "$(KERNEL_NAME)" == "Linux" ]]; then \
70+
( sleep 3 && xdg-open http://localhost:3000 ) & \
71+
fi
7272
@locust-compose up
7373

74+
7475
dashboards-down:
7576
@locust-compose down
7677

77-
78-
7978
.PHONY: install-ci install-dev
8079

8180
install-dev:

0 commit comments

Comments
 (0)