Repository navigation
Add tests for the command line (tests/test_main.py) - #2
Merged
Merged
Conversation
Characterization tests for src/arcade/__main__.py: --version, the required subcommand, routers output and --check success, check-registry counts and --domain, registry errors reported without a traceback, hash-token whitespace, the trace reporter's construction and defaults, and serve (with makeServer replaced, so nothing binds). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (one intrinsic pass; anchored on CI run 37113174170):
Judgment calls left for the maintainer:
Summary: a tests-only PR that is CI-green on 3.8 and 3.12. Production code is unchanged, and the one defect found is tracked in #1. This review comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
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.
Summary
Stage B (unit-test expansion) cycle:
src/arcade/__main__.pywas the only source module without atests/test_<module>.pymirror.tests/test_routers.pyalready covered parts of the CLI; this PR addstests/test_main.pywith characterization tests for the paths that were not covered:--versionoutput, and argparse's exit status 2 when no subcommand is givenrouterswithout--check(the generated document on stdout), and the--checksuccess messagecheck-registry'sN game(s) OKline, and--domainchanging which aliases are refusedroutersandhostsreported asarcade: …with exit status 1 and no tracebackhash-tokentrimming whitespace, and refusing a whitespace-only token_reporter(): no client whenARCADE_TRACE_KEYis unset or blank; the URL, program, version and key are passed through, and the documented defaults (https://trace.danielstephenson.dev,arcade) apply.DO_NOT_TRACK=1keeps the client's sender thread from starting, so nothing reaches the network.servewithmakeServerreplaced by a fake, so nothing binds: host and port come fromARCADE_HOST/ARCADE_PORT, the startup log line,startupreported and the reporter closed, and an invalid registry refused (exit 1) before any server is madeProduction code is unchanged, and no CHANGELOG entry was added because nothing user-visible changes. One gap found while writing these tests was filed separately rather than fixed here: a missing registry file makes the CLI print a traceback (#1).
No tracking issue: the gap was found during triage, when the open-issue backlog was empty.
Test plan
python3 -m pytest -v: 119 passed locally on Python 3.8.10 (15 new intests/test_main.py)python3 -m black --check tests/test_main.py: cleantest (3.8),test (3.12),dockerThis PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson