forked from floci-io/floci
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·29 lines (25 loc) · 1018 Bytes
/
run.sh
File metadata and controls
executable file
·29 lines (25 loc) · 1018 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
set -euo pipefail
# Environment setup for Docker container
export AWS_REGION=us-east-1
export AWS_DEFAULT_REGION=us-east-1
export AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID:-test}"
export AWS_SECRET_ACCESS_KEY="${AWS_SECRET_ACCESS_KEY:-test}"
export FLOCI_ENDPOINT="${FLOCI_ENDPOINT:-http://localhost:4566}"
export AWS_ENDPOINT_URL="$FLOCI_ENDPOINT"
export AWS_ENDPOINT_URL_S3="$FLOCI_ENDPOINT"
# CDK-specific: derive hostname and port from endpoint
export LOCALSTACK_HOSTNAME="${FLOCI_ENDPOINT#http://}"
export LOCALSTACK_HOSTNAME="${LOCALSTACK_HOSTNAME%:*}"
export EDGE_PORT="${FLOCI_ENDPOINT##*:}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
# Ensure bats is available
if [ ! -d "$REPO_ROOT/lib/bats-core" ]; then
echo "Error: bats-core not found. Run 'just setup-bats' first."
exit 1
fi
# Run bats tests
exec "$REPO_ROOT/lib/run-bats-with-junit.sh" \
"$SCRIPT_DIR/test/" \
"${BATS_JUNIT_XML:-$SCRIPT_DIR/test-results/junit.xml}"