#!/bin/bash

set -e

# Root directory of the tests: lambda-asset-tools/tests
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPORT_FILE="report/step_function_tests.html"

echo "Root directory is: $ROOT_DIR"
echo "▶ Running linting..."
yamllint -s docker-compose.yaml
ruff check .
ruff format . --check --diff
mypy sfn_integration_tests/ utils/ config.py

echo "▶ Running Step Function Integration Tests..."

pytest $ROOT_DIR/sfn_integration_tests/test*.py --html="$REPORT_FILE" --self-contained-html --reruns 1 --reruns-delay 1

echo "✅ Step Function Integration Tests are Done. View Test Report in $REPORT_FILE/"

