diff options
| author | Adam Mathes <adam@adammathes.com> | 2026-02-13 20:00:02 -0800 |
|---|---|---|
| committer | Adam Mathes <adam@adammathes.com> | 2026-02-13 20:00:02 -0800 |
| commit | 1cd3597aac808303aa2dc564db4fbb9f4c4bb364 (patch) | |
| tree | 47aeed7bfb4e2604805a4ca401ca48a2f2cdfdc4 /run_e2e_safe.sh | |
| parent | 50a1a0a747cde56cfe139a823b3b6e70cc505c64 (diff) | |
| download | neko-1cd3597aac808303aa2dc564db4fbb9f4c4bb364.tar.gz neko-1cd3597aac808303aa2dc564db4fbb9f4c4bb364.tar.bz2 neko-1cd3597aac808303aa2dc564db4fbb9f4c4bb364.zip | |
fix(test): repair and re-enable E2E tests (NK-m8bya7)
Diffstat (limited to 'run_e2e_safe.sh')
| -rwxr-xr-x | run_e2e_safe.sh | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/run_e2e_safe.sh b/run_e2e_safe.sh new file mode 100755 index 0000000..10f8f91 --- /dev/null +++ b/run_e2e_safe.sh @@ -0,0 +1,51 @@ +#!/bin/bash +set -e + +# Cleanup first +./clean_test_env.sh + +echo "Building backend..." +go build -o neko_server main.go + +echo "Creating data directory..." +mkdir -p .data + +echo "Starting backend on port 4994..." +./neko_server --http=4994 --database=.data/test.db > backend.log 2>&1 & +SERVER_PID=$! + +echo "Backend PID: $SERVER_PID" + +# Wait for server to be ready +echo "Waiting for backend to start..." +for i in {1..30}; do + if nc -z localhost 4994; then + echo "Backend is up!" + break + fi + echo "Waiting..." + sleep 1 +done + +if ! nc -z localhost 4994; then + echo "Backend failed to start. Check backend.log" + cat backend.log + kill $SERVER_PID || true + exit 1 +fi + +echo "Running E2E tests..." +cd frontend +if npm run test:e2e; then + echo "Tests passed!" + EXIT_CODE=0 +else + echo "Tests failed!" + EXIT_CODE=1 +fi + +echo "Cleaning up..." +kill $SERVER_PID || true +./clean_test_env.sh + +exit $EXIT_CODE |
