-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
76 lines (72 loc) · 1.93 KB
/
docker-compose.test.yml
File metadata and controls
76 lines (72 loc) · 1.93 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
version: '3.8'
services:
# Main integration test runner
test:
build:
context: .
dockerfile: Dockerfile.test
environment:
- RUNNING_IN_DOCKER=true
- NODE_ENV=test
volumes:
# Mount source for faster iteration (optional, comment out for clean builds)
# - ./src:/app/src:ro
# - ./tests:/app/tests:ro
# Mount for test output
- ./test-results:/app/test-results
command: npm run test:integration
# Interactive shell for manual testing
shell:
build:
context: .
dockerfile: Dockerfile.test
environment:
- RUNNING_IN_DOCKER=true
stdin_open: true
tty: true
command: /bin/bash
# Run all tests (unit + integration)
test-all:
build:
context: .
dockerfile: Dockerfile.test
environment:
- RUNNING_IN_DOCKER=true
- NODE_ENV=test
command: npm run test:all
# Quick smoke test
smoke:
build:
context: .
dockerfile: Dockerfile.test
environment:
- RUNNING_IN_DOCKER=true
command: |
bash -c '
echo "=== AgentGuard Smoke Test ==="
echo ""
echo "Testing: Block rm -rf /"
if agentguard -- rm -rf / 2>&1 | grep -qi block; then
echo "✓ PASS: rm -rf / was blocked"
else
echo "✗ FAIL: rm -rf / was NOT blocked!"
exit 1
fi
echo ""
echo "Testing: Allow rm -rf node_modules"
mkdir -p /tmp/test-proj/node_modules
echo "test" > /tmp/test-proj/node_modules/test.txt
if agentguard -- rm -rf /tmp/test-proj/node_modules; then
if [ ! -d /tmp/test-proj/node_modules ]; then
echo "✓ PASS: node_modules was deleted"
else
echo "✗ FAIL: node_modules still exists"
exit 1
fi
else
echo "✗ FAIL: rm command failed"
exit 1
fi
echo ""
echo "=== All smoke tests passed! ==="
'