Adds ~800 new tests (incl. 27 StreamData properties) across 22 modules
that previously had little or no coverage. Highlights:
- Pure utility modules (LogSanitizer, PacketFieldWhitelist,
PacketSanitizer, DeviceParser, CoordinateUtils, BoundsUtils,
ParamUtils, Convert, WeatherUnits) get thorough unit + property
coverage including UTF-8 truncation boundaries, antimeridian
longitude wrap, Haversine symmetry, and unit-conversion inverses.
- JSON view modules (CallsignJSON, ErrorJSON, ChangesetJSON) verified
for envelope shape and error templating.
- Plugs (HealthCheck, RateLimiter, ApiCSRF) exercised for happy-path
and halt paths.
- GenServer modules (RegexCache, CleanupScheduler, DeploymentNotifier)
tested without touching the supervised singleton where possible.
- Drops the orphaned map_live/map_helpers_test.exs whose module name
collided with the new live/shared/coordinate_utils_test.exs.
- Add Phoenix.LiveViewTest import to ConnCase to fix warnings
- Disable AppSignal in dev and test (only enable in prod)
- Explicitly disable clustering in test environment
- Fix PacketDistributor to check cluster_enabled before calling LeaderElection
- Add Phoenix.CodeReloader listener to mix.exs
This prevents tests from trying to call cluster-specific GenServers
(ConnectionMonitor, LeaderElection) that don't exist in test mode.
- Fix unsubscribe_from_bounds -> unsubscribe (function doesn't exist)
- Fix search_callsign query to use 'lon' instead of 'lng' field
- Add comprehensive test suite for mobile channel:
- Join and subscription tests
- Bounds validation tests
- Callsign search tests
- Callsign tracking tests
- Streaming packet tests
- Packet data format tests
- 29 tests total, all passing
Created test/support/channel_case.ex for channel testing infrastructure.
Generated with Claude Code https://claude.com/claude-code
- Fix duplicate bad packet storage in store_packet function
- Changed insert_packet to return specific error tuples
- Handle validation_error and storage_exception separately
- Prevent double storage of bad packets
- Add try/catch wrapper around insert_packet for exception handling
- Properly catch and return storage_exception errors
- Test now correctly expects :storage_exception
- Add helper function for LiveView tests with duplicate IDs
- Added live_with_warn/2 to ConnCase
- Suppress duplicate ID warnings in integration tests
- Fix unused variable warning in insert_packet
All packet tests now pass without failures.
The integration tests were failing because historical packets weren't
loading automatically. The tests needed to properly trigger the bounds
update event after the map initializes.
Changes:
- Add PostGIS location field to packet fixtures when lat/lon are provided
- Execute JavaScript to manually trigger bounds update after map loads
- This ensures the sendBoundsToServer function is called
- Adjusted timing to wait for map initialization before triggering
This should make the integration tests more reliable by ensuring
historical packets are loaded after the map is ready.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit includes several critical fixes and optimizations:
## Production Buffer Overflow Fix
- Fixed telemetry_vals data type conversion from strings to integers
- Enhanced put_telemetry_fields() with robust type conversion logic
- Handles mixed data types (string, integer, float) gracefully
- Prevents PacketConsumer GenServer crashes that caused buffer overflow
- Processes telemetry from both data_extended and top-level attrs
## Test Suite Performance Optimization
- Improved test execution speed by 48% (43.2s → 24.1s)
- Increased parallelization: max_cases from 16 to 48
- Optimized database connections and reduced timeouts
- Tagged slow tests and exclude them by default for fast development
- Fixed device seeding to only run when needed
- Enhanced log capture for packet consumer tests
## Code Quality Improvements
- Fixed handle_info clause grouping in LeaderElection
- Ensures mix compile --warnings-as-errors passes
- Added comprehensive telemetry conversion tests
- Improved test reliability and reduced flakiness
## Infrastructure Updates
- Added migration init container to StatefulSet for automatic schema updates
- Disabled AUTO_MIGRATE in main container (handled by init container)
- Created .test-commands with helpful test aliases
This resolves production stability issues and significantly improves development workflow.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Major performance improvements to test execution:
- Increase max_cases from 16 to 48 for better parallelization
- Increase DB pool size for concurrent tests
- Reduce DB timeouts and enable queue optimization
- Disable logging during tests (level: :error)
- Tag slow tests and exclude them by default
- Only seed devices for tests that need them
- Fixed log capture test for packet consumer
- Fixed flaky leader election test with proper timing
Performance improvements:
- Fast tests: 43.2s -> 24.1s (48% faster)
- All tests still pass with --exclude flags removed
- Created .test-commands with helpful aliases
Usage:
- mix test --exclude slow --exclude integration # Fast development tests
- mix test # All tests including slow ones
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Remove all CachedQueries usage throughout the codebase
- Replace with direct Packets module calls
- Delete CachedQueries module entirely
- Rename get_recent_packets_optimized to get_recent_packets
- Add has_weather_packets? function to Packets module
- Fix duplicate function definitions
- Update all test references to use new function names
This simplifies the codebase by removing the caching layer and
eliminates the database ownership errors in tests.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>