upskill-event-manager/wordpress-dev/bin/deploy-basic-tests.sh
bengizmo d6211ee364 feat(testing): Implement HVAC_Test_User_Factory and update .gitignore
- Add HVAC_Test_User_Factory class with:
  * User creation with specific roles
  * Multiple role support
  * Persona management system
  * Account cleanup integration
- Create comprehensive test suite in HVAC_Test_User_Factory_Test.php
- Update testing improvement plan documentation
- Add implementation decisions to project memory bank
- Restructure .gitignore with:
  * Whitelist approach for better file management
  * Explicit backup exclusions
  * Specific bin directory inclusions

Part of the Account Management component from the testing framework improvement plan.
2025-04-14 17:41:36 -03:00

50 lines
No EOL
1.6 KiB
Bash
Executable file

#!/bin/bash
# Script to deploy basic test files to staging server
# Load environment variables
source "$(dirname "$0")/../deploy-config-staging.conf"
# Check if staging credentials are set
if [ -z "$UPSKILL_STAGING_SSH_USER" ] || [ -z "$UPSKILL_STAGING_IP" ] || [ -z "$UPSKILL_STAGING_PATH" ]; then
echo "Error: Staging credentials not found in configuration"
exit 1
fi
# Create test directory on staging
echo "Creating test directory on staging..."
sshpass -p "$UPSKILL_STAGING_PASS" ssh -o StrictHostKeyChecking=no "$UPSKILL_STAGING_SSH_USER@$UPSKILL_STAGING_IP" \
"mkdir -p $UPSKILL_STAGING_PATH/wp-content/plugins/hvac-community-events/tests/basic"
if [ $? -ne 0 ]; then
echo "Error: Failed to create test directory on staging"
exit 1
fi
# Deploy test files
echo "Deploying test files..."
TEST_FILES=(
"tests/basic/bootstrap.php"
"tests/basic/test-doubles.php"
"tests/basic/test-basic-functionality.php"
"tests/basic/run-tests.php"
)
for file in "${TEST_FILES[@]}"; do
echo "Copying $file..."
sshpass -p "$UPSKILL_STAGING_PASS" scp -o StrictHostKeyChecking=no \
"$file" \
"$UPSKILL_STAGING_SSH_USER@$UPSKILL_STAGING_IP:$UPSKILL_STAGING_PATH/wp-content/plugins/hvac-community-events/$file"
if [ $? -ne 0 ]; then
echo "Error: Failed to copy $file"
exit 1
fi
done
echo "Making test scripts executable..."
sshpass -p "$UPSKILL_STAGING_PASS" ssh -o StrictHostKeyChecking=no "$UPSKILL_STAGING_SSH_USER@$UPSKILL_STAGING_IP" \
"chmod +x $UPSKILL_STAGING_PATH/wp-content/plugins/hvac-community-events/tests/basic/run-tests.php"
echo "Basic test files deployed successfully"
exit 0