Skip to content

Add test suite, coverage, keybind refactor, and repo cleanup#33

Merged
joefarrelly merged 1 commit into
devfrom
add-tests-and-cleanup
Jun 18, 2026
Merged

Add test suite, coverage, keybind refactor, and repo cleanup#33
joefarrelly merged 1 commit into
devfrom
add-tests-and-cleanup

Conversation

@joefarrelly

Copy link
Copy Markdown
Owner

Summary

  • 47 pytest tests covering LuaParser, IsSessionUser, keybind builder helpers, and key view behaviours — all passing, 52% coverage
  • pytest-cov wired with --cov-report=term-missing + XML; CI job uploads to Codecov
  • Extract keybind logic from views.py into libs/keybind_builder.py (build_all_keybinds, build_single_keybinds, tier_sort_key) — pure functions now live in libs/ where they belong
  • backend/test_settings.py overrides DB → SQLite in-memory and cache → locmem so tests need no running services
  • CI: lint.yml renamed to "Lint and Test"; adds a test job (Python 3.12, installs MySQL dev headers, runs pytest with all required env vars)
  • Badges: Lint/Test, Codecov, and Ruff badges added to readme.md
  • dump.txt removed — contained real personal WoW data committed to git; now gitignored
  • apicore/tests.py removed — superseded by tests/ package
  • Stale DATA_PASSWORD env var row removed from readme.md

Test plan

  • CI "Lint and Test" workflow passes on this PR (both lint and test jobs green)
  • Codecov comment appears with coverage report

- 47 pytest tests across LuaParser, IsSessionUser, keybind helpers,
  and key view behaviours (all passing, 52% coverage)
- pytest-cov wired with term-missing + XML output; CI uploads to Codecov
- Extract keybind logic from views.py into libs/keybind_builder.py
- Add backend/test_settings.py (SQLite in-memory) and conftest.py
- Expand lint.yml with test job (Python 3.12, no DB services needed)
- Add Lint/Test, Codecov, and Ruff badges to readme.md
- Remove dump.txt (personal data), gitignore it
- Remove redundant apicore/tests.py
@gitguardian

gitguardian Bot commented Jun 18, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
34103880 Triggered Generic Password 975fbe8 .github/workflows/lint.yml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@joefarrelly joefarrelly enabled auto-merge June 18, 2026 22:01
@joefarrelly joefarrelly merged commit b9c9fdb into dev Jun 18, 2026
3 checks passed
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 52.88462% with 49 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
apicore/libs/keybind_builder.py 53.46% 47 Missing ⚠️
apicore/views.py 33.33% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@joefarrelly joefarrelly deleted the add-tests-and-cleanup branch June 18, 2026 22:07
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