Skip to content

feat: docker-based testing#1299

Merged
jokob-sk merged 4 commits intonetalertx:mainfrom
adamoutler:main
Nov 20, 2025
Merged

feat: docker-based testing#1299
jokob-sk merged 4 commits intonetalertx:mainfrom
adamoutler:main

Conversation

@adamoutler
Copy link
Member

@adamoutler adamoutler commented Nov 20, 2025

This pull request introduces a robust, containerized testing strategy for the NetAlertX project, ensuring consistent and reliable test execution for CI/CD pipelines in GitHub Actions.

Key Changes:

  1. Docker-based Test Script (run_docker_tests.sh):

    • A new script, run_docker_tests.sh, has been added to automate the entire testing process within a Docker environment that mirrors the project's devcontainer.
    • This script handles the complete test lifecycle: building the Docker image, starting services, installing dependencies, waiting for the application to be healthy, executing the pytest suite, and cleaning up resources.
  2. GitHub Actions Workflow Update (.github/workflows/code_checks.yml):

    • The test job in the code_checks.yml workflow has been updated to execute the new run_docker_tests.sh script. This replaces the previous native test run, leveraging the containerized environment for consistency.
    • The job name has been renamed to docker-tests for clarity and to resolve a potential conflict.
    • A minor quoting issue in the check-url-paths job's grep command was also fixed.
  3. Environment and Test Fixes:

    • The test script now correctly excludes tests marked as feature_complete, in addition to docker and compose.
    • A workaround has been implemented to pre-emptively insert a dummy "internet" device into the database before tests are run. This resolves a persistent flaky test failure in test_wakeonlan_device which was caused by its dependency on an
      unpredictable database state.

Benefits:

  • CI/CD Reliability: By running tests in a self-contained Docker environment, we ensure that the CI pipeline is consistent and not affected by changes in the underlying GitHub Actions runner environment.
  • Developer Consistency: The testing process is now identical between local development (via devcontainer) and the CI pipeline, reducing "it works on my machine" issues.
  • Improved Maintainability: The entire testing setup is now managed by the run_docker_tests.sh script, making it easier to maintain and evolve the testing process.

This pull request significantly improves the project's testing infrastructure, providing a stable foundation for future development.

Summary by CodeRabbit

  • New Features

    • Device database now records a parent relationship type for richer device hierarchy metadata.
  • Tests

    • CI switched to a docker-based test job with a new script to run end-to-end tests inside a dev container.
    • URL-check pattern in CI adjusted to improve frontend path detection.
  • Chores

    • Development container now uses a fixed development version placeholder and fixed ownership for version files.

✏️ Tip: You can customize this high-level summary in your review settings.

Introduces a comprehensive script to build, run, and test NetAlertX within a Dockerized devcontainer environment, replicating the setup defined in . This script ensures consistency for CI/CD pipelines and local development.

The script addresses several environmental challenges:
- Properly builds the  Docker image.
- Starts the container with necessary capabilities and host-gateway.
- Installs Python test dependencies (, , ) into the virtual environment.
- Executes the  script to initialize services.
- Implements a healthcheck loop to wait for services to become fully operational before running tests.
- Configures  to use a writable cache directory () to avoid permission issues.
- Includes a workaround to insert a dummy 'internet' device into the database, resolving a flakiness in  caused by its reliance on unpredictable database state without altering any project code.

This script ensures a green test suite, making it suitable for automated testing in environments like GitHub Actions.
Uses the new run_docker_tests.sh script which is self-contained and handles all dependencies and test execution within a Docker container. This ensures that the CI environment is consistent with the local devcontainer environment.

Fixes an issue where the job name 'test' was considered invalid. Renamed to 'docker-tests'.
Ensures that tests marked as 'feature_complete' are also excluded from the test run.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 20, 2025

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'feat: docker-based testing' accurately captures the main objective of introducing Docker-based testing infrastructure as described in the PR objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
run_docker_tests.sh (1)

72-74: Database workaround supports test stability with clear semantics.

Inserting a dummy "internet" device via INSERT OR IGNORE provides a stable baseline for flaky tests while maintaining idempotency. However, this pattern should be documented in a code comment or in test fixtures to clarify the intent for future maintainers, especially if the underlying flakiness in test_wakeonlan_device is later resolved.

