Skip to content

docs: describe how each test project is tested, and how to freeze a real release into a fixture - #316

Merged
goldbarth merged 1 commit into
mainfrom
docs/testing
Oct 1, 2026
Merged

goldbarth merged 1 commit into
mainfrom
docs/testing

Conversation

@goldbarth

Copy link
Copy Markdown
Owner

Follows #294, which made a fixture the tag and facts of a run record, and #314, which made the run record page the schema it points to.

  • Why: testing.md explained the fixtures and the prompt snapshots of Chartula.Core.Tests only. A contributor working on an adapter or on the CLI found nothing on how those layers are tested, and the fixture instruction ("copy those two fields") left out the one detail that decides whether the new fixture passes.
  • A table up front names each project, what it tests and how, so a contributor knows where a new test belongs before reading further.
  • Running the tests: the whole suite, one class or one test with --filter, and why to name the project: on the solution, every other project reports No test matches the given testcase filter.
  • Chartula.Core.Tests: the fixtures as before, now with a numbered procedure and a command that copies tag and facts out of a record byte for byte. Not jq, which writes the escaped characters as plain ones and fails FactBaseFixtureTests. The stand-in models and the prompt snapshots stay; the reason no test can reach a model is one sentence and a link to architecture.md, not a repeated argument.
  • Chartula.Infrastructure.Tests: real git in TempGitRepository, GitHub answered by a stub handler that also records the requests, writers in a temporary directory. A git configuration that rewrites [email protected]: URLs fails Reads_the_url_of_the_named_remote; the page says so, and how to run without it.
  • Chartula.Cli.Tests: the three ways it tests and which question each answers: the built binary as a process (CliProcess, GitHub pointed at https://127.0.0.1:1/), the production client factory with an HttpMessageHandler as transport (CreateChatClient, DoctorTransports), and the report around a StubPipeline.
  • Found while verifying, filed as The rule-based check flags a quoted phrase that the facts break over two lines #315: a fixture from a real release whose descriptions hold a code block fails Text_that_only_repeats_the_facts_is_never_flagged, because the rule-based check looks for the one-line rendering in descriptions that keep their line breaks. The same causes false flags in a run for a quoted phrase the description wraps. The page names the limit and links the issue.
  • The page is titled "Testing" now; the links that called it "Test fixtures" (README, CONTRIBUTING, architecture.md, ADR 0001, the recipe) say "Testing", and the two that are about fixtures point to the fixture section.

Verified:

  • The fixture procedure, followed as written, on a run record of a release without code blocks in its descriptions: the copied file is byte-identical to the record's fields, and with its constant on FactBaseFixture the Core suite passes (496 of 496). The same procedure through jq fails Every_fixture_is_exactly_what_a_real_run_would_write; on the record of v0.1.0-preview.3 it fails the echo test as The rule-based check flags a quoted phrase that the facts break over two lines #315 describes. The experiment files are not part of this PR.
  • Both --filter commands were run as written; on the solution, the other projects print the message the page quotes.
  • The URL rewrite failure was reproduced with GIT_CONFIG_COUNT=1, url.https://github.com/[email protected]:.
  • The full suite passes: Core 490, Infrastructure 79, Cli 374.
  • Every relative link and anchor in all Markdown files of the repository resolves (script, with a negative test).

Tests: none changed, documentation only.

@goldbarth goldbarth self-assigned this Oct 1, 2026
@goldbarth
goldbarth merged commit 888e315 into main Oct 1, 2026
4 checks passed
@goldbarth
goldbarth deleted the docs/testing branch October 1, 2026 18:27
goldbarth added a commit that referenced this pull request Oct 1, 2026
…rd decided, recorded and amended (#318)

Follows #264, which moved the ADRs to `docs/development/adr/`, and #317,
which ruled out the claim that the audiences "cannot disagree".

- **Why:** the ADRs had one `Date` line that mixed when a decision was
taken with what changed later ("2026-07-16 (#45), extended by #96"), no
record of when each file was written, and no list of their own;
CONTRIBUTING kept the only list. ADR 0003 did not mention #235, which
added a refusal to the decision it records, and ADR 0002's title named
the tools rather than the decision.
- **`docs/development/adr/README.md`** holds the index, when to write an
ADR, and a template with separate fields: **Decided** (when it took
effect in the code, which can precede the record), **Recorded** (when
the file was written), and **Amended** (every later change to the
decision or to a fact in it, each dated with its pull request). A moved
file, a fixed link or a reworded sentence is not an amendment, so the
list stays a record of meaning.
- **0001** gives the date and pull request of each part: facts first on
2026-07-16 (#45), and the structure of a rendering on 2026-09-16 (#129,
for #96), which the Decision now marks as its own paragraph with the
reason #96 found. Amended here: "so they cannot disagree on what
happened" becomes what a shared fact base actually gives, the same
changes, categories and breaking status, and says why texts can still
disagree.
- **0002** is retitled to its decision, "Dependencies that keep a
native-AOT build reachable", and the file renamed to match; the Decision
opens on the rule the bullets implement. #268's correction of the
platform count is listed as its amendment.
- **0003** records #235: a model endpoint on the API host of the other
provider is refused before any request, with the reason (a key sent
there must be rotated) and why the list of hosts stays short. Dated
2026-09-23, the day of #235, and marked as recorded here.
- **CONTRIBUTING** links the index instead of listing the ADRs, and the
README's "Contribute" table gains a row for it, so the list exists in
one place.

**Verified:**
- Every date and number was taken from GitHub: the merge dates of #42,
#43, #45, #129, #166, #216, #235 and #268, and the issues each closes
(#3, #4, #6, #96, #158, #184, #233).
- What #268 changed in 0002 was read from its diff: the platform count,
nothing else. #264, #270 and #316 only moved the files or changed a
link, so they are not amendments.
- The rule 0003 now states was checked against `ProviderHost.cs` and
#235's description.
- Every relative link and anchor in all Markdown files of the repository
resolves (script, with a negative test); the renamed 0002 had no inbound
link besides CONTRIBUTING's list.

Tests: none, documentation only.
goldbarth added a commit that referenced this pull request Oct 1, 2026
…ape the template like the merged ones (#322)

Follows #316 and #318, after which CONTRIBUTING can link the testing
page and the ADR index instead of explaining either.

- **Why:** CONTRIBUTING told a contributor to clone `goldbarth/chartula`
as "your fork", had no word on branches, review or how a merge closes an
issue, did not say that a pull request's title and description become
Chartula's own release notes, listed types without saying which ones
reach a release, and asked for a PR description ("what and why") unlike
any that has been merged. The template asked for a type checkbox and a
checklist none of the merged pull requests fill in.
- **From a fork to a merged pull request** in six steps: fork and
`upstream`, a branch named after type and topic (as the 40 last merged
branches are), commit, open, review, merge. The merge step says what the
repository is set to do: squash, with the PR title as the commit title
and the description as the message, so `Closes #123` in the description
closes the issue and stays in the history.
- **"Your pull request is Chartula's input":** the title is the line a
release names the change by, its type decides whether it appears, and
the description is what the model reads, so it can reach a published
note. Links `writing-pull-requests.md` instead of repeating it.
- **Setup:** the exact SDK with an install command, and lock files: what
rewrites them, that they are committed with the change, and the locked
restore CI runs, as a command to check before pushing.
- **Build, test and format** as the three commands CI runs, a single
test with `--filter`, and the hook; the rest links `testing.md`.
- **Trying the CLI on a repository:** where the binary is, what
`preview`, `generate --no-publish` and `generate` cost or change, and
the local stub for the model path.
- **Types with a column "In the release notes",** worked out from the
category table and this repository's `chartula.yaml`: `refactor` and
`docs` appear only with `visibility:user-facing`, `test`, `build`, `ci`,
`chore` and `style` are dropped as internal, `revert` appears unless its
target is in the same release. Scopes are the folders, as before.
- **The pull request** describes the shape the merged ones share (the
`Closes` or `Follows` line, a bullet per decision with its reason, a
bold verification section, a `Tests:` line) with a shortened #301 as the
example, and keeps the short list of checks before opening.
- **Writing documentation** gives the rules the pages follow, from the
documentation plan, so a docs contribution needs no other source.
- **The template** has the same four parts with comments that say what
goes in each, and drops the type checkboxes and the checklist.

**Verified:**
- The merge settings from the repository API
(`squash_merge_commit_title: PR_TITLE`, `squash_merge_commit_message:
PR_BODY`), and that the last 20 commits on `main` are squash merges.
- The CI commands against `.github/workflows/ci.yml`; `dotnet restore
Chartula.slnx --locked-mode` passes on this branch.
- The type column against `what-goes-into-a-release.md` (categories,
what is dropped, who can meet a change, reverts) and
`GroundedFactsFactory.Reaches`.
- The example against #301's description; branch names against the head
branches of the last 40 merged pull requests.
- Every relative link and anchor in all Markdown files of the repository
resolves (script, with a negative test).

Tests: none, documentation only.
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