Skip to content

test: add comprehensive test suite for all dns_utils modules#41

Closed
tboy1337 wants to merge 5 commits into
masterking32:mainfrom
tboy1337:tests
Closed

test: add comprehensive test suite for all dns_utils modules#41
tboy1337 wants to merge 5 commits into
masterking32:mainfrom
tboy1337:tests

Conversation

@tboy1337
Copy link
Copy Markdown
Contributor

Summary

  • Add a complete pytest-based test suite covering all dns_utils modules and the client/server application code
  • 15 test files, ~6 200 lines of tests across unit, integration, and property-based scenarios

Test files added

File Module under test
ests/conftest.py Shared fixtures (loggers, parsers, mock I/O, sockets)
ests/test_arq.py dns_utils.ARQ — state machine, data/control plane, retransmits
ests/test_client.py client.py — MasterDnsVPNClient lifecycle and helpers
ests/test_compression.py dns_utils.compression — all codec paths
ests/test_config_loader.py dns_utils.config_loader — TOML loading, path resolution
ests/test_dns_balancer.py dns_utils.DNSBalancer — server selection, health tracking
ests/test_dns_enums.py dns_utils.DNS_ENUMS — enum completeness and values
ests/test_dns_packet_parser.py dns_utils.DnsPacketParser — encode/decode for all encryption modes
ests/test_init.py dns_utils.init — public API exports
ests/test_packet_queue_mixin.py dns_utils.PacketQueueMixin — queue operations
ests/test_ping_manager.py dns_utils.PingManager — latency tracking
ests/test_prepend_reader.py dns_utils.PrependReader — stream buffering
ests/test_server.py server.py — MasterDnsVPNServer handlers
ests/test_utils.py dns_utils.utils — async networking helpers

Test approach

  • pytest-asyncio with asyncio_mode = auto for all async tests
  • hypothesis property-based tests for packet encoding/decoding and data-transform paths
  • 30 s per-test timeout via pytest-timeout
  • pytest-mock / unittest.mock for isolating I/O, sockets, and subprocesses

Notes

This branch also carries the source and config changes from the companion PRs (#1 chore/modernize-type-hints, #2 fix/arq-io-loop, #3 chore/dev-tooling-and-ci) in its diff since all work originated from a single branch. The test files themselves are the intended scope of this PR. Reviewing after the companion PRs are merged will reduce diff noise.

…d update tests for new PacketQueueMixin API

Made-with: Cursor
tboy1337 added a commit to tboy1337/MasterDnsVPN that referenced this pull request Mar 17, 2026
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