Skip to content

refactor: migrate config-get, marker-set and query tests to the txtar e2e corpus - #30

Merged
A merged 16 commits into
release/1.0.1from
refactor/cli-tests-to-e2e-corpus
Aug 13, 2026
Merged

refactor: migrate config-get, marker-set and query tests to the txtar e2e corpus#30
A merged 16 commits into
release/1.0.1from
refactor/cli-tests-to-e2e-corpus

Conversation

@A

@A A commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Overview

Moves the config-get, marker-set and query CLI contracts out of hand-rolled pytest units and into the txtar contract corpus, continuing the loop the scaffold pilot and the frontmatter-update migration 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.py deleted.
  • 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, @latest resolution, a config-get read-back chain, the appended log line, and the three error exits. tests/commands/marker_set_test.py deleted.
  • query — 53 cases across four milestones: both addressing forms and inline-flag narrowing, every parse_where clause 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 the root: core escape hatch. tests/commands/query_test.py deleted; tests/query_test.py shrunk 57 → 10 tests, retaining only the template-integration classes (TestRow, TestRowUnderJinja, TestQueryFilterWithoutAVault) that no booping query invocation 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 e2e quoted its argument into -k, so --txtar-update and other pytest flags could not reach the runner. It now passes arguments straight through, and CLAUDE.md is updated to match.

Known issues, recorded not fixed

  • A marker whose latest_migration is non-integer makes marker-set die with an uncaught ValueError traceback instead of an in-band error: line (booping-python/src/booping/context/project.py:127 raising through marker_set._run); config-get handles the same condition cleanly.
  • One M02 DoD item was descoped: a case running its cmd from a nested fixture directory is not expressible — pytest-txtar runs every command in a single cwd_root, and changing it is out of this plan's scope. Marker walk-up stays covered by tests/context/project_test.py::test_load_cwd_from_subdirectory_walks_up.

🤖 Generated with Claude Code

A and others added 16 commits August 13, 2026 10:18
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.
@A
A merged commit 40c45fb into release/1.0.1 Aug 13, 2026
3 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