Repository navigation
Add unit test suite and GitHub Actions CI - #2
Merged
Merged
Conversation
Add a comprehensive pytest suite (262 tests) covering pure logic, the SQLite data layer, the service layer, and the Telegram handler pipeline: - Tooling: pyproject.toml (pytest + coverage config), requirements-dev.txt, and a root conftest.py with shared fixtures (temp DB, fake Config, clean env, duck-typed Message/CallbackQuery, stub bot, fernet key). - Pure logic: utils (escaping, splitting, sensitive detection, masking, time), config validators, keyboards callback-data limits, embeddings (cosine/keyword/matrix), KB chunking/context. - Data layer: settings coercion round-trips and full DAL incl. approval double-tap atomicity, FK cascade, owner-pending TTL — against a real temp DB. - Services: OpenAI (Fernet protect/unprotect, _map_error, max_tokens retry), Codex (prompt build, flag fallback, subprocess mocked), prompt assembly, rate-limit windows, KB retrieval, memory ordering/trim, business pause expiry, file sanitization. No network or subprocess is ever touched. - Handlers: process_business_message branch-by-branch, approval card/edit flow, telegram_api send adapter + fallback, notify_owner. CI: .github/workflows/tests.yml runs the suite on a Python 3.10/3.11/3.12 matrix for every push and PR to main, with coverage measured and uploaded as an artifact (report-only) and an aggregate "tests" check for branch protection. README documents local runs and the merge-protection setup. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a comprehensive pytest suite (262 tests) covering pure logic, the SQLite data layer, the service layer, and the Telegram handler pipeline:
CI: .github/workflows/tests.yml runs the suite on a Python 3.10/3.11/3.12 matrix for every push and PR to main, with coverage measured and uploaded as an artifact (report-only) and an aggregate "tests" check for branch protection. README documents local runs and the merge-protection setup.