-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·56 lines (47 loc) · 1.49 KB
/
test.sh
File metadata and controls
executable file
·56 lines (47 loc) · 1.49 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
#!/bin/bash
set -x
cd "$(dirname "$0")"
RUN_E2E=true
RUN_PLAYWRIGHT=true
while [[ $# -gt 0 ]]; do
case $1 in
--no-e2e)
RUN_E2E=false
shift
;;
--no-playwright)
RUN_PLAYWRIGHT=false
shift
;;
-h|--help)
echo "Usage: ./test.sh [options]"
echo ""
echo "Options:"
echo " --no-e2e Skip all E2E tests"
echo " --no-playwright Skip Playwright tests (still runs TestClient E2E)"
echo " -h, --help Show this help"
exit 0
;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
done
echo "=== Installing package in development mode ==="
pip3 install -e ".[dev]" -q
pip3 install playwright -q
echo "=== Running ruff linter ==="
ruff check src/ tests/ || true
echo "=== Running pytest (Unit Tests + API Tests) ==="
python3 -m pytest tests/ -v --tb=short -W ignore -k "not (TestWebE2E or TestWebE2EBrowser or TestWebPlaywright)"
if [ "$RUN_E2E" = true ]; then
echo "=== Running E2E Tests (TestClient) ==="
python3 -m pytest tests/test_web.py::TestWebE2E tests/test_web.py::TestWebE2EBrowser -v --tb=short -W ignore
if [ "$RUN_PLAYWRIGHT" = true ]; then
echo "=== Running E2E Tests (Playwright) ==="
export CODE5_WEB_USE_MOCK=true
python3 -m pytest tests/test_web.py::TestWebPlaywright -v --tb=short -W ignore
fi
fi
echo "=== Test complete ==="