-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_worktree.sh
More file actions
executable file
·43 lines (34 loc) · 1.75 KB
/
test_worktree.sh
File metadata and controls
executable file
·43 lines (34 loc) · 1.75 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
#!/bin/bash
# Test script for worktreeworker.py
# Demonstrates how to execute the Python script with GitHub webhook payloads
echo "=== Testing worktreeworker.py with GitHub webhook events ==="
echo
# Change to the directory containing the Python script
cd /home/clide/testworktree
# Test Case 1: Issue #1 "This is a test issue"
echo "Test Case 1: Creating worktree for issue #1"
python3 worktreeworker.py '{"action":"opened","issue":{"number":1,"title":"This is a test issue"},"repository":{"full_name":"sample-repo","name":"sample-repo"}}'
echo
# Test Case 2: Issue #2 "Fix login bug with special characters!"
echo "Test Case 2: Creating worktree for issue #2"
python3 worktreeworker.py '{"action":"opened","issue":{"number":2,"title":"Fix login bug with special characters!"},"repository":{"full_name":"sample-repo","name":"sample-repo"}}'
echo
# Test Case 3: Issue #3 with a very long title to test truncation
echo "Test Case 3: Creating worktree for issue #3 (long title)"
python3 worktreeworker.py '{"action":"opened","issue":{"number":3,"title":"This is a very long issue title that should be truncated to test the slugify function max length parameter"},"repository":{"full_name":"sample-repo","name":"sample-repo"}}'
echo
# Test Case 4: Non-opened action (should be ignored)
echo "Test Case 4: Testing non-opened action (should be ignored)"
python3 worktreeworker.py '{"action":"closed","issue":{"number":4,"title":"This should be ignored"},"repository":{"full_name":"sample-repo","name":"sample-repo"}}'
echo
# List all created worktrees
echo "=== Created worktrees ==="
if [ -d "issues/sample-repo" ]; then
ls -la issues/sample-repo/
else
echo "No worktrees found"
fi
echo
# Show git worktree list
echo "=== Git worktree list ==="
cd sample-repo && git worktree list