Commit graph

29 commits

Author SHA1 Message Date
4ac70a52c1
fix: Ensure integration tests properly trigger historical packet loading
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>
2025-08-03 15:57:48 -05:00
b5a39102a6
fix: Comprehensive packet processing and test optimization improvements
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>
2025-08-01 17:50:07 -05:00
b9cb8cf1a3
perf: Optimize test suite for maximum speed
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>
2025-08-01 17:43:39 -05:00
41c148650d
refactor: Remove CachedQueries and rename optimized functions
- 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>
2025-07-30 13:17:56 -05:00
610a5b8949
refactor 2025-07-13 16:49:20 -05:00
38920e9f3d
add callsign to users 2025-07-10 16:07:05 -05:00
73d67da457
actually add m ore files 2025-07-10 15:44:39 -05:00
a1ac8abc1e
fix some tests 2025-07-10 15:44:28 -05:00
48447ab42e
refactor and performance improvements 2025-07-10 10:53:34 -05:00
6d9b878a17
clean up warnings 2025-07-08 13:29:44 -05:00
5ad101a69e
passing tests 2025-07-07 16:29:38 -05:00
0beb278371
add packet batcher 2025-06-24 15:06:09 -05:00
ce7c50caa1
refactor to use external parser 2025-06-24 14:22:09 -05:00
54b3bbf522
better device parsing 2025-06-23 14:25:19 -05:00
a48b2edcb3
add device identifier 2025-06-23 14:19:04 -05:00
fc94ec45a8
more tests 2025-06-23 11:01:32 -05:00
Fly Dev
7f4cc74348 Clean up remaining test files and remove unused mocks
- Remove unused mocks.ex file
- Clean up time_helpers_test.exs
- Complete test suite cleanup after fixing all errors and warnings
2025-06-23 14:50:03 +00:00
Fly Dev
9b7ab75f31 fix MockHelpers to prevent redefinition of mocks 2025-06-23 14:21:48 +00:00
Fly Dev
969dc1ee81 update MockHelpers to stub all expected functions 2025-06-23 14:21:16 +00:00
Fly Dev
06a42bd806 fix MockHelpers to use correct Packets behaviour 2025-06-23 14:20:28 +00:00
Fly Dev
50bcca9772 create mock_helpers for tests 2025-06-23 14:20:18 +00:00
a05ec4b32c
refactoring 2025-06-22 10:49:35 -05:00
d6ac5cccfc
fixes 2025-06-21 12:26:43 -05:00
3b8d1f2cff
storing fix 2025-06-16 13:11:58 -05:00
6e8f1e434f
dont connect to is server in test 2025-06-16 12:45:35 -05:00
ff9eb9c614 update everything 2025-01-22 12:12:39 -06:00
da296d852d auto style things 2023-12-17 12:11:57 -06:00
7b874d9afa add auth 2023-01-29 13:29:25 -06:00
d40567dfeb initial 2023-01-26 13:20:23 -06:00