Consider adding a clarifying comment above this section explaining the flakiness it addresses:

 # --- 8. Manipulate Database for Flaky Test ---
 echo "--- Inserting 'internet' device into database for flaky test ---"
+# Workaround: test_wakeonlan_device is flaky due to unpredictable DB state.
+# Ensuring a stable 'internet' device row prevents spurious failures.
 docker exec netalertx-test-container /bin/bash -c " \
     sqlite3 /data/db/app.db \"INSERT OR IGNORE INTO Devices (devMac, devFirstConnection, devLastConnection, devLastIP, devName) VALUES ('internet', DATETIME('now'), DATETIME('now'), '0.0.0.0', 'Internet Gateway');\" \
 "
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9a4fb35 and e0c9605.

📒 Files selected for processing (4)
  • .devcontainer/Dockerfile (1 hunks)
  • .github/workflows/code_checks.yml (2 hunks)
  • install/production-filesystem/entrypoint.d/20-first-run-db.sh (1 hunks)
  • run_docker_tests.sh (1 hunks)
🧰 Additional context used
🧠 Learnings (10)
📓 Common learnings
Learnt from: adamoutler
Repo: jokob-sk/NetAlertX PR: 1184
File: .devcontainer/Dockerfile:18-19
Timestamp: 2025-09-20T03:01:19.912Z
Learning: In the NetAlertX repository, .devcontainer/Dockerfile is auto-generated and should not be reviewed directly. Review comments about dependencies and build steps should be directed at the root Dockerfile where the actual source commands are located.
📚 Learning: 2025-09-20T03:01:19.912Z
Learnt from: adamoutler
Repo: jokob-sk/NetAlertX PR: 1184
File: .devcontainer/Dockerfile:18-19
Timestamp: 2025-09-20T03:01:19.912Z
Learning: In the NetAlertX repository, .devcontainer/Dockerfile is auto-generated and should not be reviewed directly. Review comments about dependencies and build steps should be directed at the root Dockerfile where the actual source commands are located.

Applied to files:

  • run_docker_tests.sh
  • .devcontainer/Dockerfile
📚 Learning: 2025-09-20T02:56:24.501Z
Learnt from: adamoutler
Repo: jokob-sk/NetAlertX PR: 1184
File: .devcontainer/devcontainer.json:5-8
Timestamp: 2025-09-20T02:56:24.501Z
Learning: In the NetAlertX devcontainer setup, the final .devcontainer/Dockerfile is generated by combining the root Dockerfile with .devcontainer/resources/devcontainer-Dockerfile using the generate-dockerfile.sh script. The devcontainer.json should reference the generated file, not the root Dockerfile.

Applied to files:

  • run_docker_tests.sh
  • .devcontainer/Dockerfile
📚 Learning: 2025-10-26T17:09:18.621Z
Learnt from: adamoutler
Repo: jokob-sk/NetAlertX PR: 1235
File: .devcontainer/scripts/setup.sh:146-148
Timestamp: 2025-10-26T17:09:18.621Z
Learning: In `.devcontainer/scripts/setup.sh` and other devcontainer setup scripts for NetAlertX, chmod 666 on /var/run/docker.sock is acceptable because devcontainer environments are single-user development contexts where convenience can take priority over strict permission hardening.

Applied to files:

  • run_docker_tests.sh
  • .devcontainer/Dockerfile
📚 Learning: 2025-09-20T14:08:44.292Z
Learnt from: adamoutler
Repo: jokob-sk/NetAlertX PR: 1184
File: .devcontainer/scripts/stream-logs.sh:5-6
Timestamp: 2025-09-20T14:08:44.292Z
Learning: The .devcontainer/scripts/stream-logs.sh script in NetAlertX is designed as a diagnostic tool for troubleshooting devcontainer startup issues. When log files don't exist, this indicates that the executable/services didn't start properly, which is valuable diagnostic information. Pre-creating missing files would mask this diagnostic behavior.

Applied to files:

  • run_docker_tests.sh
  • .devcontainer/Dockerfile
