Closed
Conversation
Adds serde/serde_json dependencies and a --json flag to the list subcommand. When passed, entries serialize as a JSON array instead of the human-readable table. Includes integration tests for valid JSON output and filtered JSON output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ith json, test robustness
- Remove redundant serde_json from [dev-dependencies] (already in [dependencies])
- Add conflicts_with("json") to --compact arg so clap errors on mutual use
- Restructure list_json_outputs_valid_json_array to assert unconditionally
- Add list_json_service_filter_returns_valid_structure test
- Add list_compact_and_json_conflict integration + unit tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Both list_json_outputs_valid_json_array and list_json_with_client_filter_only_contains_matching_entries had field/filter assertions inside for-loops over DB entries. When the TCC DB is empty (always the case in CI), these loops execute zero iterations, giving false confidence. Fix: - Fields test: add unconditional mock-entry field check that verifies the EXPECTED_JSON_FIELDS list matches the TccEntry serialization contract, independent of DB contents. - Filter test: add unconditional assertion that filtering by a guaranteed-nonexistent client produces a valid empty JSON array, exercising the filter code path even on empty DBs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…pect panic - Replace tautological mock JSON schema test with actual TccEntry serialization check (catches field additions/removals/renames) - Add lib.rs to expose TccEntry to integration tests - Strengthen filter test with explicit object/field assertions - Replace .expect() panic on serialization failure with stderr + exit(1) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThis PR adds JSON output support to the list command by introducing serde dependencies, converting the crate to a library with public module exports, adding a mutually-exclusive Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
Contributor
Author
|
Closing — will open fresh with clean single commit. |
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
Adds a
--jsonflag to thelistsubcommand for machine-readable output.Changes
serde+serde_jsondependenciesSerializeonTccEntryand sub-types--jsonbool flag toListcommand — outputs a JSON array when set, existing table output unchanged--compactconflicts with--json(clap enforces, errors if both passed)Usage
Summary by CodeRabbit