E2E tests and clean up -- stabilization#363
Conversation
- Remove duplicate '[storage] Using JSONL storage' log - Fix logger to read env vars at runtime (not import time) so AGENT_RELAY_LOG_FILE set by CLI is picked up correctly - Add --verbose flag to `up` command for debug logging - Update e2e-test.sh script to use modern CLI commands (up, spawn, release, down) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update e2e test to use CLI agents command instead of non-existent /api/agents endpoint - Add CLI command tests (version, status, agents, who) to e2e workflow - Remove deprecated `agent-relay claude` and `agent-relay codex` convenience commands - Update docs and examples to reflect removed commands Users should use `agent-relay up --dashboard` and `agent-relay spawn` instead. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
| const logFile = getLogFile(); | ||
| if (logFile) { | ||
| ensureLogDir(logFile); | ||
| fs.appendFileSync(logFile, formatted + '\n'); |
Check warning
Code scanning / CodeQL
Network data written to file Medium
| if [ -f "$PROJECT_DIR/dist/src/cli/index.js" ]; then | ||
| CLI_CMD="$PROJECT_DIR/dist/src/cli/index.js" |
There was a problem hiding this comment.
🔴 E2E test script tries to execute .js file directly without execute permissions
The e2e test script attempts to execute the compiled JavaScript CLI file directly as a command, but compiled .js files don't have execute permissions by default.
Click to expand
Problem
At scripts/e2e-test.sh:63-64, the script sets CLI_CMD to the path of the compiled .js file:
if [ -f "$PROJECT_DIR/dist/src/cli/index.js" ]; then
CLI_CMD="$PROJECT_DIR/dist/src/cli/index.js"Then at lines 137, 177, 193, etc., it tries to execute this file directly:
"$CLI_CMD" up --dashboard --port "$DASHBOARD_PORT" > "$DAEMON_LOG" 2>&1 &
VERSION_OUTPUT=$("$CLI_CMD" --version)Actual vs Expected
- Actual: The TypeScript compiler outputs
.jsfiles without execute permissions (-rw-r--r--). Trying to execute./dist/src/cli/index.jsdirectly results in "Permission denied". - Expected: The CLI should execute successfully. The old version of this script (before this PR) correctly used
node dist/cli/index.js ...which works regardless of permissions.
Impact
The E2E tests will fail in CI because the script will get "Permission denied" when trying to run the CLI commands. This affects both the full E2E test and the daemon-only test paths.
Recommendation: Change the CLI invocation to explicitly use node: replace "$CLI_CMD" with node "$CLI_CMD" throughout the script, or change the preference logic to use the global agent-relay command first (which is properly installed via npm link with executable permissions).
Was this helpful? React with 👍 or 👎 to provide feedback.
Uh oh!
There was an error while loading. Please reload this page.