#!/bin/bash # Email Attendees Feature Tests Runner # This script: # 1. Transfers test files to the staging server # 2. Runs the tests on the staging server # 3. Returns the results # Colors GREEN='\033[0;32m' RED='\033[0;31m' YELLOW='\033[1;33m' NC='\033[0m' # No Color # Configuration STAGING_HOST="146.190.76.204" STAGING_USER="roodev" REMOTE_PLUGIN_PATH="/home/974670.cloudwaysapps.com/uberrxmprk/public_html/wp-content/plugins/hvac-community-events" LOCAL_PATH="$(pwd)" # Print header echo -e "${GREEN}=== Running Email Attendees Tests on Staging ===${NC}" echo -e "Remote host: ${STAGING_HOST}" echo -e "Remote user: ${STAGING_USER}" echo -e "Plugin path: ${REMOTE_PLUGIN_PATH}" echo -e "=======================================" # Check if test directory exists on staging ssh ${STAGING_USER}@${STAGING_HOST} "if [ ! -d ${REMOTE_PLUGIN_PATH}/tests ]; then mkdir -p ${REMOTE_PLUGIN_PATH}/tests; fi" ssh ${STAGING_USER}@${STAGING_HOST} "if [ ! -d ${REMOTE_PLUGIN_PATH}/tests/unit ]; then mkdir -p ${REMOTE_PLUGIN_PATH}/tests/unit; fi" ssh ${STAGING_USER}@${STAGING_HOST} "if [ ! -d ${REMOTE_PLUGIN_PATH}/tests/integration ]; then mkdir -p ${REMOTE_PLUGIN_PATH}/tests/integration; fi" # Transfer test files echo -e "Transferring test files to staging server..." scp "${LOCAL_PATH}/wordpress/wp-content/plugins/hvac-community-events/tests/unit/test-email-attendees-data.php" ${STAGING_USER}@${STAGING_HOST}:${REMOTE_PLUGIN_PATH}/tests/unit/ scp "${LOCAL_PATH}/wordpress/wp-content/plugins/hvac-community-events/tests/integration/test-email-attendees-integration.php" ${STAGING_USER}@${STAGING_HOST}:${REMOTE_PLUGIN_PATH}/tests/integration/ # Create bootstrap file if it doesn't exist cat > /tmp/bootstrap-staging.php << 'EOF' /tmp/wp-tests-config-staging.php << 'EOF'