Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,14 @@ jobs:
# Isolate every home-relative write (kit.json, CLAUDE.md, settings).
HOME: ${{ runner.temp }}/kit-home
USERPROFILE: ${{ runner.temp }}\kit-home
XDG_CONFIG_HOME: ${{ runner.temp }}/kit-home/.config
APPDATA: ${{ runner.temp }}\kit-home\AppData\Roaming
run: |
mkdir -p "$HOME"
# The smoke test proves local CLI behavior, not npm reachability.
# Seed a fresh empty drift cache so an offline Windows runner does
# not pay four sequential 20s `npm view` timeouts inside status.
node -e 'const fs=require("node:fs"),p=require("node:path"),base=process.platform==="win32"?process.env.APPDATA:process.env.XDG_CONFIG_HOME,dir=p.join(base,"agentic-kit"),last=Date.now();fs.mkdirSync(dir,{recursive:true});fs.writeFileSync(p.join(dir,"kit.json"),JSON.stringify({versionCheck:{last,seen:{},self:{last,best:null}}}))'
node bin/agentic-kit.mjs --version
node bin/agentic-kit.mjs --help --all > /dev/null
# status must emit valid JSON and exit deterministically even on a
Expand Down
7 changes: 6 additions & 1 deletion tests/kit/dual-cli.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ function sandbox({ dualRouting }) {
const home = fs.mkdtempSync(path.join(os.tmpdir(), 'kit-dual-home-'));
const cfgDir = path.join(home, '.config', 'agentic-kit');
fs.mkdirSync(cfgDir, { recursive: true });
const last = Date.now();
fs.writeFileSync(path.join(cfgDir, 'kit.json'),
JSON.stringify({ providers: { hosts: { claude: true, codex: true }, dualRouting } }));
JSON.stringify({
providers: { hosts: { claude: true, codex: true }, dualRouting },
// Real CLI spawns must not turn an isolated unit test into an npm network probe.
versionCheck: { last, seen: {}, self: { last, best: null } },
}));
const project = fs.mkdtempSync(path.join(os.tmpdir(), 'kit-dual-proj-'));
fs.mkdirSync(path.join(project, '.git'));
return { home, project };
Expand Down
7 changes: 6 additions & 1 deletion tests/kit/provider-cli.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ function sandbox({ hosts }) {
const home = fs.mkdtempSync(path.join(os.tmpdir(), 'kit-prov-cli-home-'));
const cfgDir = path.join(home, '.config', 'agentic-kit');
fs.mkdirSync(cfgDir, { recursive: true });
fs.writeFileSync(path.join(cfgDir, 'kit.json'), JSON.stringify({ providers: { hosts } }));
const last = Date.now();
fs.writeFileSync(path.join(cfgDir, 'kit.json'), JSON.stringify({
providers: { hosts },
// Real CLI spawns must not turn an isolated unit test into an npm network probe.
versionCheck: { last, seen: {}, self: { last, best: null } },
}));
const project = fs.mkdtempSync(path.join(os.tmpdir(), 'kit-prov-cli-proj-'));
fs.mkdirSync(path.join(project, '.git'));
return { home, project };
Expand Down
11 changes: 10 additions & 1 deletion tests/kit/provider-refresh-cli.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,16 @@ function sandbox(providers) {
const home = fs.mkdtempSync(path.join(os.tmpdir(), 'kit-refresh-home-'));
const cfgDir = path.join(home, '.config', 'agentic-kit');
fs.mkdirSync(cfgDir, { recursive: true });
fs.writeFileSync(path.join(cfgDir, 'kit.json'), JSON.stringify({ providers }));
// These tests exercise provider output and persistence, not version egress.
// A fresh sandbox otherwise makes every real CLI spawn run two sequential
// `npm view` probes; an unreachable Windows runner pays both 20s timeouts
// for every test in this file. Seed the same honest "checked, no answer"
// cache shape a completed drift probe would persist.
const last = Date.now();
fs.writeFileSync(path.join(cfgDir, 'kit.json'), JSON.stringify({
providers,
versionCheck: { last, seen: {}, self: { last, best: null } },
}));
const project = fs.mkdtempSync(path.join(os.tmpdir(), 'kit-refresh-proj-'));
fs.mkdirSync(path.join(project, '.git'));
return { home, project };
Expand Down
Loading