db1d565b64
Integration Tests / melodic (push) Has been cancelled
Integration Tests / noetic (push) Has been cancelled
Integration Tests / humble (push) Has been cancelled
Integration Tests / jazzy (push) Has been cancelled
Ruff Lint & Format / ruff (push) Has been cancelled
Sync main to develop / Check if sync is needed (push) Has been cancelled
Sync main to develop / Sync main to develop (push) Has been cancelled
64 lines
1.7 KiB
Bash
Executable File
64 lines
1.7 KiB
Bash
Executable File
#!/bin/bash
|
|
# Run the version detection test against a specific ROS distro.
|
|
# Usage: ./tests/integration/scripts/run-detect-test.sh <distro>
|
|
# Example: ./tests/integration/scripts/run-detect-test.sh noetic
|
|
|
|
set -e
|
|
cd "$(git rev-parse --show-toplevel)"
|
|
|
|
DISTRO="${1:?Usage: $0 <melodic|noetic|humble|jazzy>}"
|
|
COMPOSE="tests/integration/docker-compose.yml"
|
|
|
|
declare -A DOCKERFILES=(
|
|
[melodic]="Dockerfile.ros1-melodic"
|
|
[noetic]="Dockerfile.ros1-noetic"
|
|
[humble]="Dockerfile.ros2-humble"
|
|
[jazzy]="Dockerfile.ros2-jazzy"
|
|
)
|
|
|
|
declare -A CONTAINERS=(
|
|
[melodic]="integration-ros-melodic"
|
|
[noetic]="integration-ros-noetic"
|
|
[humble]="integration-ros2-humble"
|
|
[jazzy]="integration-ros2-jazzy"
|
|
)
|
|
|
|
DOCKERFILE="${DOCKERFILES[$DISTRO]}"
|
|
CONTAINER="${CONTAINERS[$DISTRO]}"
|
|
|
|
if [ -z "$DOCKERFILE" ]; then
|
|
echo "Unknown distro: $DISTRO"
|
|
echo "Valid options: melodic, noetic, humble, jazzy"
|
|
exit 1
|
|
fi
|
|
|
|
echo "=== Testing $DISTRO ==="
|
|
echo "Dockerfile: $DOCKERFILE"
|
|
echo "Container: $CONTAINER"
|
|
echo ""
|
|
|
|
# Tear down any previous container
|
|
ROS_DOCKERFILE="$DOCKERFILE" ROS_CONTAINER_NAME="$CONTAINER" \
|
|
docker compose -f "$COMPOSE" down --volumes 2>/dev/null || true
|
|
|
|
# Build and start
|
|
echo "--- Starting container ---"
|
|
ROS_DOCKERFILE="$DOCKERFILE" ROS_CONTAINER_NAME="$CONTAINER" \
|
|
docker compose -f "$COMPOSE" up --build -d --wait
|
|
|
|
# Run quick detect
|
|
echo ""
|
|
echo "--- Quick detect ---"
|
|
uv run python tests/integration/test_quick_detect.py
|
|
|
|
# Run pytest
|
|
echo ""
|
|
echo "--- Pytest ---"
|
|
uv run pytest tests/integration/test_detect_version.py -v --ros-distro "$DISTRO"
|
|
|
|
# Tear down
|
|
echo ""
|
|
echo "--- Tearing down ---"
|
|
ROS_DOCKERFILE="$DOCKERFILE" ROS_CONTAINER_NAME="$CONTAINER" \
|
|
docker compose -f "$COMPOSE" down --volumes
|