Repository navigation
Make the trycmd snapshot tests real - #18
Open
ndbroadbent wants to merge 6 commits into
Open
ndbroadbent wants to merge 6 commits into
ndbroadbent wants to merge 6 commits into
Conversation
ndbroadbent
force-pushed
the
tools/trycmd
branch
from
December 4, 2026 03:33
ed9ad7c to
324c100
Compare
ndbroadbent
force-pushed
the
tools/expand
branch
from
December 4, 2026 03:33
5b9a104 to
1194876
Compare
ndbroadbent
force-pushed
the
tools/trycmd
branch
from
December 4, 2026 03:48
324c100 to
26f7a15
Compare
ndbroadbent
force-pushed
the
tools/expand
branch
from
December 4, 2026 03:48
1194876 to
0bcd6a4
Compare
The .trycmd files had no fenced code blocks, so trycmd ignored every case, and their expected output was years stale. They now cover every command's help, validate on a broken config (text, JSON, and generate printing the same errors), and validate, explain, hash --job and expand on a small project. The project case runs in a sandbox (project.out/), and GIT_DIR points nowhere, so neither the cigen repo nor a git hook's environment changes what the patterns match. cigen's version and the hash it feeds are elided, so a release doesn't break them. Refresh with TRYCMD=overwrite cargo test --test cli -- cli_coverage.
ndbroadbent
force-pushed
the
tools/expand
branch
from
December 4, 2026 03:59
0bcd6a4 to
c12bc00
Compare
ndbroadbent
force-pushed
the
tools/trycmd
branch
from
December 4, 2026 03:59
26f7a15 to
1c8bba8
Compare
This branch has not been deployed
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.
Item 5 of the agent-tools work. Stacked on #17 (expand), whose stack goes #14, #13. The base is
tools/expand.Why they were ignored
trycmd only runs commands inside fenced code blocks (
consoleortrycmd). The old.trycmdfiles had no fences, so every case was reported asignored. Their expected output was also stale (cdisn't supported, and the messages were old).What changed
tests/cmd/help.trycmd: full help forcigenand forvalidate,explain,expand,hashandgenerate.tests/cmd/validate.trycmdwithvalidate.in/, a split config with three mistakes:validateas text and as JSON;generateprinting the same errors;--config.tests/cmd/project.trycmdwithproject.in/, a small project:validate,explainas text and JSON,hash --job, an unknown job, andexpandas YAML and JSON. It runs in a sandbox (project.out/exists), so the cigen repo's git doesn't change what the patterns match.tests/cli.rssetsCIGEN_PLUGIN_DIRand pointsGIT_DIRat a path that doesn't exist. Inside the pre-commit hook, the inheritedGIT_DIRmadehashlist this repo's files; trycmd can't unset a variable. The comment says how to refresh:TRYCMD=overwrite cargo test --test cli -- cli_coverage.[..]), so a version bump doesn't break the snapshots.tests/explain.rsalready checks thatexplain's hash equalshash --job's.testsinput group gainstests/cmd/**, because the.in/fixtures are inputs.Tests
cargo test --test cliruns 17 cases and none are ignored.task ciand the pre-commit hook pass.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.