diff --git a/tests/functions.sh b/tests/functions.sh index 8507cf95..132005da 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -25,16 +25,6 @@ ping_site() { fi } -docker_compose_with_args() { - # shellcheck disable=SC2068 - docker-compose \ - -p $project_name \ - -f installation/docker-compose-common.yml \ - -f installation/docker-compose-frappe.yml \ - -f installation/frappe-publish.yml \ - $@ -} - check_migration_complete() { print_group Check migration @@ -63,8 +53,8 @@ check_health() { print_group Loop health check docker run --name frappe_doctor \ - -v "${project_name}_sites-vol:/home/frappe/frappe-bench/sites" \ - --network "${project_name}_default" \ + -v "$1_sites-vol:/home/frappe/frappe-bench/sites" \ + --network "$1_default" \ frappe/frappe-worker:edge doctor || true cmd='docker logs frappe_doctor | grep "Health check successful" || echo ""' diff --git a/tests/integration-test.sh b/tests/integration-test.sh index 44c6e1e7..2f105167 100755 --- a/tests/integration-test.sh +++ b/tests/integration-test.sh @@ -6,6 +6,16 @@ source tests/functions.sh project_name=frappe_bench_00 +docker_compose_with_args() { + # shellcheck disable=SC2068 + docker-compose \ + -p $project_name \ + -f installation/docker-compose-common.yml \ + -f installation/docker-compose-frappe.yml \ + -f installation/frappe-publish.yml \ + $@ +} + # Initial group echo ::group::Setup .env cp env-example .env @@ -28,7 +38,7 @@ docker run \ --network ${project_name}_default \ postgres:11.8 -check_health +check_health $project_name print_group "Create new site " SITE_NAME=test.localhost @@ -123,7 +133,7 @@ docker_compose_with_args stop docker container prune -f && docker volume prune -f docker_compose_with_args up -d -check_health +check_health $project_name print_group Restore backup from S3 docker run \ @@ -139,7 +149,7 @@ docker run \ --network ${project_name}_default \ frappe/frappe-worker:edge restore-backup -check_health +check_health $project_name ping_site SITE_NAME=$PG_SITE_NAME ping_site @@ -153,7 +163,7 @@ docker run \ --network ${project_name}_default \ frappe/frappe-worker:edge new -check_health +check_health $project_name SITE_NAME=$EDGE_SITE_NAME ping_site print_group Migrate edge site diff --git a/tests/test-erpnext.sh b/tests/test-erpnext.sh index f4a848c6..839dfbeb 100755 --- a/tests/test-erpnext.sh +++ b/tests/test-erpnext.sh @@ -36,7 +36,7 @@ docker run \ docker restart ${project_name}_erpnext-nginx_1 docker restart ${project_name}_fix-vol-permissions_1 -check_health +check_health $project_name ping_site rm .env