-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathrunFloodgate.sh
More file actions
executable file
·146 lines (127 loc) · 3.11 KB
/
Copy pathrunFloodgate.sh
File metadata and controls
executable file
·146 lines (127 loc) · 3.11 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#!/bin/bash
# =============================================================================
# Summit 2026 Floodgate Migration - Test Runner Script
# =============================================================================
#
# Usage:
# ./runFloodgate.sh [options]
#
# Options:
# --phase=<a|b|c|d> Run specific phase tests
# --security Run security tests only
# --cache Run cache tests only
# --smoke Run smoke tests only
# --env=<stage|prod> Set environment (default: stage)
# --browser=<chrome|firefox|webkit|all> Browser (default: chrome)
# --headed Run with browser visible
# --debug Run in debug mode
#
# Examples:
# ./runFloodgate.sh --smoke --env=stage
# ./runFloodgate.sh --phase=a --browser=chrome
# ./runFloodgate.sh --security
#
# =============================================================================
set -e
# Default values
PHASE=""
SECURITY=false
CACHE=false
SMOKE=false
ENV="stage"
BROWSER="chrome"
HEADED=""
DEBUG=""
# Parse arguments
for arg in "$@"; do
case $arg in
--phase=*)
PHASE="${arg#*=}"
;;
--security)
SECURITY=true
;;
--cache)
CACHE=true
;;
--smoke)
SMOKE=true
;;
--env=*)
ENV="${arg#*=}"
;;
--browser=*)
BROWSER="${arg#*=}"
;;
--headed)
HEADED="--headed"
;;
--debug)
DEBUG="--debug"
;;
--help)
head -30 "$0" | tail -25
exit 0
;;
esac
done
echo "=============================================================="
echo "Summit 2026 Floodgate Migration - Test Runner"
echo "=============================================================="
echo "Environment: $ENV"
echo "Browser: $BROWSER"
echo "=============================================================="
# Set environment
export FG_ENV=$ENV
# Build grep pattern
GREP=""
if [ -n "$PHASE" ]; then
case $PHASE in
a) GREP="@before-event" ;;
b) GREP="@during-event" ;;
c) GREP="@after-event" ;;
d) GREP="@edge-case" ;;
esac
echo "Phase: $PHASE ($GREP)"
fi
if [ "$SECURITY" = true ]; then
GREP="@security"
echo "Running: Security tests"
fi
if [ "$CACHE" = true ]; then
GREP="@cache"
echo "Running: Cache tests"
fi
if [ "$SMOKE" = true ]; then
GREP="@smoke"
echo "Running: Smoke tests"
fi
# Build project name
PROJECT="floodgate-$ENV-$BROWSER"
if [ "$BROWSER" = "all" ]; then
PROJECT=""
fi
echo "=============================================================="
# Build command
CMD="npx playwright test --config=configs/floodgate.config.js"
if [ -n "$PROJECT" ]; then
CMD="$CMD --project=$PROJECT"
fi
if [ -n "$GREP" ]; then
CMD="$CMD --grep='$GREP'"
fi
if [ -n "$HEADED" ]; then
CMD="$CMD $HEADED"
fi
if [ -n "$DEBUG" ]; then
CMD="$CMD $DEBUG"
fi
echo "Running: $CMD"
echo "=============================================================="
# Execute
eval $CMD
echo ""
echo "=============================================================="
echo "Test run complete!"
echo "Reports: test-html-results/floodgate/index.html"
echo "=============================================================="