forked from 1jehuang/jcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_e2e.sh
More file actions
executable file
·76 lines (63 loc) · 1.81 KB
/
test_e2e.sh
File metadata and controls
executable file
·76 lines (63 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
# End-to-end test script for jcode
set -e
repo_root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
cargo_exec="$repo_root/scripts/cargo_exec.sh"
run_cargo() {
(cd "$repo_root" && "$cargo_exec" "$@")
}
echo "=== E2E Testing Script for jcode ==="
echo ""
# Test 1: Check binary exists and runs
echo "Test 1: Check jcode binary..."
if command -v jcode &> /dev/null; then
echo "✓ jcode binary found"
jcode --version
else
echo "✗ jcode binary not found"
exit 1
fi
# Test 2: Run unit tests
echo ""
echo "Test 2: Run unit tests..."
run_cargo test 2>&1 | tail -5
echo "✓ Unit tests passed"
# Test 3: Check protocol serialization
echo ""
echo "Test 3: Protocol serialization test..."
run_cargo test protocol::tests --quiet
echo "✓ Protocol tests passed"
# Test 4: Check TUI app tests
echo ""
echo "Test 4: TUI app tests..."
run_cargo test tui::app::tests --quiet
echo "✓ TUI app tests passed"
# Test 5: Check markdown rendering tests
echo ""
echo "Test 5: Markdown rendering tests..."
run_cargo test tui::markdown::tests --quiet
echo "✓ Markdown tests passed"
# Test 6: E2E tests
echo ""
echo "Test 6: E2E integration tests..."
run_cargo test --test e2e --quiet
echo "✓ E2E tests passed"
if [[ "${JCODE_REAL_PROVIDER:-0}" == "1" ]]; then
echo ""
echo "Test 7: Real provider smoke (JCODE_REAL_PROVIDER=1)..."
scripts/real_provider_smoke.sh
echo "✓ Real provider smoke passed"
fi
if [[ "${JCODE_REAL_AUTH_TEST:-0}" == "1" ]]; then
echo ""
echo "Test 8: Auth E2E validation (JCODE_REAL_AUTH_TEST=1)..."
scripts/test_auth_e2e.sh
echo "✓ Auth E2E validation passed"
fi
echo ""
echo "=== All tests passed! ==="
echo ""
echo "To test interactively:"
echo " jcode # Start TUI mode"
echo " jcode server # Start server mode"
echo " jcode client # Connect to server"