aprs.me/test/aprsme/passcode_test.exs
Graham McIntire a8e7b17ee1
Optimize test suite performance - 32.5% faster execution
Reduced test execution time from 21.2s to 14.3s through multiple optimizations:

1. Reduced test data size:
   - Memory efficiency test: 5000→1000 packets, smaller payloads (saved ~3.2s)
   - More focused test scenarios without sacrificing coverage

2. Reduced sleep times across test suite:
   - GPS movement tests: 100-500ms → 10-100ms
   - Broadcast supervisor tests: 50ms → 10ms
   - Packet consumer tests: 100-500ms → 20-50ms
   - Saved ~1-2 seconds total

3. Enabled parallel test execution:
   - Set max_cases to System.schedulers_online() * 2
   - Made DeviceIdentificationTest async
   - Made PasscodeTest and ConvertTest async
   - Better CPU utilization

4. Reduced assertion timeouts:
   - Changed from 1000ms to 200-500ms where appropriate
   - Faster failure detection

These optimizations maintain test reliability while significantly reducing
execution time. The occasional timing-sensitive LiveView test failures are
addressed with slightly more generous timeouts where needed.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-21 09:23:07 -05:00

23 lines
572 B
Elixir

defmodule Aprsme.PasscodeTest do
use ExUnit.Case, async: true
doctest Aprsme.Passcode
describe "generate/1" do
test "generates correct passcode for W5ISP" do
assert Aprsme.Passcode.generate("W5ISP") == 15_748
end
test "handles callsigns with SSIDs" do
assert Aprsme.Passcode.generate("W5ISP-1") == 15_748
end
test "handles lowercase callsigns" do
assert Aprsme.Passcode.generate("w5isp") == 15_748
end
test "handles long callsigns" do
assert Aprsme.Passcode.generate("W5ISP-LONG") == 15_748
end
end
end