upskill-event-manager/docs/test-environment-checklist.md
bengizmo cade20aa2b feat(testing): Implement HVAC Role Manager component
- Added HVAC_Role_Manager class with role/permission management
- Implemented test cases in HVAC_Role_Manager_Test.php
- Created API documentation in docs/role-manager-api.md
- Updated testing improvement plan with progress
- Added design decisions to memory-bank/decisionLog.md

Includes:
- Role creation/deletion methods
- Permission management system
- Role conflict detection
- Permission inheritance logic
- Comprehensive test coverage
2025-04-14 19:02:22 -03:00

3.4 KiB

Test Environment Checklist

Overview

This checklist provides a comprehensive guide for setting up and verifying the test environment for the HVAC Community Events plugin. It addresses common issues encountered during testing on the staging environment.

Basic Test Environment (Implemented)

  • Created basic test directory structure
  • Implemented bootstrap.php for test initialization
  • Created test-doubles.php for TEC mocks
  • Implemented basic functionality test suite
  • Added test execution script
  • Created deployment scripts

Environment Verification

WordPress Core

  • WordPress core files are present and accessible
  • wp-config.php is properly configured
  • WordPress version meets minimum requirements
  • WordPress debug mode is enabled for testing

Plugin Dependencies

  • The Events Calendar plugin is installed and activated
  • The Events Calendar Community Events plugin is installed and activated
  • Event Tickets plugin is installed and activated (if needed)
  • All required plugins meet minimum version requirements

Database Configuration

  • Database credentials are correct in wp-tests-config.php
  • Database user has necessary permissions
  • Table prefix is correctly configured

Test Configuration Files

  • bootstrap.php exists and is properly configured
  • test-doubles.php provides necessary mock functions
  • Basic test suite implemented
  • Test runner script created

Test Environment

  • Composer dependencies are installed
  • PHPUnit is available and executable
  • Test directories exist and are writable
  • Test results directory exists and is writable

Staging Environment Setup

Staging Access

  • SSH access is configured and working
  • Staging credentials are set in .env
  • File permissions allow plugin deployment
  • Database access is configured with correct credentials

Staging Testing Commands

# Deploy basic tests to staging
./wordpress-dev/bin/deploy-basic-tests.sh

# Run basic functionality tests
./wordpress-dev/bin/run-basic-tests.sh

Common Issues and Solutions

Missing TEC Classes/Functions

Issue: Tests fail with Class "Tribe__Events__Main" not found
Solution: Implemented in test-doubles.php with mock classes and functions

Database Access Issues

Issue: Cannot create or access test database
Solution: Using existing database credentials from staging configuration

Missing Methods

Issue: Tests fail with undefined method errors
Solution: Essential methods mocked in test-doubles.php

PHPUnit Configuration Issues

Issue: PHPUnit cannot find bootstrap file
Solution: Direct path configuration in run-tests.php

Test Environment Maintenance

Regular Verification

  • Run verification scripts weekly
  • Update test dependencies when plugin dependencies are updated
  • Document any environment-specific configurations

Troubleshooting Process

  1. Verify WordPress and plugin files exist and are accessible
  2. Check database connection and credentials
  3. Validate test configuration files
  4. Review test logs for specific errors
  5. Test with minimal configuration to isolate issues

Next Steps

  1. Deploy basic test suite to staging
  2. Run initial tests and verify results
  3. Address any configuration issues
  4. Expand test coverage based on results
  5. Document any staging-specific requirements