forked from joseairosa/recall
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-v1.5.0-simple.sh
More file actions
executable file
·208 lines (165 loc) · 5.99 KB
/
test-v1.5.0-simple.sh
File metadata and controls
executable file
·208 lines (165 loc) · 5.99 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
#!/bin/bash
# Simple test script for v1.5.0 features
# Tests by checking if tools are available and Redis keys are created correctly
set -e
echo "======================================================================"
echo " v1.5.0 Simple Test Suite"
echo "======================================================================"
echo ""
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
PASSED=0
FAILED=0
# Test function
test_command() {
local name="$1"
local command="$2"
local expected="$3"
echo -e "${BLUE}Testing: $name${NC}"
if eval "$command" | grep -q "$expected"; then
echo -e "${GREEN} ✓ PASSED${NC}"
((PASSED++))
else
echo -e "${RED} ✗ FAILED${NC}"
((FAILED++))
fi
}
# Test 1: Check if new tools exist in build
echo ""
echo "==================================="
echo "Phase 1: Tool Availability"
echo "==================================="
test_command "version-tools.ts exists" \
"test -f src/tools/version-tools.ts && echo 'exists'" \
"exists"
test_command "template-tools.ts exists" \
"test -f src/tools/template-tools.ts && echo 'exists'" \
"exists"
test_command "category-tools.ts exists" \
"test -f src/tools/category-tools.ts && echo 'exists'" \
"exists"
test_command "get_memory_history in version-tools" \
"grep -q 'get_memory_history' src/tools/version-tools.ts && echo 'found'" \
"found"
test_command "rollback_memory in version-tools" \
"grep -q 'rollback_memory' src/tools/version-tools.ts && echo 'found'" \
"found"
test_command "create_template in template-tools" \
"grep -q 'create_template' src/tools/template-tools.ts && echo 'found'" \
"found"
test_command "set_memory_category in category-tools" \
"grep -q 'set_memory_category' src/tools/category-tools.ts && echo 'found'" \
"found"
# Test 2: Check type definitions
echo ""
echo "==================================="
echo "Phase 2: Type Definitions"
echo "==================================="
test_command "MemoryVersion schema exists" \
"grep -q 'MemoryVersionSchema' src/types.ts && echo 'found'" \
"found"
test_command "MemoryTemplate schema exists" \
"grep -q 'MemoryTemplateSchema' src/types.ts && echo 'found'" \
"found"
test_command "Category field in MemoryEntry" \
"grep -q 'category.*optional.*describe.*Category for organization' src/types.ts && echo 'found'" \
"found"
test_command "Redis version keys defined" \
"grep -q 'memoryVersions:' src/types.ts && echo 'found'" \
"found"
test_command "Redis template keys defined" \
"grep -q 'template:' src/types.ts && echo 'found'" \
"found"
test_command "Redis category keys defined" \
"grep -q 'memoryCategory:' src/types.ts && echo 'found'" \
"found"
# Test 3: Check MemoryStore implementation
echo ""
echo "==================================="
echo "Phase 3: MemoryStore Methods"
echo "==================================="
test_command "createVersion method exists" \
"grep -q 'async createVersion' src/redis/memory-store.ts && echo 'found'" \
"found"
test_command "getMemoryHistory method exists" \
"grep -q 'async getMemoryHistory' src/redis/memory-store.ts && echo 'found'" \
"found"
test_command "rollbackMemory method exists" \
"grep -q 'async rollbackMemory' src/redis/memory-store.ts && echo 'found'" \
"found"
test_command "createTemplate method exists" \
"grep -q 'async createTemplate' src/redis/memory-store.ts && echo 'found'" \
"found"
test_command "setMemoryCategory method exists" \
"grep -q 'async setMemoryCategory' src/redis/memory-store.ts && echo 'found'" \
"found"
test_command "searchMemories has new parameters" \
"grep -q 'category.*string.*fuzzy.*boolean.*regex.*string' src/redis/memory-store.ts && echo 'found'" \
"found"
# Test 4: Check build artifacts
echo ""
echo "==================================="
echo "Phase 4: Build Artifacts"
echo "==================================="
test_command "dist/index.js exists" \
"test -f dist/index.js && echo 'exists'" \
"exists"
test_command "Version 1.5.0 in package.json" \
"grep -q '\"version\": \"1.5.0\"' package.json && echo 'found'" \
"found"
test_command "Version 1.5.0 in src/index.ts" \
"grep -q \"version: '1.5.0'\" src/index.ts && echo 'found'" \
"found"
test_command "CHANGELOG has v1.5.0 entry" \
"grep -q '\[1.5.0\]' CHANGELOG.md && echo 'found'" \
"found"
test_command "README mentions 27 tools" \
"grep -q '27' README.md && echo 'found'" \
"found"
# Test 5: Redis Key Patterns
echo ""
echo "==================================="
echo "Phase 5: Redis Integration"
echo "==================================="
test_command "Redis is running" \
"redis-cli ping" \
"PONG"
test_command "Can connect to Redis" \
"redis-cli INFO server | grep -q 'redis_version' && echo 'connected'" \
"connected"
# Test 6: TypeScript Compilation
echo ""
echo "==================================="
echo "Phase 6: Build Verification"
echo "==================================="
test_command "TypeScript builds without errors" \
"npm run build 2>&1 | grep -q 'Build success' && echo 'success'" \
"success"
test_command "Bundle size is reasonable (<200KB)" \
"test $(wc -c < dist/index.js) -lt 200000 && echo 'ok'" \
"ok"
# Summary
echo ""
echo "======================================================================"
echo " Test Summary"
echo "======================================================================"
echo -e "Total: $((PASSED + FAILED))"
echo -e "${GREEN}Passed: $PASSED${NC}"
echo -e "${RED}Failed: $FAILED${NC}"
echo ""
if [ $FAILED -eq 0 ]; then
echo -e "${GREEN}✓ All static tests passed!${NC}"
echo ""
echo "Next steps:"
echo "1. Start MCP server: npx -y @joseairosa/recall"
echo "2. Follow manual test checklist: test-v1.5.0-manual.md"
echo "3. Test with Claude Desktop to verify runtime behavior"
exit 0
else
echo -e "${RED}✗ Some tests failed. Review errors above.${NC}"
exit 1
fi