mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-08-17 20:43:43 +00:00
refactor: Remove dead code and stale references (#2062)
Remove orphaned sh/test/fixtures/ directory. These shell fixture files (_shared_agent_assertions.sh, hetzner/_env.sh, hetzner/_api_assertions.sh, digitalocean/_env.sh, digitalocean/_api_assertions.sh) were part of a mock test harness (mock.sh) that was removed from the repository. The fixture files reference `assert_api_called` and `MOCK_LOG` variables that are never defined anywhere, confirming they are unreachable dead code. Scan results: - Dead code (sh/test/fixtures/): 5 orphaned fixture files removed - Dead code (sh/shared, packages/cli/src/): none found - Stale references to non-existent files: none found - Python usage (python3 -c / python -c): none found - Duplicate utilities across cloud modules: loadTokenFromConfig pattern exists in hetzner/daytona/digitalocean but reads from different cloud- specific config paths — cannot be consolidated (confirmed intentional) - Stale comments: none found beyond those already fixed in prior PRs -- qa/code-quality Co-authored-by: spawn-qa-bot <qa@openrouter.ai> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
3fa0c82c91
commit
add83bbd6c
5 changed files with 0 additions and 63 deletions
51
sh/test/fixtures/_shared_agent_assertions.sh
vendored
51
sh/test/fixtures/_shared_agent_assertions.sh
vendored
|
|
@ -1,51 +0,0 @@
|
|||
#!/bin/bash
|
||||
# Shared per-agent install assertions
|
||||
# Verifies each agent script uses the correct install method
|
||||
#
|
||||
# Source this file and call assert_agent_install CLOUD AGENT. Expects:
|
||||
# MOCK_LOG — path to the mock call log
|
||||
# PASSED / FAILED — counters (updated in-place)
|
||||
# GREEN / RED / NC — color codes
|
||||
|
||||
# Internal: assert a grep pattern appears in MOCK_LOG
|
||||
_assert_install_pattern() {
|
||||
local pattern="$1"
|
||||
local msg="$2"
|
||||
if grep -qE "${pattern}" "${MOCK_LOG}" 2>/dev/null; then
|
||||
printf '%b\n' " ${GREEN}✓${NC} ${msg}"
|
||||
PASSED=$((PASSED + 1))
|
||||
else
|
||||
printf '%b\n' " ${RED}✗${NC} ${msg}"
|
||||
FAILED=$((FAILED + 1))
|
||||
fi
|
||||
}
|
||||
|
||||
assert_agent_install() {
|
||||
local cloud="$1"
|
||||
local agent="$2"
|
||||
|
||||
case "$agent" in
|
||||
claude)
|
||||
# install_claude_code finalization always runs "claude install --force"
|
||||
# (mock claude binary is pre-installed, so curl installer is skipped)
|
||||
_assert_install_pattern "claude.*install" "installs claude code" ;;
|
||||
openclaw)
|
||||
# npm install -g openclaw (Node runtime needs standard node_modules layout)
|
||||
_assert_install_pattern "npm.*install.*openclaw" "installs openclaw via npm" ;;
|
||||
codex)
|
||||
# npm install -g @openai/codex
|
||||
_assert_install_pattern "npm.*install.*codex" "installs codex via npm" ;;
|
||||
opencode)
|
||||
# curl to download opencode tarball (via opencode_install_cmd)
|
||||
_assert_install_pattern "opencode" "installs opencode" ;;
|
||||
kilocode)
|
||||
# npm install -g @kilocode/cli
|
||||
_assert_install_pattern "npm.*install.*kilocode" "installs kilocode via npm" ;;
|
||||
zeroclaw)
|
||||
# curl installer from zeroclaw-labs/zeroclaw repo
|
||||
_assert_install_pattern "zeroclaw" "installs zeroclaw" ;;
|
||||
*)
|
||||
# Unknown agent — skip assertion (no failure)
|
||||
return 0 ;;
|
||||
esac
|
||||
}
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
assert_api_called "GET" "/account/keys" "fetches SSH keys"
|
||||
assert_api_called "POST" "/droplets" "creates droplet"
|
||||
4
sh/test/fixtures/digitalocean/_env.sh
vendored
4
sh/test/fixtures/digitalocean/_env.sh
vendored
|
|
@ -1,4 +0,0 @@
|
|||
export DO_API_TOKEN="test-token-do"
|
||||
export DO_DROPLET_NAME="test-srv"
|
||||
export DO_DROPLET_SIZE="s-2vcpu-2gb"
|
||||
export DO_REGION="nyc3"
|
||||
2
sh/test/fixtures/hetzner/_api_assertions.sh
vendored
2
sh/test/fixtures/hetzner/_api_assertions.sh
vendored
|
|
@ -1,2 +0,0 @@
|
|||
assert_api_called "GET" "/ssh_keys" "fetches SSH keys"
|
||||
assert_api_called "POST" "/servers" "creates server"
|
||||
4
sh/test/fixtures/hetzner/_env.sh
vendored
4
sh/test/fixtures/hetzner/_env.sh
vendored
|
|
@ -1,4 +0,0 @@
|
|||
export HCLOUD_TOKEN="test-token-hetzner"
|
||||
export HETZNER_SERVER_NAME="test-srv"
|
||||
export HETZNER_SERVER_TYPE="cx23"
|
||||
export HETZNER_LOCATION="fsn1"
|
||||
Loading…
Add table
Add a link
Reference in a new issue