- Remove unused post/put/delete/get helper methods from TestApp
- Create shared test server instance for all CLI tests using once_cell
- Use API directly to create tokens for testing (avoids interactive CLI issues)
- Simplify CLI test structure with server_info() and create_token() helpers
- Update all CLI tests to use shared server infrastructure
- Server tests (42 tests) still pass ✅
Note: CLI tests have stdin handling issues with interactive create-token command.
Using API directly for token creation in tests as workaround.
Co-authored-by: jnsgruk <668505+jnsgruk@users.noreply.github.com>
- Fix create_token helper to properly parse interactive output and extract token
- Update roasters_cli tests to parse JSON output and verify roaster data
- Update roasts_cli tests to parse JSON output and verify roast data
- Use BREWLOG_SERVER environment variable instead of --server flag
- Add proper assertions on JSON structure and content
Note: CLI tests currently fail due to server startup timing issues when
running multiple tests concurrently. Server tests (42 tests) all pass.
CLI test infrastructure is functional but needs serial execution or
better port management.
Co-authored-by: jnsgruk <668505+jnsgruk@users.noreply.github.com>
- Create tests/cli directory with test modules for roasters, roasts, and tokens
- Add helper functions for spawning test servers and running CLI commands
- Add portpicker and tempfile dev dependencies for CLI tests
- Tests demonstrate expected behavior but need CLI refinements to fully work:
* CLI commands need --server flag or better env variable handling
* create-token needs non-interactive mode for testing
* Commands should support --json output format for easier parsing
Infrastructure is ready for completion once CLI improvements are made
Co-authored-by: jnsgruk <668505+jnsgruk@users.noreply.github.com>