forked from Islandora-Devops/isle-dc
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path10-migration-backend-tests.sh
executable file
·24 lines (18 loc) · 1.16 KB
/
10-migration-backend-tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
set -e
set -x
BASE_TEST_FOLDER="$(pwd)/$(dirname $0)/$(basename $0 .sh)"
TESTCAFE_TESTS_FOLDER="$BASE_TEST_FOLDER/testcafe"
# Start the backend that serves the media files to be migrated
# Listens internally on port 80 (addressed as http://<assets_container>/assets/)
startMigrationAssetsContainer
# Execute migrations using testcafe
mkdir -m 0777 --parents ${TESTCAFE_TESTS_FOLDER}/screenshots
docker run --network gateway --env-file=$(pwd)/.env -v "${TESTCAFE_TESTS_FOLDER}":/tests testcafe/testcafe:"${TESTCAFE_VERSION}" --screenshots path=/tests/screenshots,takeOnFails=true chromium /tests/**/*.js
# Verify migrations using go
# Build docker image (TODO: should it be defined in docker-compose.yml to avoid any env issues?)
docker build -t local/migration-backend-tests "${BASE_TEST_FOLDER}/verification"
# Execute tests in docker image, on the same docker network (gateway, idc_default?) as Drupal
# TODO: expose logs when failing tests?
# N.B. trailing slash on the BASE_ASSETS_URL is important. uses the internal URL.
# docker run --network gateway --env-file=$(pwd)/.env --rm -e BASE_ASSETS_URL=http://${assets_container}/assets/ local/migration-backend-tests