Skip to content

chore: add dev tooling, CI workflow, project configuration, and comprehensive test suite#49

Closed
tboy1337 wants to merge 18 commits into
masterking32:mainfrom
tboy1337:chore/dev-tooling-ci-and-tests
Closed

chore: add dev tooling, CI workflow, project configuration, and comprehensive test suite#49
tboy1337 wants to merge 18 commits into
masterking32:mainfrom
tboy1337:chore/dev-tooling-ci-and-tests

Conversation

@tboy1337
Copy link
Copy Markdown
Contributor

@tboy1337 tboy1337 commented Mar 17, 2026

Summary

  • pyproject.toml: project metadata, black and isort configuration
  • pytest.ini: test discovery, asyncio_mode=auto, 30 s per-test timeout
  • .coveragerc: branch coverage, 90% minimum threshold, pass$ and standard exclusions
  • mypy.ini: strict type checking with per-module relaxations for existing untyped modules and test files
  • .pylintrc: pylint configuration, disable noisy rules, set good-names
  • requirements-dev.txt: dev dependencies (pytest plugins, hypothesis, mypy, pylint, black, isort, coverage)
  • requirements.txt: remove duplicate cryptography entry, reorder
  • .gitignore: add .hypothesis/ and .coverage
  • .github/workflows/test.yml: GitHub Actions CI running pytest with coverage on Python 3.10, uploads coverage.xml as artefact
  • dns_utils/config_loader.py: pragma: no cover on ImportError fallback, type annotations for load_config
  • dns_utils/DnsPacketParser.py, dns_utils/compression.py: simplify exception handling, update type hints

Test suite

15 test files (~6 200 lines) covering all dns_utils modules and client/server application code:

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

The mypy.ini marks several large existing modules as ignore_errors = true to avoid false-positives on inherited code that predates strict typing. Full annotation of those modules is tracked separately.

tboy1337 added 18 commits March 13, 2026 15:13
Add project infrastructure for static analysis, testing, and CI:

- pyproject.toml: project metadata, black and isort configuration
- pytest.ini: test discovery, asyncio_mode=auto, 30 s timeout
- .coveragerc: branch coverage, 90 % minimum, source = dns_utils
- mypy.ini: strict type checking with per-module relaxations for
  existing untyped modules and test files
- .pylintrc: pylint configuration, disable noisy rules, set good-names
- requirements-dev.txt: pin all dev dependencies (pytest, hypothesis,
  mypy, pylint, black, isort, autopep8, coverage plugins)
- requirements.txt: remove duplicate cryptography entry, reorder
- .gitignore: add .hypothesis/ and .coverage to ignored paths
- .github/workflows/test.yml: GitHub Actions CI running pytest with
  coverage on Python 3.10, uploads coverage.xml as artifact
- dns_utils/config_loader.py: add pragma: no cover on ImportError
  fallback branch and type: ignore annotations for tomllib re-import

Made-with: Cursor
- .coveragerc: removed unused exclusion pattern.
- .pylintrc: cleaned up disabled rules for better linting.
- mypy.ini: simplified error handling for test files.
- pyproject.toml: updated build backend and removed unnecessary dependencies.
- requirements-dev.txt: pinned versions for development dependencies to ensure compatibility.
- .github/workflows/test.yml: added formatting and type checking steps to CI workflow.
- dns_utils/config_loader.py: updated function signature for load_config to use type hints.
- Removed version pinning for development dependencies to allow for more flexibility in updates.
- Removed black, isort, and mypy checks from the GitHub Actions CI configuration in .github/workflows/test.yml.
…d update tests for new PacketQueueMixin API

Made-with: Cursor
@tboy1337 tboy1337 deleted the chore/dev-tooling-ci-and-tests branch March 19, 2026 06:12
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.

2 participants