Skip to content

Check pull requests for undefined names and run unit tests - #12

Merged
raf-li merged 1 commit into
mainfrom
ci/automated-tests
Oct 5, 2026
Merged

raf-li merged 1 commit into
mainfrom
ci/automated-tests

Conversation

@raf-li

@raf-li raf-li commented Oct 5, 2026

Copy link
Copy Markdown
Member

Why

The Check job only byte-compiled the code, so the deleted chan_name variable (bb518fc) passed Check, was deployed, and broke every @ai answer.

What

  • Check job (.github/workflows/deploy.yml) now also:
    • runs flake8 --select=E9,F63,F7,F82 (syntax errors and undefined names; style is not checked);
    • runs python -m unittest discover -s tests -t ..
      Deploy still needs: check, so a failing test also blocks a deploy from main.
  • tests/: 50 stdlib unittest tests for the modules that run without the TeamTalk SDK:
    • test_ai_chat.py: channel/PM/no-channel-name context lines, history order, retry without tools, error response, tool call → request_tool → follow-up answer, _extract_tool_calls variants, background ask/drain, tool definitions well-formed
    • test_ai_review.py: parse_verdict, format_message (incl. @ai note), request layout, background submit/drain, errors
    • test_badwords.py: words, stretched spellings, wildcards, phrases, broad-wildcard refusal, saving, default list seeding, every shipped entry usable
    • test_abuse_tracker.py: stage escalation, per-person counting, window expiry, reset
    • test_help_texts.py: every /help topic renders
  • tt_client.py: get_bot_info used an undefined tt5 (the only other flake8 finding); it now uses version.collect_version_info() like /version.
  • docs/deploy.md and CHANGELOG describe the checks and how to run them locally.

Verified

  • flake8 and the tests pass on this branch.
  • Against bb518fc's ai_chat.py, flake8 reports F821 undefined name 'chan_name' and 4 AI chat tests fail with NameError.

The tt_client.py integration tests still need the TeamTalk SDK and are not part of CI yet.

🤖 Generated with Claude Code

The Check job only byte-compiled the code, so a deleted variable
(chan_name) reached the server and broke every @ai answer. It now also
runs flake8 for syntax errors and undefined names, and the new unit
tests in tests/ for the parts that run without the TeamTalk SDK: AI
chat (request, PM/channel context, tool calls), AI review, badword
filter, abuse tracker and help texts. Both catch the chan_name bug.

get_bot_info used an undefined tt5 module; it now reads the versions
from version.collect_version_info() like /version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@raf-li
raf-li merged commit f928617 into main Oct 5, 2026
2 checks passed
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