🧪 Manual Test Suite Selector #64
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 🧪 Manual Test Suite Selector | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| run_all: | |
| description: '✅ Run ALL tests (overrides individual selectors)' | |
| type: boolean | |
| default: false | |
| run_scan: | |
| description: '📂 scan/ (Scan, Logic, Locks, IPs)' | |
| type: boolean | |
| default: true | |
| run_api: | |
| description: '📂 api_endpoints/ & server/ (Endpoints & Server)' | |
| type: boolean | |
| default: false | |
| run_backend: | |
| description: '📂 backend/ & db/ (SQL Builder, Security & Migration)' | |
| type: boolean | |
| default: false | |
| run_docker_env: | |
| description: '📂 docker_tests/ (Environment & PUID/PGID)' | |
| type: boolean | |
| default: false | |
| run_ui: | |
| description: '📂 ui/ (Selenium & Dashboard)' | |
| type: boolean | |
| default: false | |
| run_plugins: | |
| description: '📂 plugins/ (Sync insert schema-aware logic)' | |
| type: boolean | |
| default: false | |
| run_root_files: | |
| description: '📄 Root Test Files (WOL, Atomicity, etc.)' | |
| type: boolean | |
| default: false | |
| jobs: | |
| comprehensive-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Set up Environment | |
| run: sudo apt-get update && sudo apt-get install -y sqlite3 | |
| - name: Build Test Path Command | |
| id: builder | |
| run: | | |
| PATHS="" | |
| # run_all overrides everything | |
| if [ "${{ github.event.inputs.run_all }}" == "true" ]; then | |
| echo "final_paths=test/" >> $GITHUB_OUTPUT | |
| exit 0 | |
| fi | |
| # Folder Mapping with 'test/' prefix | |
| if [ "${{ github.event.inputs.run_scan }}" == "true" ]; then PATHS="$PATHS test/scan/"; fi | |
| if [ "${{ github.event.inputs.run_api }}" == "true" ]; then PATHS="$PATHS test/api_endpoints/ test/server/"; fi | |
| if [ "${{ github.event.inputs.run_backend }}" == "true" ]; then PATHS="$PATHS test/backend/ test/db/"; fi | |
| if [ "${{ github.event.inputs.run_docker_env }}" == "true" ]; then PATHS="$PATHS test/docker_tests/"; fi | |
| if [ "${{ github.event.inputs.run_ui }}" == "true" ]; then PATHS="$PATHS test/ui/"; fi | |
| if [ "${{ github.event.inputs.run_plugins }}" == "true" ]; then PATHS="$PATHS test/plugins/"; fi | |
| # Root Files Mapping (files sitting directly in /test/) | |
| if [ "${{ github.event.inputs.run_root_files }}" == "true" ]; then | |
| PATHS="$PATHS test/test_device_atomicity.py test/test_mcp_disablement.py test/test_plugin_helper.py test/test_wol_validation.py" | |
| fi | |
| # If nothing is selected, default to the whole test folder | |
| if [ -z "$PATHS" ]; then PATHS="test/"; fi | |
| echo "final_paths=$PATHS" >> $GITHUB_OUTPUT | |
| - name: Run Docker Integration Script | |
| run: | | |
| chmod +x ./scripts/run_tests_in_docker_environment.sh | |
| # We update the pytest command to use the specific paths built above. | |
| # Note: We still keep your 'not' filter to skip E2E tests unless you want them. | |
| TARGET_PATHS="${{ steps.builder.outputs.final_paths }}" | |
| SED_COMMAND="pytest $TARGET_PATHS -m 'not (docker or compose or feature_complete)'" | |
| echo "🚀 Targeted Pytest Command: $SED_COMMAND" | |
| sed -i "s|pytest -m 'not (docker or compose or feature_complete)'|$SED_COMMAND|g" ./scripts/run_tests_in_docker_environment.sh | |
| ./scripts/run_tests_in_docker_environment.sh | |
| - name: Cleanup | |
| if: always() | |
| run: | | |
| docker stop netalertx-test-container || true | |
| docker rm netalertx-test-container || true |