📚 Learning: 2025-10-19T01:40:57.095Z
Learnt from: adamoutler
Repo: jokob-sk/NetAlertX PR: 1230
File: .devcontainer/resources/devcontainer-overlay/services/config/nginx/netalertx.conf.template:1-2
Timestamp: 2025-10-19T01:40:57.095Z
Learning: In the NetAlertX repository, .devcontainer/resources/devcontainer-overlay/services/config/nginx/netalertx.conf.template is an auto-generated file that is intentionally committed to source control. It cannot be regenerated automatically outside the devcontainer environment and is required for the devcontainer to start, creating a bootstrap dependency.

Applied to files:

  • .devcontainer/Dockerfile
📚 Learning: 2025-09-20T14:09:29.159Z
Learnt from: adamoutler
Repo: jokob-sk/NetAlertX PR: 1184
File: .devcontainer/scripts/setup.sh:103-116
Timestamp: 2025-09-20T14:09:29.159Z
Learning: In NetAlertX devcontainer setup, the netalertx user has write permissions to /var/log/nginx/ directory as it's explicitly chowned to netalertx:www-data in the Dockerfile, so setup.sh can write to nginx log files without sudo.

Applied to files:

  • .devcontainer/Dockerfile
📚 Learning: 2025-09-20T14:08:48.256Z
Learnt from: adamoutler
Repo: jokob-sk/NetAlertX PR: 1184
File: .devcontainer/scripts/setup.sh:90-96
Timestamp: 2025-09-20T14:08:48.256Z
Learning: In the NetAlertX devcontainer setup, the setup.sh script intentionally removes user_notifications.json from the API directory during development environment initialization to prevent notification clutter that accumulates during container launches and development work.

Applied to files:

  • .devcontainer/Dockerfile
📚 Learning: 2025-09-20T14:08:44.152Z
Learnt from: adamoutler
Repo: jokob-sk/NetAlertX PR: 1184
File: .devcontainer/Dockerfile:82-92
Timestamp: 2025-09-20T14:08:44.152Z
Learning: In devcontainer builds, source repository files are not available during the Docker build phase. The source code gets mounted into the container after it's built and started, so COPY commands referencing source files will fail. Configuration files need to be handled at runtime (e.g., in setup scripts) rather than during the build stage.

Applied to files:

  • .devcontainer/Dockerfile
📚 Learning: 2025-09-20T14:13:33.635Z
Learnt from: adamoutler
Repo: jokob-sk/NetAlertX PR: 1184
File: .devcontainer/Dockerfile:11-16
Timestamp: 2025-09-20T14:13:33.635Z
Learning: In the NetAlertX repository with Alpine 3.22 base image, the `python -m venv` command works correctly in the devcontainer setup, likely due to symlink creation in the root Dockerfile that makes `python` available as an alias to `python3`.

Applied to files:

  • .devcontainer/Dockerfile
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: docker_dev
🔇 Additional comments (11)
install/production-filesystem/entrypoint.d/20-first-run-db.sh (1)

69-69: Schema extension is well-placed and semantically sound.

Adding devParentRelType alongside devParentMAC and devParentPort provides a clean way to describe device relationships. The TEXT type and nullable design allow gradual adoption without breaking existing functionality.

.devcontainer/Dockerfile (1)

1-1: File is auto-generated; review root Dockerfile instead.

Per project conventions, .devcontainer/Dockerfile is auto-generated by .devcontainer/scripts/generate-configs.sh and should not be reviewed directly. Please review the root Dockerfile and .devcontainer/resources/devcontainer-Dockerfile for the actual source changes that produce these modifications.

.github/workflows/code_checks.yml (2)

24-24: Grep pattern improvement enhances readability.

