-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask.sh
More file actions
executable file
·55 lines (51 loc) · 1.28 KB
/
task.sh
File metadata and controls
executable file
·55 lines (51 loc) · 1.28 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
#!/bin/bash
# Function to display help
function display_help {
echo "Usage: $0 [server_test|server_start|booth_test] [optional file]"
echo " server_test: Run server tests"
echo " server_start: Run deno fresh"
echo " booth_test: Run booth tests"
echo " optional file: File to test (for server_test and booth_test)"
}
# Check if at least one argument is provided
if [ $# -eq 0 ]; then
echo "Error: No arguments provided"
display_help
exit 1
fi
# Get the task and optional file argument
TASK=$1
FILE=$2
# Run the appropriate task
case $TASK in
booth_run)
echo "running booth"
sudo venv/bin/python3 booth/main.py
;;
server_test)
# Navigate to 'server' and run tests
pushd server
echo "Running server tests..."
deno test --allow-all $FILE
popd
;;
server_start)
# Navigate to 'server' and run deno fresh
pushd server
echo "Running deno fresh..."
deno task start
popd
;;
booth_test)
# Navigate to 'booth' and run tests
pushd booth
echo "Running booth tests..."
python3 -m unittest $FILE
popd
;;
*)
echo "Error: Invalid task"
display_help
exit 1
;;
esac