refactor: migrate config-get, marker-set and query tests to the txtar e2e corpus - #30
Merged
Merged
Conversation
Nine txtar cases under e2e/cases/config-get/ cover the value shapes, the three config tiers and the error/help surface; tests/commands/config_get_test.py is deleted. Cross-check — each deleted test to the case that replaces it: | deleted test | case | | --- | --- | | test_scalar_string_prints_raw_single_line | scalar-string-prints-raw-and-unexpanded | | test_scalar_int_dotted_path | dotted-path-reaches-a-nested-integer | | test_mapping_prints_yaml | mapping-prints-as-yaml-in-declaration-order | | test_missing_key_exits_1_nothing_on_stdout | missing-nested-key-is-rejected | | test_missing_top_level_key | missing-top-level-key-is-rejected | | test_global_tier_merges | global-tier-overrides-the-core-default | | test_help_lists_subcommand | help-names-the-dotted-key-argument | Gap cases with no unit predecessor: list-prints-as-a-yaml-sequence, without-a-marker-a-nearby-vault-config-is-not-merged, project-tier-overrides-the-global-tier, project-only-key-resolves-beside-its-core-siblings. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Nine txtar cases under e2e/cases/marker-set/ cover the write, its formatting preservation, @latest resolution, the config read-back, the log line and the three error exits. Unit-to-case cross-check (tests/commands/marker_set_test.py, 9 tests): | unit test | case | | --- | --- | | test_sets_value_and_prints_one_stderr_line | sets-a-key-and-prints-one-stderr-line | | test_changes_only_the_target_line | sets-a-key-and-prints-one-stderr-line, existing-key-is-updated-in-place | | test_value_is_absolute_never_incremented | re-setting-the-key-lands-the-literal-value | | test_runs_from_a_subdirectory | not expressible — the case format runs every cmd line in cwd_root; the marker walk-up stays covered by tests/context/project_test.py::test_load_cwd_from_subdirectory_walks_up | | test_at_latest_resolves_to_the_highest_shipped_id | latest-resolves-to-the-highest-shipped-migration-id | | test_malformed_pair_exits_1 | malformed-pair-is-rejected | | test_non_integer_id_exits_1 | non-integer-latest-migration-is-rejected | | test_no_marker_exits_2 | no-marker-anywhere-is-rejected | | test_logs_the_invocation | logs-one-line-to-the-attached-vault | Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Cover `booping query`'s two addressing forms, the clause shapes parse_where asserts at unit level, and every flag-level error with its exit code as txtar cases under e2e/cases/query/. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…the txtar e2e corpus — M04 query output formats, projection and frontmatter warnings Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…e2e corpus Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
… in the e2e corpus booping-developer: Migrate config-get, marker-set and query tests to the txtar e2e corpus
…late coverage Cross-check of the 35 CLI/parse_where units and the 47 semantics units against the M03-M06 corpus; three gaps got cases (a fieldless where clause, an operator suffix with no field, a whitespace-only ordering operand) and the skip-warning case now runs every output format. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The recipe quoted its argument into -k, so --txtar-update and other pytest flags could not reach the corpus runner.
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.
Overview
Moves the
config-get,marker-setandqueryCLI contracts out of hand-rolled pytest units and into the txtar contract corpus, continuing the loop thescaffoldpilot and thefrontmatter-updatemigration established. No production behavior change.config-get— 11 cases covering value shapes (raw unexpanded scalar, dotted int, mapping and list as YAML), the three config tiers (core / global / project, deep merge proven by a project-only key), and the error/help surface.tests/commands/config_get_test.pydeleted.marker-set— 9 cases covering the write and its single stderr line, byte-for-byte comment/quoting/key-order preservation on append and in-place overwrite, absolute re-set,@latestresolution, aconfig-getread-back chain, the appended log line, and the three error exits.tests/commands/marker_set_test.pydeleted.query— 53 cases across four milestones: both addressing forms and inline-flag narrowing, everyparse_whereclause shape, the four output formats with table escaping, projection rules, the unparseable-frontmatter warning, filtering and ordering semantics (float coercion, strict comparisons, failures dropping rows not runs), discovery and slug identity, glob-order de-duplication, spec validation and theroot: coreescape hatch.tests/commands/query_test.pydeleted;tests/query_test.pyshrunk 57 → 10 tests, retaining only the template-integration classes (TestRow,TestRowUnderJinja,TestQueryFilterWithoutAVault) that nobooping queryinvocation reaches.Every deleted assertion is mapped to its replacing case — or recorded as deliberately dropped with a reason — in the M01/M02 commit messages and in M07's milestone body. Corpus goes 83 → 145 cases; the unit suite drops to 602.
One tooling fix rides along:
just e2equoted its argument into-k, so--txtar-updateand other pytest flags could not reach the runner. It now passes arguments straight through, andCLAUDE.mdis updated to match.Known issues, recorded not fixed
latest_migrationis non-integer makesmarker-setdie with an uncaughtValueErrortraceback instead of an in-banderror:line (booping-python/src/booping/context/project.py:127raising throughmarker_set._run);config-gethandles the same condition cleanly.cmdfrom a nested fixture directory is not expressible —pytest-txtarruns every command in a singlecwd_root, and changing it is out of this plan's scope. Marker walk-up stays covered bytests/context/project_test.py::test_load_cwd_from_subdirectory_walks_up.🤖 Generated with Claude Code