| 1 | #!/usr/bin/env bash |
| 2 | set -euo pipefail |
| 3 | |
| 4 | SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
| 5 | # shellcheck disable=SC1091 |
| 6 | . "$SCRIPT_DIR/lib.sh" |
| 7 | |
| 8 | init_workspace "oracledb" |
| 9 | trap cleanup EXIT |
| 10 | |
| 11 | ORACLE_PORT="$(reserve_port)" |
| 12 | write_env "ORACLE_PORT" "$ORACLE_PORT" |
| 13 | replace_in_file "$WORKDIR/config/go.d/oracledb.conf" "127.0.0.1:1521" "127.0.0.1:${ORACLE_PORT}" |
| 14 | |
| 15 | compose_up oracledb |
| 16 | wait_healthy oracledb 300 |
| 17 | |
| 18 | compose_run oracledb-seed |
| 19 | |
| 20 | run_bg compose_run oracledb-sleep |
| 21 | SLEEP_PID="$LAST_BG_PID" |
| 22 | sleep 3 |
| 23 | |
| 24 | build_plugin |
| 25 | run_info oracledb |
| 26 | run_top_queries oracledb |
| 27 | run_running_queries oracledb 1 |
| 28 | |
| 29 | if kill -0 "$SLEEP_PID" 2>/dev/null; then |
| 30 | kill "$SLEEP_PID" |
| 31 | wait "$SLEEP_PID" || true |
| 32 | fi |
| 33 | |
| 34 | echo "E2E checks passed for oracledb." >&2 |