diff --git a/Makefile b/Makefile index 673cb553..215f9172 100644 --- a/Makefile +++ b/Makefile @@ -36,6 +36,7 @@ CY_NPM_COMMAND="cy:run" build-tests: @echo "==> 🏗 Build Test Containers" + @docker build -t stemmaweb-middleware ./middleware @CY_NPM_COMMAND=$(CY_NPM_COMMAND) docker compose --env-file .env.test -f docker-compose.test.yml build build-tests-arm: diff --git a/bin/tests.sh b/bin/tests.sh index 2ba5c887..654a1651 100755 --- a/bin/tests.sh +++ b/bin/tests.sh @@ -16,18 +16,20 @@ docker-compose --env-file $ENV_FILE -f $DOCKER_COMPOSE_FILE up -d # Check the exit status of the docker container responsible for starting the tests exit_status=$(docker wait $TEST_CONTAINER_NAME) -# Check if the exit status is 0 +# Check if the exit status is 0; if so we will remove the containers if [ "$exit_status" -eq 0 ]; then echo "All tests passed ✅" + stopcmd=down else echo "Some tests failed ❌" + stopcmd=stop fi # Display logs docker logs $TEST_CONTAINER_NAME # Stop the services -docker-compose --env-file $ENV_FILE -f $DOCKER_COMPOSE_FILE down +docker-compose --env-file $ENV_FILE -f $DOCKER_COMPOSE_FILE $stopcmd # Exit with the exit status of the docker container responsible for starting the tests exit "$exit_status" diff --git a/docker-compose.test.yml b/docker-compose.test.yml index 78b6f9b3..63adc0ac 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -7,7 +7,7 @@ services: stemmarest-initializer: build: bin env_file: - - .env.dev + - .env.test depends_on: - stemmarest volumes: @@ -20,7 +20,7 @@ services: image: mariadb:10.4 restart: always env_file: - - stemweb/.env.dev + - stemweb/.env.prod stemweb_redis: container_name: stemweb_redis @@ -41,7 +41,7 @@ services: image: dhuniwien/stemweb_py37:latest restart: always env_file: - - stemweb/.env.dev + - stemweb/.env.prod depends_on: - stemweb_mysql - stemweb_redis @@ -53,18 +53,18 @@ services: - stemmarest - stemweb env_file: - - .env.prod + - .env.test volumes: - ./frontend/config/env.js.prod:/usr/src/app/stemmaweb_middleware/stemmaweb/src/js/env.js stemmaweb-e2e: container_name: stemmaweb-e2e build: frontend-e2e - env_file: - - .env.dev depends_on: - stemmaweb - stemmarest-initializer + env_file: + - .env.test volumes: - ./frontend-e2e/:/app entrypoint: > diff --git a/env.zip.gpg b/env.zip.gpg index 2c51c2a2..ad1990e6 100644 Binary files a/env.zip.gpg and b/env.zip.gpg differ diff --git a/frontend/www/src/js/modules/common/service/stemwebService.js b/frontend/www/src/js/modules/common/service/stemwebService.js index e3f3576b..1b8cbaf3 100644 --- a/frontend/www/src/js/modules/common/service/stemwebService.js +++ b/frontend/www/src/js/modules/common/service/stemwebService.js @@ -129,8 +129,8 @@ class StemwebService extends BaseService { * @returns {Promise>} */ runAlgorithm(userid, algorithmId, textid, data, parameters) { - const return_host = 'http://reverse-proxy:80'; - const return_path = '/stemmaweb/requests/stemweb/result'; + const return_host = this.baseUrl; + const return_path = '/result'; /** @type {RunAlgorithmDTO} */ const dto = { userid, textid, data, parameters, return_host, return_path }; return this.fetch(`/algorithms/process/${algorithmId}`, {