#!/bin/bash # Mock script to run tests # Usage: ./run_tests.sh BRANCH=$1 SCENARIOS=$2 ENV=$3 MODE=$4 JOB_ID=$5 echo "Starting job $JOB_ID on branch $BRANCH with env $ENV and mode $MODE" # Simulate work sleep 5 # Create results directory if not exists (mapped volume) # If running locally without docker mapping, this might fail if /results doesn't exist. # We should use a relative path for safety if not in docker, but the requirement says Docker. # We'll assume /results is mounted. RESULTS_DIR="/results/$JOB_ID" # Fallback for local testing if /results is not writable if [ ! -d "/results" ]; then RESULTS_DIR="./results/$JOB_ID" fi mkdir -p $RESULTS_DIR # Generate HTML report cat < $RESULTS_DIR/index.html Test Results - Job $JOB_ID

Test Results for Job $JOB_ID

Branch: $BRANCH

Environment: $ENV

Mode: $MODE


Scenarios

  • scenario_login: PASSED
  • scenario_payment: PASSED
  • scenario_profile: PASSED
  • scenario_logout: PASSED

Overall Status: PASSED

EOF echo "Job $JOB_ID completed." exit 0