- Docker: Delete 23 deprecated Dockerfiles, fix CI/CD to use Dockerfile.foxhunt-build - Config: Remove 36 .env files, keep 4 essential, delete config/environments/ - Docs: Archive 614 Wave D files to docs/archive/wave_d/, 95% reduction in root - Scripts: Delete 56 deprecated scripts, keep 58 production-critical (49% reduction) - Python: Organize 37 scripts into scripts/python/ subdirectories, delete ml/python/ - Build: Remove 1GB artifacts, delete old venvs, clean Python cache from git - Migrations: Delete deprecated directory (4,432 lines), remove duplicate database/migrations/ - Infrastructure: Delete deployment/ (61 files), docs/scripts/ (8 files) Total impact: ~2,500 files cleaned, 750MB+ space freed, zero production impact All deleted scripts backed up to archives. runpod/ and tests/runpod/ preserved. data_acquisition_service retained per user request.
59 lines
2.1 KiB
Bash
Executable File
59 lines
2.1 KiB
Bash
Executable File
#!/bin/bash
|
|
# WAVE 102: Automated Coverage Testing Script
|
|
# Switches to coverage-compatible config, runs coverage, then restores production config
|
|
|
|
set -e
|
|
|
|
echo "🔧 WAVE 102: Coverage Tool Runner"
|
|
echo "================================="
|
|
echo ""
|
|
|
|
# Backup current config
|
|
echo "📦 Backing up current config..."
|
|
cp .cargo/config.toml .cargo/config.toml.backup
|
|
|
|
# Switch to coverage config
|
|
echo "🔄 Switching to coverage-compatible config..."
|
|
cp .cargo/config.toml.coverage .cargo/config.toml
|
|
|
|
# Clean build artifacts
|
|
echo "🧹 Cleaning build artifacts..."
|
|
cargo clean
|
|
|
|
# Run coverage
|
|
echo "📊 Running coverage analysis..."
|
|
if [ "$1" == "--workspace" ]; then
|
|
echo " Target: Entire workspace"
|
|
cargo llvm-cov --workspace --html --output-dir target/coverage --ignore-run-fail
|
|
elif [ -n "$1" ]; then
|
|
echo " Target: Package '$1'"
|
|
cargo llvm-cov --package "$1" --html --output-dir target/coverage --ignore-run-fail
|
|
else
|
|
echo " Target: common (default)"
|
|
cargo llvm-cov --package common --html --output-dir target/coverage --ignore-run-fail
|
|
fi
|
|
|
|
# Generate JSON for parsing
|
|
echo "📝 Generating JSON coverage data..."
|
|
if [ "$1" == "--workspace" ]; then
|
|
cargo llvm-cov --workspace --json --output-path target/coverage/coverage.json --ignore-run-fail 2>/dev/null || echo " (some tests failed, but coverage generated)"
|
|
elif [ -n "$1" ]; then
|
|
cargo llvm-cov --package "$1" --json --output-path target/coverage/"$1".json --ignore-run-fail 2>/dev/null || echo " (some tests failed, but coverage generated)"
|
|
else
|
|
cargo llvm-cov --package common --json --output-path target/coverage/common.json --ignore-run-fail 2>/dev/null || echo " (some tests failed, but coverage generated)"
|
|
fi
|
|
|
|
# Restore original config
|
|
echo "♻️ Restoring production config..."
|
|
cp .cargo/config.toml.backup .cargo/config.toml
|
|
rm .cargo/config.toml.backup
|
|
|
|
echo ""
|
|
echo "✅ Coverage analysis complete!"
|
|
echo " HTML report: target/coverage/html/index.html"
|
|
echo " JSON data: target/coverage/*.json"
|
|
echo ""
|
|
echo "To view HTML report:"
|
|
echo " xdg-open target/coverage/html/index.html"
|
|
echo ""
|