Commit graph

4 commits

Author SHA1 Message Date
openhands
97a4ef7cd3 fix: health-checks.ts reads deployments-local.json directly, bypassing all env var overrides (#412)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 10:12:28 +00:00
openhands
c9fe1ab178 fix: tests/setup/stack.ts: contract addresses have no env var override path (#391)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 22:34:44 +00:00
johba
31063379a8 feat/ponder-lm-indexing (#142) 2026-02-18 00:19:05 +01:00
johba
b1f40374cd feat: Add functional health checks for test prerequisites (#65)
Replaces basic "service is up" checks with functional verification that tests can actually use the services.

## Changes

### New Health Checks
- **RPC Proxy**: Verifies eth_call works and deployed contracts are accessible
- **GraphQL**: Confirms Ponder has indexed data with non-zero stats
- **Web App**: Validates endpoint accessibility

### Improvements
- Clear error messages explain what failed and how to fix it
- Checks verify actual functionality, not just HTTP 200 responses
- Fails fast before tests run with cryptic errors

### Files
- `tests/setup/health-checks.ts` - Core health check functions
- `tests/setup/stack.ts` - Integration with waitForStackReady()
- `tests/HEALTH_CHECKS.md` - Documentation and troubleshooting guide

## Error Message Example

Before:
```
RPC health check failed with status 404
```

After:
```
 Stack health check failed

Failed services:
  • RPC Proxy: RPC proxy returned HTTP 404
    Expected 200, got 404. Check if Anvil is running and RPC_URL is correct.
  • GraphQL Indexer: GraphQL has no indexed data yet
    Ponder is running but has not indexed contract events.

Troubleshooting:
  1. Check stack logs: tail tests/.stack.log
  2. Verify services are running: ./scripts/dev.sh status
  3. Restart stack: ./scripts/dev.sh restart --full
```

## Benefits
-  Tests fail fast with clear error messages
-  Catches configuration issues before tests run
-  Verifies services are actually usable, not just running

resolves #61

Co-authored-by: johba <johba@harb.eth>
Reviewed-on: https://codeberg.org/johba/harb/pulls/65
2025-10-05 20:03:07 +02:00