Skip to content

Commit 301b98b

Browse files
authored
refine UI test (#2238)
Signed-off-by: ZePan110 <[email protected]>
1 parent c5e5189 commit 301b98b

29 files changed

+84
-881
lines changed

.github/workflows/_run-docker-compose.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ jobs:
110110
run_test_cases=$other_test_cases
111111
fi
112112
113+
if [[ "${{ hardware }}" == "xeon"* ]]; then
114+
if [ -f "${{ github.workspace }}/${{ inputs.example }}/tests/test_ui_on_xeon.sh" ]; then
115+
run_test_cases="$run_test_cases test_ui_on_xeon.sh";
116+
fi
117+
fi
113118
test_cases=$(echo $run_test_cases | tr ' ' '\n' | sort -u | jq -R '.' | jq -sc '.')
114119
echo "test_cases=$test_cases"
115120
echo "test_cases=$test_cases" >> $GITHUB_OUTPUT

ChatQnA/tests/test_compose_faqgen_on_epyc.sh

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -196,37 +196,6 @@ function validate_megaservice() {
196196

197197
}
198198

199-
function validate_frontend() {
200-
cd $WORKPATH/ui/svelte
201-
local conda_env_name="OPEA_e2e"
202-
export PATH=${HOME}/miniforge3/bin/:$PATH
203-
if conda info --envs | grep -q "$conda_env_name"; then
204-
echo "$conda_env_name exist!"
205-
else
206-
conda create -n ${conda_env_name} python=3.12 -y
207-
fi
208-
CONDA_ROOT=$(conda info --base)
209-
source "${CONDA_ROOT}/etc/profile.d/conda.sh"
210-
conda activate ${conda_env_name}
211-
212-
sed -i "s/localhost/$ip_address/g" playwright.config.ts
213-
214-
conda install -c conda-forge nodejs=22.6.0 -y
215-
# npm install && npm ci && npx playwright install --with-deps
216-
npm install && npm ci && npx playwright install
217-
node -v && npm -v && pip list
218-
219-
exit_status=0
220-
npx playwright test || exit_status=$?
221-
222-
if [ $exit_status -ne 0 ]; then
223-
echo "[TEST INFO]: ---------frontend test failed---------"
224-
exit $exit_status
225-
else
226-
echo "[TEST INFO]: ---------frontend test passed---------"
227-
fi
228-
}
229-
230199
function stop_docker() {
231200
cd $WORKPATH/docker_compose/amd/cpu/epyc
232201
docker compose -f compose_faqgen.yaml down
@@ -254,10 +223,6 @@ function main() {
254223
validate_megaservice
255224
echo "::endgroup::"
256225

257-
echo "::group::validate_frontend"
258-
validate_frontend
259-
echo "::endgroup::"
260-
261226
echo "::group::stop_docker"
262227
stop_docker
263228
echo "::endgroup::"

ChatQnA/tests/test_compose_faqgen_on_gaudi.sh

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -185,34 +185,6 @@ function validate_megaservice() {
185185

186186
}
187187

188-
function validate_frontend() {
189-
cd $WORKPATH/ui/svelte
190-
local conda_env_name="OPEA_e2e"
191-
export PATH=${HOME}/miniforge3/bin/:$PATH
192-
if conda info --envs | grep -q "$conda_env_name"; then
193-
echo "$conda_env_name exist!"
194-
else
195-
conda create -n ${conda_env_name} python=3.12 -y
196-
fi
197-
source activate ${conda_env_name}
198-
199-
sed -i "s/localhost/$ip_address/g" playwright.config.ts
200-
201-
conda install -c conda-forge nodejs=22.6.0 -y
202-
npm install && npm ci && npx playwright install --with-deps
203-
node -v && npm -v && pip list
204-
205-
exit_status=0
206-
npx playwright test || exit_status=$?
207-
208-
if [ $exit_status -ne 0 ]; then
209-
echo "[TEST INFO]: ---------frontend test failed---------"
210-
exit $exit_status
211-
else
212-
echo "[TEST INFO]: ---------frontend test passed---------"
213-
fi
214-
}
215-
216188
function stop_docker() {
217189
cd $WORKPATH/docker_compose/intel/hpu/gaudi
218190
docker compose -f compose_faqgen.yaml down
@@ -240,10 +212,6 @@ function main() {
240212
validate_megaservice
241213
echo "::endgroup::"
242214

243-
echo "::group::validate_frontend"
244-
validate_frontend
245-
echo "::endgroup::"
246-
247215
echo "::group::stop_docker"
248216
stop_docker
249217
echo "::endgroup::"

ChatQnA/tests/test_compose_faqgen_on_rocm.sh

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -163,36 +163,6 @@ function validate_megaservice() {
163163

164164
}
165165

166-
function validate_frontend() {
167-
echo "[ TEST INFO ]: --------- frontend test started ---------"
168-
cd "$WORKPATH"/ui/svelte
169-
local conda_env_name="OPEA_e2e"
170-
export PATH=${HOME}/miniconda3/bin/:$PATH
171-
if conda info --envs | grep -q "$conda_env_name"; then
172-
echo "$conda_env_name exist!"
173-
else
174-
conda create -n ${conda_env_name} python=3.12 -y
175-
fi
176-
source activate ${conda_env_name}
177-
echo "[ TEST INFO ]: --------- conda env activated ---------"
178-
179-
sed -i "s/localhost/$ip_address/g" playwright.config.ts
180-
181-
conda install -c conda-forge nodejs=22.6.0 -y
182-
npm install && npm ci && npx playwright install --with-deps
183-
node -v && npm -v && pip list
184-
185-
exit_status=0
186-
npx playwright test || exit_status=$?
187-
188-
if [ $exit_status -ne 0 ]; then
189-
echo "[TEST INFO]: ---------frontend test failed---------"
190-
exit $exit_status
191-
else
192-
echo "[TEST INFO]: ---------frontend test passed---------"
193-
fi
194-
}
195-
196166
function stop_docker() {
197167
cd "$WORKPATH"/docker_compose/amd/gpu/rocm
198168
docker compose -f compose_faqgen.yaml stop && docker compose rm -f
@@ -220,10 +190,6 @@ function main() {
220190
validate_megaservice
221191
echo "::endgroup::"
222192

223-
echo "::group::validate_frontend"
224-
validate_frontend
225-
echo "::endgroup::"
226-
227193
echo "::group::stop_docker"
228194
stop_docker
229195
echo "::endgroup::"

ChatQnA/tests/test_compose_faqgen_on_xeon.sh

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -194,34 +194,6 @@ function validate_megaservice() {
194194

195195
}
196196

197-
function validate_frontend() {
198-
cd $WORKPATH/ui/svelte
199-
local conda_env_name="OPEA_e2e"
200-
export PATH=${HOME}/miniforge3/bin/:$PATH
201-
if conda info --envs | grep -q "$conda_env_name"; then
202-
echo "$conda_env_name exist!"
203-
else
204-
conda create -n ${conda_env_name} python=3.12 -y
205-
fi
206-
source activate ${conda_env_name}
207-
208-
sed -i "s/localhost/$ip_address/g" playwright.config.ts
209-
210-
conda install -c conda-forge nodejs=22.6.0 -y
211-
npm install && npm ci && npx playwright install --with-deps
212-
node -v && npm -v && pip list
213-
214-
exit_status=0
215-
npx playwright test || exit_status=$?
216-
217-
if [ $exit_status -ne 0 ]; then
218-
echo "[TEST INFO]: ---------frontend test failed---------"
219-
exit $exit_status
220-
else
221-
echo "[TEST INFO]: ---------frontend test passed---------"
222-
fi
223-
}
224-
225197
function stop_docker() {
226198
cd $WORKPATH/docker_compose/intel/cpu/xeon
227199
docker compose -f compose_faqgen.yaml down
@@ -249,10 +221,6 @@ function main() {
249221
validate_megaservice
250222
echo "::endgroup::"
251223

252-
echo "::group::validate_frontend"
253-
validate_frontend
254-
echo "::endgroup::"
255-
256224
echo "::group::stop_docker"
257225
stop_docker
258226
echo "::endgroup::"

ChatQnA/tests/test_compose_faqgen_tgi_on_epyc.sh

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -196,37 +196,6 @@ function validate_megaservice() {
196196

197197
}
198198

199-
function validate_frontend() {
200-
cd $WORKPATH/ui/svelte
201-
local conda_env_name="OPEA_e2e"
202-
export PATH=${HOME}/miniforge3/bin/:$PATH
203-
if conda info --envs | grep -q "$conda_env_name"; then
204-
echo "$conda_env_name exist!"
205-
else
206-
conda create -n ${conda_env_name} python=3.12 -y
207-
fi
208-
CONDA_ROOT=$(conda info --base)
209-
source "${CONDA_ROOT}/etc/profile.d/conda.sh"
210-
conda activate ${conda_env_name}
211-
212-
sed -i "s/localhost/$ip_address/g" playwright.config.ts
213-
214-
conda install -c conda-forge nodejs=22.6.0 -y
215-
# npm install && npm ci && npx playwright install --with-deps
216-
npm install && npm ci && npx playwright install
217-
node -v && npm -v && pip list
218-
219-
exit_status=0
220-
npx playwright test || exit_status=$?
221-
222-
if [ $exit_status -ne 0 ]; then
223-
echo "[TEST INFO]: ---------frontend test failed---------"
224-
exit $exit_status
225-
else
226-
echo "[TEST INFO]: ---------frontend test passed---------"
227-
fi
228-
}
229-
230199
function stop_docker() {
231200
cd $WORKPATH/docker_compose/amd/cpu/epyc
232201
docker compose -f compose_faqgen_tgi.yaml down
@@ -254,10 +223,6 @@ function main() {
254223
validate_megaservice
255224
echo "::endgroup::"
256225

257-
echo "::group::validate_frontend"
258-
validate_frontend
259-
echo "::endgroup::"
260-
261226
echo "::group::stop_docker"
262227
stop_docker
263228
echo "::endgroup::"

ChatQnA/tests/test_compose_faqgen_tgi_on_gaudi.sh

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -186,34 +186,6 @@ function validate_megaservice() {
186186

187187
}
188188

189-
function validate_frontend() {
190-
cd $WORKPATH/ui/svelte
191-
local conda_env_name="OPEA_e2e"
192-
export PATH=${HOME}/miniforge3/bin/:$PATH
193-
if conda info --envs | grep -q "$conda_env_name"; then
194-
echo "$conda_env_name exist!"
195-
else
196-
conda create -n ${conda_env_name} python=3.12 -y
197-
fi
198-
source activate ${conda_env_name}
199-
200-
sed -i "s/localhost/$ip_address/g" playwright.config.ts
201-
202-
conda install -c conda-forge nodejs=22.6.0 -y
203-
npm install && npm ci && npx playwright install --with-deps
204-
node -v && npm -v && pip list
205-
206-
exit_status=0
207-
npx playwright test || exit_status=$?
208-
209-
if [ $exit_status -ne 0 ]; then
210-
echo "[TEST INFO]: ---------frontend test failed---------"
211-
exit $exit_status
212-
else
213-
echo "[TEST INFO]: ---------frontend test passed---------"
214-
fi
215-
}
216-
217189
function stop_docker() {
218190
cd $WORKPATH/docker_compose/intel/hpu/gaudi
219191
docker compose -f compose_faqgen_tgi.yaml down
@@ -241,10 +213,6 @@ function main() {
241213
validate_megaservice
242214
echo "::endgroup::"
243215

244-
echo "::group::validate_frontend"
245-
validate_frontend
246-
echo "::endgroup::"
247-
248216
echo "::group::stop_docker"
249217
stop_docker
250218
echo "::endgroup::"

ChatQnA/tests/test_compose_faqgen_tgi_on_xeon.sh

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -198,34 +198,6 @@ function validate_megaservice() {
198198

199199
}
200200

201-
function validate_frontend() {
202-
cd $WORKPATH/ui/svelte
203-
local conda_env_name="OPEA_e2e"
204-
export PATH=${HOME}/miniforge3/bin/:$PATH
205-
if conda info --envs | grep -q "$conda_env_name"; then
206-
echo "$conda_env_name exist!"
207-
else
208-
conda create -n ${conda_env_name} python=3.12 -y
209-
fi
210-
source activate ${conda_env_name}
211-
212-
sed -i "s/localhost/$ip_address/g" playwright.config.ts
213-
214-
conda install -c conda-forge nodejs=22.6.0 -y
215-
npm install && npm ci && npx playwright install --with-deps
216-
node -v && npm -v && pip list
217-
218-
exit_status=0
219-
npx playwright test || exit_status=$?
220-
221-
if [ $exit_status -ne 0 ]; then
222-
echo "[TEST INFO]: ---------frontend test failed---------"
223-
exit $exit_status
224-
else
225-
echo "[TEST INFO]: ---------frontend test passed---------"
226-
fi
227-
}
228-
229201
function stop_docker() {
230202
cd $WORKPATH/docker_compose/intel/cpu/xeon
231203
docker compose -f compose_faqgen_tgi.yaml down
@@ -253,10 +225,6 @@ function main() {
253225
validate_megaservice
254226
echo "::endgroup::"
255227

256-
echo "::group::validate_frontend"
257-
validate_frontend
258-
echo "::endgroup::"
259-
260228
echo "::group::stop_docker"
261229
stop_docker
262230
echo "::endgroup::"

ChatQnA/tests/test_compose_faqgen_vllm_on_rocm.sh

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -138,35 +138,6 @@ function validate_megaservice() {
138138

139139
}
140140

141-
function validate_frontend() {
142-
cd $WORKPATH/ui/svelte
143-
local conda_env_name="OPEA_e2e"
144-
export PATH=${HOME}/miniconda3/bin/:$PATH
145-
if conda info --envs | grep -q "$conda_env_name"; then
146-
echo "$conda_env_name exist!"
147-
else
148-
conda create -n ${conda_env_name} python=3.12 -y
149-
fi
150-
151-
source activate ${conda_env_name}
152-
153-
sed -i "s/localhost/$ip_address/g" playwright.config.ts
154-
155-
conda install -c conda-forge nodejs=22.6.0 -y
156-
npm install && npm ci && npx playwright install --with-deps
157-
node -v && npm -v && pip list
158-
159-
exit_status=0
160-
npx playwright test || exit_status=$?
161-
162-
if [ $exit_status -ne 0 ]; then
163-
echo "[TEST INFO]: ---------frontend test failed---------"
164-
exit $exit_status
165-
else
166-
echo "[TEST INFO]: ---------frontend test passed---------"
167-
fi
168-
}
169-
170141
function stop_docker() {
171142
cd $WORKPATH/docker_compose/amd/gpu/rocm
172143
docker compose -f compose_vllm.yaml down
@@ -194,10 +165,6 @@ function main() {
194165
validate_megaservice
195166
echo "::endgroup::"
196167

197-
echo "::group::validate_frontend"
198-
validate_frontend
199-
echo "::endgroup::"
200-
201168
echo "::group::stop_docker"
202169
stop_docker
203170
echo "::endgroup::"

0 commit comments

Comments
 (0)