This file has been moved to docs/test_env/TEST_ENV_IMPLEMENTATION.md - please refer to the docs directory for the latest content.
A fully isolated testing directory with the following structure:
test_env/
├── README.md # Comprehensive documentation
├── fixtures/ # Test data & samples
│ ├── archives/ # For test archive files
│ ├── ini_configs/ # For sample INI configs
│ └── OptiScaler.ini.sample # Sample configuration
├── mock_games/ # Mock game installations
├── cache/ # Temporary cache (auto-generated)
│ ├── optiscaler_downloads/ # Downloaded test files
│ └── extracted/ # Extracted files
└── outputs/ # Test results
├── logs/ # Test execution logs
└── reports/ # Test reports & results
Added automatic exclusion:
# Test environment (local testing only, excluded from git)
test_env/This ensures:
- ✅ Test files never accidentally committed
- ✅ Large binary files stay local
- ✅ Cache doesn't pollute repository
- ✅ Each developer has independent setup
- Modern cross-platform setup
- Colorized output for clarity
- Creates all directories and .gitkeep files
- Validates execution from correct directory
- Windows batch alternative
- Simple, straightforward setup
- Works on older Windows systems
Usage:
# PowerShell (recommended)
.\setup_test_env.ps1
# Or batch
setup_test_env.bat- Complete test environment guide
- Directory structure explanation
- Testing patterns and examples
- Troubleshooting section
- CI/CD integration notes
- Quick start guide
- Setup instructions
- Common testing patterns with code examples
- Cleanup procedures
- CI/CD integration examples
- One-page quick reference
- Essential commands
- Directory quick map
- Git safety notes
test_env/fixtures/OptiScaler.ini.sample
- Ready-to-use sample OptiScaler configuration
- Comments explaining each section
- Based on official OptiScaler structure
- Can be copied and customized for tests
# One time only
.\setup_test_env.ps1# Unreal Engine game
mkdir test_env\mock_games\MyGameUE\Engine\Binaries\Win64
# Standard game
mkdir test_env\mock_games\MyGameStd# Individual test with test environment
python test_archive_extractor.py
# All tests
.\run_progress_tests.bat
# With environment variable
$env:TEST_ENV_PATH = ".\test_env"
python test_archive_extractor.py# Keep fixtures, remove cache
rm test_env\cache\optiscaler_downloads -r
rm test_env\cache\extracted -r
mkdir test_env\cache\optiscaler_downloads
mkdir test_env\cache\extracted- Fully excluded from git repository
- No risk of committing test files
- Can contain large binary files
- Multiple developers can have different setups
- Clear separation of concerns
- Fixtures for reference data
- Mock games for testing
- Cache for automatic files
- Outputs for results
- Detailed README in test_env/
- Setup guide with examples
- Quick reference card
- Troubleshooting section
- CI/CD integration examples
- Single setup command
- Two scripts (PowerShell + Batch)
- Clear directory names
- Sample configurations included
- Test data isolated from source code
- Cache kept separate
- Results in dedicated outputs folder
- Easy to reset and clean
| File | Change |
|---|---|
.gitignore |
Added test_env/ exclusion (1 line) |
New: setup_test_env.ps1 |
PowerShell setup script (3926 bytes) |
New: setup_test_env.bat |
Batch setup script (2781 bytes) |
New: docs/test_env/TEST_ENV_SETUP.md |
Full setup guide (6025 bytes) |
New: docs/test_env/TEST_ENV_QUICK_REF.md |
Quick reference (1807 bytes) |
New: test_env/README.md |
In-directory documentation |
New: test_env/fixtures/OptiScaler.ini.sample |
Sample config |
New: test_env/fixtures/archives/ |
Archive directory |
New: test_env/fixtures/ini_configs/ |
Config directory |
New: test_env/mock_games/ |
Mock games directory |
New: test_env/cache/ |
Cache directory |
New: test_env/outputs/ |
Results directory |
test_env = Path("./test_env")
fixture_data = test_env / "fixtures" / "archives"game_path = Path("./test_env/mock_games/TestGame")
manager = OptiScalerManager(download_dir=str(test_env / "cache"))game_scanner = GameScanner()
game_scanner.base_path = Path("./test_env/mock_games")The test environment can be integrated into CI/CD:
- Scripts create fresh test_env on each run
- Tests use test_env for isolation
- Results saved to
test_env/outputs/ - No cache carries over between runs
- Can be uploaded as artifacts
Example CI setup provided in docs/test_env/TEST_ENV_SETUP.md.
- ✅ Test environment created and initialized
- 📝 Add your test data to
test_env/fixtures/ - 🎮 Create mock games in
test_env/mock_games/ - 🧪 Write tests using fixtures
- 📊 Review results in
test_env/outputs/ - 🔄 Clean cache between test runs
- Run
.\setup_test_env.ps1 - Read
docs/test_env/TEST_ENV_SETUP.mdfor details - Create first mock game directory
- Copy test archives to
test_env/fixtures/archives/ - Run a test with test environment
- Check results in
test_env/outputs/
| Document | Purpose |
|---|---|
.gitignore |
Excludes test_env from git |
docs/test_env/TEST_ENV_QUICK_REF.md |
One-page reference (START HERE) |
docs/test_env/TEST_ENV_SETUP.md |
Complete setup guide |
test_env/README.md |
Detailed test environment docs |
setup_test_env.ps1 |
PowerShell setup |
setup_test_env.bat |
Batch setup |
Status: Ready for use
Created: November 13, 2025
Verified: All directories created, git exclusion in place, documentation complete