Hangar Floor
DemoDownloadGitHub

Try it with no GitHub

This page shows how to run the tools of the skill with a fake GitHub CLI, for a test, a demo, or a reader test.

Each tool that reads GitHub takes the program to run: --gh PROGRAM for tick.tcl, counts.tcl, estimates.tcl, and milestones.tcl, and config.gh in tick.json. Give it the full path of a fake program. A fake that is only first on the PATH is not enough: some Tcl runners start a program with no PATH of their own, and then find the real gh.

A fake prints what the tool asks for, in the form of gh with its --jq filter: lines with tabs between the fields. The smallest fake prints nothing, so each list is empty:

printf '#!/bin/sh\necho "$*" >> "$(dirname "$0")/gh.log"\n[ "$1" = --version ] && echo "gh version 2.0.0 (fake)"\nexit 0\n' > fake-gh
chmod +x fake-gh
tclsh assets/milestones.tcl list -R example-org/lumen --gh "$PWD/fake-gh"
cat gh.log

For a test, a reader run, or a release check, also take the real gh out of reach, so that a mistake in the setup cannot call it. A bare name, such as "gh": "gh" in tick.json, is a program on the PATH, not a file beside tick.json.

gh.log then lists each call of the tool. To give data, add a case on the arguments, as in tests/web/tick-routine.test.mjs: for example, the lines of pr list are the number, the time of the merge, the title, and the author.

With --dry, tick writes nothing. Each run of tick (also --check and --dry) reads the program of --gh or config.gh.

Next: the update with tick.