-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_deck.sh
More file actions
executable file
·66 lines (51 loc) · 1.39 KB
/
test_deck.sh
File metadata and controls
executable file
·66 lines (51 loc) · 1.39 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
#!/bin/bash
set -euo pipefail
# Test script for DECK functionality
echo "DECK Functionality Test"
echo "======================"
echo ""
# Set test environment
export DECK_DIR="/tmp/deck_test_$$"
export PATH="$(pwd)/src:$PATH"
echo "Test directory: ${DECK_DIR}"
echo ""
# Initialize test environment
echo "1. Initializing DECK..."
./src/deck.sh status >/dev/null 2>&1
echo "✓ DECK initialized"
# Test queue operations
echo ""
echo "2. Testing queue operations..."
# Queue some issues
./src/deck.sh queue myorg/api 123
echo "✓ Queued myorg/api#123"
./src/deck.sh queue myorg/web 456 urgent
echo "✓ Queued myorg/web#456 with urgent priority"
./src/deck.sh queue otherorg/mobile 789
echo "✓ Queued otherorg/mobile#789"
# Check status
echo ""
echo "3. Checking queue status..."
./src/deck.sh status
# Test JSON output
echo ""
echo "4. Testing JSON output..."
./src/deck.sh status --json | jq -r '.summary'
# Test release
echo ""
echo "5. Testing ticket release..."
# Manually move one to active for testing
mv "${DECK_DIR}/waiting/myorg_api_123.lock" "${DECK_DIR}/active/" 2>/dev/null || true
./src/deck.sh release myorg/api 123
echo "✓ Released myorg/api#123"
# Test monitoring
echo ""
echo "6. Testing health check..."
./src/deck.sh health
# Cleanup
echo ""
echo "7. Cleaning up test environment..."
rm -rf "${DECK_DIR}"
echo "✓ Test directory removed"
echo ""
echo "All tests completed successfully!"