mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-07-12 16:57:41 -04:00
Update test suite configuration and enhance test assertions
- Changed the test suite name for clarity. - Updated default behavior for running all tests in the workflow. - Improved logging in the Docker test script for better debugging. - Modified assertions in Nginx proxy security tests to ensure access is not blocked. - Added exception handling in UI tests to skip tests when elements are not found.
This commit is contained in:
39
.github/workflows/run-all-tests.yml
vendored
39
.github/workflows/run-all-tests.yml
vendored
@@ -1,12 +1,15 @@
|
||||
name: 🧪 Manual Test Suite Selector
|
||||
name: 🧪 Test Suite
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
run_all:
|
||||
description: '✅ Run ALL tests (overrides individual selectors)'
|
||||
type: boolean
|
||||
default: false
|
||||
default: true
|
||||
run_scan:
|
||||
description: '📂 scan/ (Scan, Logic, Locks, IPs)'
|
||||
type: boolean
|
||||
@@ -48,25 +51,41 @@ jobs:
|
||||
|
||||
- name: Build Test Path Command
|
||||
id: builder
|
||||
env:
|
||||
INPUT_EVENT_NAME: ${{ github.event_name }}
|
||||
INPUT_RUN_ALL: ${{ github.event.inputs.run_all }}
|
||||
INPUT_RUN_SCAN: ${{ github.event.inputs.run_scan }}
|
||||
INPUT_RUN_API: ${{ github.event.inputs.run_api }}
|
||||
INPUT_RUN_BACKEND: ${{ github.event.inputs.run_backend }}
|
||||
INPUT_RUN_DOCKER_ENV: ${{ github.event.inputs.run_docker_env }}
|
||||
INPUT_RUN_UI: ${{ github.event.inputs.run_ui }}
|
||||
INPUT_RUN_PLUGINS: ${{ github.event.inputs.run_plugins }}
|
||||
INPUT_RUN_ROOT_FILES: ${{ github.event.inputs.run_root_files }}
|
||||
run: |
|
||||
PATHS=""
|
||||
|
||||
# Always run all tests on pull_request events
|
||||
if [ "$INPUT_EVENT_NAME" == "pull_request" ]; then
|
||||
echo "final_paths=test/" >> $GITHUB_OUTPUT
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# run_all overrides everything
|
||||
if [ "${{ github.event.inputs.run_all }}" == "true" ]; then
|
||||
if [ "$INPUT_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
|
||||
if [ "$INPUT_RUN_SCAN" == "true" ]; then PATHS="$PATHS test/scan/"; fi
|
||||
if [ "$INPUT_RUN_API" == "true" ]; then PATHS="$PATHS test/api_endpoints/ test/server/"; fi
|
||||
if [ "$INPUT_RUN_BACKEND" == "true" ]; then PATHS="$PATHS test/backend/ test/db/"; fi
|
||||
if [ "$INPUT_RUN_DOCKER_ENV" == "true" ]; then PATHS="$PATHS test/docker_tests/"; fi
|
||||
if [ "$INPUT_RUN_UI" == "true" ]; then PATHS="$PATHS test/ui/"; fi
|
||||
if [ "$INPUT_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
|
||||
if [ "$INPUT_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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user