The character class ['"] is clearer than escaped-quote variants and correctly matches both single and double quotes in the URL check. Good fix.


88-98: CI workflow migration to Docker-based testing is well-integrated.

The job rename and delegation to run_docker_tests.sh properly channels all test execution through the new Docker-based strategy, ensuring consistency between CI and local devcontainer testing.

run_docker_tests.sh (7)

10-19: Script validates dependencies and enables fail-fast behavior appropriately.

set -e ensures any command failure exits the script, and the check for generate-configs.sh provides clear error messaging if the prerequisite is missing. Good defensive programming.


15-15: Verify intent behind regenerating Devcontainer Dockerfile on each test run.

Line 15 calls generate-configs.sh to rebuild .devcontainer/Dockerfile before each test. While the script is marked idempotent, this regeneration step may have overhead in CI where the config is unlikely to change between runs. Please confirm this is intentional for maintaining consistency, or consider caching the generated artifact.


31-42: Container capabilities and mounts are appropriate for testing network scanning tools.

The combination of SYS_ADMIN, NET_ADMIN, NET_RAW capabilities and apparmor=unconfined enables the network scanning functionality required by NetAlertX. The docker.sock mount is necessary for container-level operations, and the workspaces mount enables live test code evaluation.


46-46: Confirm --ignore-installed pip flag aligns with test environment requirements.

The --ignore-installed flag forces reinstallation of all test dependencies on every run, ensuring a clean environment but incurring overhead. Please confirm this performance tradeoff is acceptable for your CI/test cycle, or consider using a --upgrade strategy instead if package freshness is the primary concern.


53-67: Health check polling is well-designed with proper timeout and diagnostics.

The 120-second health check loop with per-second polling provides a good balance between responsiveness and overhead. Logging container output on timeout (line 62) is excellent for debugging failed startup sequences.


78-80: Test marker filtering is correct and well-aligned with PR scope.

The pytest marker expression -m 'not (docker or compose or feature_complete)' appropriately excludes integration and incomplete tests from this container test run, focusing on unit-level functionality that should pass in a clean environment.


84-87: Teardown is clean and reliable.

Simple docker stop and docker rm complete the container lifecycle. No orphaned processes or lingering volumes.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e0c9605 and aee5e04.

📒 Files selected for processing (1)
  • .github/workflows/code_checks.yml (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: adamoutler
Repo: jokob-sk/NetAlertX PR: 1184
File: .devcontainer/Dockerfile:18-19
Timestamp: 2025-09-20T03:01:19.912Z
Learning: In the NetAlertX repository, .devcontainer/Dockerfile is auto-generated and should not be reviewed directly. Review comments about dependencies and build steps should be directed at the root Dockerfile where the actual source commands are located.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: docker_dev
🔇 Additional comments (1)
.github/workflows/code_checks.yml (1)

88-98: All verification concerns confirmed—no issues found.

The run_docker_tests.sh script is properly integrated with comprehensive error handling:

  • Script exists and is tracked as executable (git mode 100755)
  • Error handling is robust: set -e flag, explicit dependency checks (exit 1), timeout mechanism (120s health check), and logs on failure
  • Docker is standard in ubuntu-latest runners, requiring no additional setup
  • Test failures are properly reported back to the workflow through multiple exit paths

The chmod +x command in the workflow is redundant since git already tracks the executable bit, but this is harmless and doesn't affect functionality.

echo "🔍 Checking for incorrect absolute '/php/' URLs (should be 'php/' or './php/')..."

MATCHES=$(grep -rE "['\"]\/php\/" --include=\*.{js,php,html} ./front | grep -E "\.get|\.post|\.ajax|fetch|url\s*:") || true
MATCHES=$(grep -rE "[\"']/\/php\/" --include=*.{js,php,html} ./front | grep -E "\.get|\.post|\.ajax|fetch|url\s*:") || true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify the grep regex pattern detects absolute /php/ URLs correctly.

The grep pattern [\"']/\/php\/ in extended regex may have unintended behavior. In extended regex (-E), forward slashes don't require escaping, so \/ is interpreted as a literal forward slash. This means the pattern effectively searches for quote + // + php + / (double slashes), which may not match intended absolute URLs like "/php/..." (single slash).

Verify that this pattern correctly detects absolute URLs by testing it against actual frontend code, or simplify it to ["']/php/ if that was the intent.


🏁 Script executed:

#!/bin/bash
# Test the current grep pattern against a sample file with known patterns

# Create a test file with various URL patterns
cat > /tmp/test_urls.js << 'EOF'
// These should be caught (absolute URLs)
fetch("/php/api/endpoint")
$.get("/php/config")
$.ajax({url: "/php/data"})

// These should NOT be caught (relative URLs)
fetch("php/api/endpoint")
$.get("./php/config")
$.ajax({url: "php/data"})

// Edge case - double slash (check if intentional)
fetch("//php/external")
EOF

echo "=== Testing current pattern: [\"']/\/php\/ ==="
grep -E "[\"']/\/php\/" /tmp/test_urls.js | head -5

echo ""
echo "=== Testing simplified pattern: [\"']/php/ ==="
grep -E "[\"']/php/" /tmp/test_urls.js | head -5

rm /tmp/test_urls.js

Length of output: 191


Fix grep regex pattern to correctly detect absolute /php/ URLs.

The current pattern [\"']/\/php\/ incorrectly matches double-slash URLs (//php/) because forward slashes don't need escaping in extended regex. Testing confirms it only catches fetch("//php/external") but misses intended single-slash absolute URLs like fetch("/php/api/endpoint").

Change line 24 to use the simplified pattern:

MATCHES=$(grep -rE "[\"']/php/" --include=*.{js,php,html} ./front | grep -E "\.get|\.post|\.ajax|fetch|url\s*:") || true

This will correctly detect absolute /php/ URLs as intended.

🤖 Prompt for AI Agents
.github/workflows/code_checks.yml around line 24: the grep pattern currently
escapes slashes and thus incorrectly allows matching double-slash URLs like
//php/, so update the regex to look for an actual single leading slash by
changing the pattern to use /php/ (i.e. replace "[\"']/\/php\/" with
"[\"']/php/") in the MATCHES assignment so grep correctly detects absolute
"/php/" URLs; keep the rest of the pipeline (include list and subsequent grep)
unchanged.

@adamoutler
Copy link
Member Author

adamoutler commented Nov 20, 2025

This was an easy CodeRabbit review. Looks good to me. Please check out the lint logs Once these python lint issues are corrected, we can enable it to fail on violation. Right now all lint checks are merely a suggestion and will continue-on-error: true. I'll go ahead and take care of the shellcheck & docker items. I caused many if not most of them with my sloppy BASH scripting. It looks like PHP is already good to go and can be continue-on-error: false

@jokob-sk jokob-sk merged commit 995c371 into netalertx:main Nov 20, 2025
6 checks passed
@jokob-sk
Copy link
Collaborator

Thanks a lot @adamoutler 🙏

@jokob-sk
Copy link
Collaborator

Looks pretty good:


collected 196 items / 48 deselected / 148 selected

test/api_endpoints/test_dbquery_endpoints.py ....                        [  2%]
test/api_endpoints/test_device_endpoints.py .......                      [  7%]
test/api_endpoints/test_devices_endpoints.py ...........                 [ 14%]
test/api_endpoints/test_events_endpoints.py .....                        [ 18%]
test/api_endpoints/test_graphq_endpoints.py .......                      [ 22%]
test/api_endpoints/test_history_endpoints.py .                           [ 23%]
test/api_endpoints/test_logs_endpoints.py ....                           [ 26%]
test/api_endpoints/test_messaging_in_app_endpoints.py ......             [ 30%]
test/api_endpoints/test_nettools_endpoints.py .............              [ 39%]
test/api_endpoints/test_sessions_endpoints.py .......                    [ 43%]
test/api_endpoints/test_settings_endpoints.py ...                        [ 45%]
test/backend/test_compound_conditions.py ...................             [ 58%]
test/backend/test_safe_builder_unit.py ............                      [ 66%]
test/backend/test_sql_injection_prevention.py ...................        [ 79%]
test/backend/test_sql_security.py ...................s..                 [ 94%]
test/docker_tests/test_mount_diagnostics_pytest.py .
test/integration/test_sql_injection_fix.py ...                           [ 97%]
test/test_graphq_endpoints.py ....                                       [100%]

=============================== warnings summary ===============================
test/backend/test_safe_builder_unit.py:16
  /workspaces/NetAlertX/test/backend/test_safe_builder_unit.py:16: PytestCollectionWarning: cannot collect test class 'TestSafeConditionBuilder' because it has a __init__ constructor (from: test/backend/test_safe_builder_unit.py)
    class TestSafeConditionBuilder:

test/api_endpoints/test_events_endpoints.py::test_create_event
test/api_endpoints/test_events_endpoints.py::test_delete_events_for_mac
test/api_endpoints/test_events_endpoints.py::test_delete_all_events
test/api_endpoints/test_events_endpoints.py::test_delete_all_events
test/api_endpoints/test_events_endpoints.py::test_delete_events_dynamic_days
test/api_endpoints/test_events_endpoints.py::test_delete_events_dynamic_days
  /app/server/api_server/events_endpoint.py:42: DeprecationWarning: The default datetime adapter is deprecated as of Python 3.12; see the sqlite3 documentation for suggested replacement recipes
    cur.execute(

test/integration/test_sql_injection_fix.py::test_datetime_injection_fix
  /opt/venv/lib/python3.12/site-packages/_pytest/python.py:170: PytestReturnNotNoneWarning: Test functions should return None, but test/integration/test_sql_injection_fix.py::test_datetime_injection_fix returned <class 'bool'>.
  Did you mean to use `assert` instead of `return`?
  See https://docs.pytest.org/en/stable/how-to/assert.html#return-not-none for more information.
    warnings.warn(

test/integration/test_sql_injection_fix.py::test_notification_instance_fix
  /opt/venv/lib/python3.12/site-packages/_pytest/python.py:170: PytestReturnNotNoneWarning: Test functions should return None, but test/integration/test_sql_injection_fix.py::test_notification_instance_fix returned <class 'bool'>.
  Did you mean to use `assert` instead of `return`?
  See https://docs.pytest.org/en/stable/how-to/assert.html#return-not-none for more information.
    warnings.warn(

test/integration/test_sql_injection_fix.py::test_code_quality
  /opt/venv/lib/python3.12/site-packages/_pytest/python.py:170: PytestReturnNotNoneWarning: Test functions should return None, but test/integration/test_sql_injection_fix.py::test_code_quality returned <class 'bool'>.
  Did you mean to use `assert` instead of `return`?
  See https://docs.pytest.org/en/stable/how-to/assert.html#return-not-none for more information.
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========= 147 passed, 1 skipped, 48 deselected, 10 warnings in 12.53s ==========

@adamoutler
Copy link
Member Author

adamoutler commented Nov 20, 2025

Those unit tests still need attention . We talked about them previously. They assert to false. I made them return false instead. I'm pretty sure they asserted false to start with. I have a lot of questions there but I have not dug into them. I can tell you for sure the lint is a problem.

@jokob-sk
Copy link
Collaborator

Thanks -- pushed a few fixes, getting closer

 test/api_endpoints/test_dbquery_endpoints.py ....                        [  2%]
test/api_endpoints/test_device_endpoints.py .......                      [  7%]
test/api_endpoints/test_devices_endpoints.py ...........                 [ 14%]
test/api_endpoints/test_events_endpoints.py .....                        [ 18%]
test/api_endpoints/test_graphq_endpoints.py .......                      [ 22%]
test/api_endpoints/test_history_endpoints.py .                           [ 23%]
test/api_endpoints/test_logs_endpoints.py ....                           [ 26%]
test/api_endpoints/test_messaging_in_app_endpoints.py ......             [ 30%]
test/api_endpoints/test_nettools_endpoints.py .............              [ 38%]
test/api_endpoints/test_sessions_endpoints.py .......                    [ 43%]
test/api_endpoints/test_settings_endpoints.py ...                        [ 45%]
test/backend/test_compound_conditions.py ...................             [ 58%]
test/backend/test_safe_builder_unit.py .................                 [ 69%]
test/backend/test_sql_injection_prevention.py ...................        [ 82%]
test/backend/test_sql_security.py ...................s..                 [ 96%]
test/docker_tests/test_mount_diagnostics_pytest.py .
test/test_graphq_endpoints.py ....                                       [100%]

=============================== warnings summary ===============================
test/api_endpoints/test_events_endpoints.py::test_create_event
test/api_endpoints/test_events_endpoints.py::test_delete_events_for_mac
test/api_endpoints/test_events_endpoints.py::test_delete_all_events
test/api_endpoints/test_events_endpoints.py::test_delete_all_events
test/api_endpoints/test_events_endpoints.py::test_delete_events_dynamic_days
test/api_endpoints/test_events_endpoints.py::test_delete_events_dynamic_days
  /app/server/api_server/events_endpoint.py:42: DeprecationWarning: The default datetime adapter is deprecated as of Python 3.12; see the sqlite3 documentation for suggested replacement recipes
    cur.execute(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========== 149 passed, 1 skipped, 48 deselected, 6 warnings in 18.48s ==========
--- Tearing down the test container ---
netalertx-test-container
netalertx-test-container
--- Test run complete! ---

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants