Skip to content

Commit 349da35

Browse files
tmshortclaude
andcommitted
🐛 Fix: Use absolute path for E2E_SUMMARY_OUTPUT
The e2e tests change directories during execution, causing the relative path to e2e-summary.json to fail. Convert OUTPUT_DIR to an absolute path before passing it to E2E_SUMMARY_OUTPUT. This fixes the error: 'failed to write e2e test summary output: no such file or directory' 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 5191d61 commit 349da35

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

hack/tools/memory-profiling/run-profiled-test.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ TEST_TARGET="${2:-${MEMORY_PROFILE_TEST_TARGET:-test-experimental-e2e}}"
2020
OUTPUT_DIR="${MEMORY_PROFILE_DIR:-./memory-profiles}/${TEST_NAME}"
2121
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
2222

23+
# Get absolute path for OUTPUT_DIR
24+
# This is needed because E2E tests may change directories
25+
OUTPUT_DIR_ABS="$(cd "$(dirname "${OUTPUT_DIR}")" 2>/dev/null && pwd)/$(basename "${OUTPUT_DIR}")" || OUTPUT_DIR_ABS="${OUTPUT_DIR}"
26+
2327
# Colors for output
2428
RED='\033[0;31m'
2529
GREEN='\033[0;32m'
@@ -46,6 +50,9 @@ log_warn() {
4650
# Create output directory
4751
mkdir -p "${OUTPUT_DIR}"
4852

53+
# Update OUTPUT_DIR_ABS now that directory exists
54+
OUTPUT_DIR_ABS="$(cd "${OUTPUT_DIR}" && pwd)"
55+
4956
# PIDs to track
5057
TEST_PID=""
5158
COLLECT_PID=""
@@ -83,7 +90,8 @@ log_info "Output directory: ${OUTPUT_DIR}"
8390
# Start the e2e test
8491
log_info "Starting e2e test (${TEST_TARGET})..."
8592
# Set E2E_SUMMARY_OUTPUT to capture prometheus alerts and other test metrics
86-
E2E_SUMMARY_OUTPUT="${OUTPUT_DIR}/e2e-summary.json" make "${TEST_TARGET}" > "${OUTPUT_DIR}/test.log" 2>&1 &
93+
# Use absolute path because e2e tests may change directories
94+
E2E_SUMMARY_OUTPUT="${OUTPUT_DIR_ABS}/e2e-summary.json" make "${TEST_TARGET}" > "${OUTPUT_DIR}/test.log" 2>&1 &
8795
TEST_PID=$!
8896
log_info "Test started (PID: ${TEST_PID})"
8997

0 commit comments

Comments
 (0)