Skip to content

MQTT bridge and subscriber test cases#348

Merged
OutOfBedlam merged 6 commits intomainfrom
dev-docker-test
Mar 14, 2026
Merged

MQTT bridge and subscriber test cases#348
OutOfBedlam merged 6 commits intomainfrom
dev-docker-test

Conversation

@OutOfBedlam
Copy link
Contributor

This pull request introduces several improvements and new features related to MQTT integration and testing infrastructure, as well as enhancements to cross-platform test reliability. The key changes include the addition of new embedded shell commands (mqtt_pub and sleep), updates to documentation for consistency, enhancements to integration tests for MQTT workflows, and improved handling of platform-specific test execution.

New embedded shell commands:

  • Added a new mqtt_pub command-line utility (jsh/root/embed/sbin/mqtt_pub.js) for publishing MQTT messages, supporting options for topic, broker, message/file input, QoS, and debug output.
  • Added a new sleep command-line utility (jsh/root/embed/sbin/sleep.js) for pausing execution, useful in integration tests.

Integration test enhancements:

  • Expanded MQTT integration tests in mods/server/server_test.go to:
    • Use the new mqtt_pub and sleep commands for end-to-end testing of publishing and subscribing.
    • Add checks to verify that published messages are correctly written to the database and clean up after tests.
    • Update the subscriber test to use db/write/example instead of db/append/example:csv for better correctness.
    • Mount a custom Mosquitto configuration file for the MQTT broker container to allow unauthenticated access. [1] [2]

Test infrastructure and reliability:

  • Added platform checks to skip Docker-based PostgreSQL tests on Windows and macOS CI environments, improving test reliability across platforms in multiple test files. [1] [2] [3]
  • Ensured the default database is set in test initialization for better test isolation.

Supporting files and configuration:

  • Added a custom Mosquitto configuration file (mods/server/test/mosquitto.conf) for integration tests, enabling anonymous access for test containers.

References:

@codecov
Copy link

codecov bot commented Mar 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.27%. Comparing base (c4e684e) to head (27d6293).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #348   +/-   ##
=======================================
  Coverage   43.27%   43.27%           
=======================================
  Files         329      329           
  Lines       62990    62990           
=======================================
+ Hits        27260    27262    +2     
+ Misses      32536    32535    -1     
+ Partials     3194     3193    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@OutOfBedlam OutOfBedlam merged commit 47401bd into main Mar 14, 2026
15 checks passed
@OutOfBedlam OutOfBedlam deleted the dev-docker-test branch March 14, 2026 11:46
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.

1 participant