refactor: move test fixtures to root /fixtures directory (#1849)

* refactor: move test fixtures to root /fixtures directory

Moves test/fixtures/ → fixtures/ at the repo root for easier
discoverability. Updates all references in CLAUDE.md and QA
prompt files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor: move install.ps1 to sh/cli/ and fixtures to root

- Moves cli/install.ps1 → sh/cli/install.ps1 (consistent with install.sh)
- Moves test/fixtures/ → fixtures/ at the repo root
- Updates all references in README, CLAUDE.md, QA prompts, and the ps1 itself

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: lab <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
A 2026-02-23 21:38:18 -08:00 committed by GitHub
parent b84adfb74e
commit c487ea215f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 13 additions and 13 deletions

View file

@ -22,14 +22,14 @@ cd WORKTREE_BASE_PLACEHOLDER
List clouds that have fixture directories:
```bash
ls -d test/fixtures/*/
ls -d fixtures/*/
```
For each cloud directory, check if `_env.sh` exists — this contains the env vars needed for API auth.
For each cloud directory, check if a corresponding `sh/test/fixtures/{cloud}/_env.sh` exists — this contains the env vars needed for API auth.
## Step 2 — Check Credentials
For each cloud with `_env.sh`:
For each cloud with `_env.sh` (in `sh/test/fixtures/{cloud}/`):
1. Read `_env.sh` to see which env vars are needed
2. Check if those env vars are set in the current environment
3. Skip clouds where credentials are missing (log which ones)
@ -69,12 +69,12 @@ For any other cloud directories found, read their TypeScript module in `cli/src/
For each successful API response:
1. Validate it is valid JSON: `echo "$response" | jq . > /dev/null 2>&1`
2. Pretty-print and save: `echo "$response" | jq . > test/fixtures/{cloud}/{endpoint}.json`
2. Pretty-print and save: `echo "$response" | jq . > fixtures/{cloud}/{endpoint}.json`
3. Name convention: `ssh_keys.json`, `server_types.json`, `regions.json`, `account.json`
## Step 5 — Update Metadata
Create or update `test/fixtures/{cloud}/_metadata.json` for each cloud:
Create or update `fixtures/{cloud}/_metadata.json` for each cloud:
```json
{
@ -91,14 +91,14 @@ Create or update `test/fixtures/{cloud}/_metadata.json` for each cloud:
Run a final validation pass:
```bash
# Ensure all fixture files are valid JSON
for f in test/fixtures/*/*.json; do
for f in fixtures/*/*.json; do
jq . "$f" > /dev/null 2>&1 || echo "INVALID: $f"
done
```
## Step 7 — Commit and PR
1. `git add test/fixtures/`
1. `git add fixtures/`
2. Commit with message: `test: Update API fixtures for {clouds}`
3. Push and open draft PR:
```bash

View file

@ -39,7 +39,7 @@ Based on the issue type:
3. Determine if the test is wrong or the source is wrong
### Fixture issue
1. Check `test/fixtures/` for the affected cloud
1. Check `fixtures/` for the affected cloud
2. Verify fixture files are valid JSON
3. Check if API endpoints have changed

View file

@ -133,7 +133,7 @@ spawn/
refactor.yml # Scheduled + issue-triggered refactor workflow
manifest.json # The matrix (source of truth)
discovery.sh # Run this to trigger one discovery cycle
test/fixtures/ # API response fixtures for testing
fixtures/ # API response fixtures for testing
README.md # User-facing docs
CLAUDE.md # This file - contributor guide
```
@ -277,7 +277,7 @@ global.fetch = mock(() => Promise.resolve(new Response("Error", { status: 500 })
- Run tests with `bun test`
- Use `import { describe, it, expect, beforeEach, afterEach, mock, spyOn } from "bun:test"`
- All tests must be pure unit tests with mocked fetch/prompts — **no subprocess spawning** (`execSync`, `spawnSync`, `Bun.spawn`)
- Test fixtures (API response snapshots) go in `test/fixtures/{cloud}/`
- Test fixtures (API response snapshots) go in `fixtures/{cloud}/`
## CLI Version Management

View file

@ -13,7 +13,7 @@ curl -fsSL https://openrouter.ai/labs/spawn/install.sh | bash
**Windows PowerShell (outside WSL):**
```powershell
irm https://raw.githubusercontent.com/OpenRouterTeam/spawn/main/cli/install.ps1 | iex
irm https://raw.githubusercontent.com/OpenRouterTeam/spawn/main/sh/cli/install.ps1 | iex
```
## Usage

View file

@ -1,10 +1,10 @@
# Spawn CLI installer for Windows PowerShell
#
# Usage (PowerShell):
# irm https://raw.githubusercontent.com/OpenRouterTeam/spawn/main/cli/install.ps1 | iex
# irm https://raw.githubusercontent.com/OpenRouterTeam/spawn/main/sh/cli/install.ps1 | iex
#
# Or download and run:
# Invoke-WebRequest -Uri https://raw.githubusercontent.com/OpenRouterTeam/spawn/main/cli/install.ps1 -OutFile install.ps1
# Invoke-WebRequest -Uri https://raw.githubusercontent.com/OpenRouterTeam/spawn/main/sh/cli/install.ps1 -OutFile install.ps1
# .\install.ps1
#
# Override install directory: