-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_tests.sh
More file actions
executable file
·72 lines (65 loc) · 1.61 KB
/
Copy pathrun_tests.sh
File metadata and controls
executable file
·72 lines (65 loc) · 1.61 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
#!/bin/bash
# Script to run tests with various options
set -e
echo "Running AI Inscription App Tests"
echo "================================="
echo ""
# Function to show usage
usage() {
echo "Usage: $0 [OPTIONS]"
echo ""
echo "Options:"
echo " -a, --all Run all tests (default)"
echo " -u, --unit Run only unit tests"
echo " -i, --integration Run only integration tests"
echo " -c, --coverage Run tests with coverage report"
echo " -v, --verbose Run tests with verbose output"
echo " -h, --help Show this help message"
echo ""
exit 0
}
# Default options
MARKERS=""
VERBOSE=""
COVERAGE=""
# Parse command line arguments
while [[ $# -gt 0 ]]; do
case $1 in
-a|--all)
MARKERS=""
shift
;;
-u|--unit)
MARKERS="-m unit"
shift
;;
-i|--integration)
MARKERS="-m integration"
shift
;;
-c|--coverage)
COVERAGE="--cov=. --cov-report=html --cov-report=term"
shift
;;
-v|--verbose)
VERBOSE="-vv"
shift
;;
-h|--help)
usage
;;
*)
echo "Unknown option: $1"
usage
;;
esac
done
# Run pytest with the specified options
echo "Running: pytest tests/ $MARKERS $VERBOSE $COVERAGE"
echo ""
python3 -m pytest tests/ $MARKERS $VERBOSE $COVERAGE
# If coverage was run, show report location
if [[ -n "$COVERAGE" ]]; then
echo ""
echo "Coverage report generated in htmlcov/index.html"
fi