Skip to content

Commit 86c7ac7

Browse files
authored
Refine UI test scripts. (#2282)
Signed-off-by: ZePan110 <[email protected]>
1 parent aee357f commit 86c7ac7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1142
-1373
lines changed

ChatQnA/tests/test_compose_openeuler_on_xeon.sh

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -126,36 +126,6 @@ function validate_megaservice() {
126126

127127
}
128128

129-
function validate_frontend() {
130-
cd $WORKPATH/ui/svelte
131-
132-
echo "[TEST INFO]: Preparing frontend test using Docker..."
133-
134-
sed -i "s/localhost/$ip_address/g" playwright.config.ts
135-
136-
echo "[TEST INFO]: Running frontend tests in Docker..."
137-
exit_status=0
138-
139-
docker run --rm \
140-
--network="host" \
141-
-v $PWD:/work \
142-
-w /work \
143-
mcr.microsoft.com/playwright:v1.40.0-focal \
144-
/bin/bash -c "
145-
npm install &&
146-
npm ci &&
147-
npx playwright install &&
148-
npx playwright test
149-
" || exit_status=$?
150-
151-
if [ $exit_status -ne 0 ]; then
152-
echo "[TEST INFO]: ---------frontend test failed---------"
153-
exit $exit_status
154-
else
155-
echo "[TEST INFO]: ---------frontend test passed---------"
156-
fi
157-
}
158-
159129
function stop_docker() {
160130
cd $WORKPATH/docker_compose/intel/cpu/xeon
161131
docker compose -f compose_openeuler.yaml -f compose.telemetry.yaml down
File renamed without changes.

CodeGen/tests/test_compose_on_epyc.sh

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -159,47 +159,6 @@ function validate_megaservice() {
159159

160160
}
161161

162-
function validate_frontend() {
163-
cd $WORKPATH/ui/svelte
164-
local conda_env_name="OPEA_e2e"
165-
export PATH=${HOME}/miniforge3/bin/:$PATH
166-
if conda info --envs | grep -q "$conda_env_name"; then
167-
echo "$conda_env_name exist!"
168-
else
169-
conda create -n ${conda_env_name} python=3.12 -y
170-
fi
171-
source activate ${conda_env_name}
172-
173-
sed -i "s/localhost/$ip_address/g" playwright.config.ts
174-
175-
conda install -c conda-forge nodejs=22.6.0 -y
176-
# npm install && npm ci && npx playwright install --with-deps
177-
npm install && npm ci && npx playwright install
178-
node -v && npm -v && pip list
179-
180-
exit_status=0
181-
npx playwright test || exit_status=$?
182-
183-
if [ $exit_status -ne 0 ]; then
184-
echo "[TEST INFO]: ---------frontend test failed---------"
185-
exit $exit_status
186-
else
187-
echo "[TEST INFO]: ---------frontend test passed---------"
188-
fi
189-
}
190-
191-
function validate_gradio() {
192-
local URL="http://${ip_address}:5173/health"
193-
local HTTP_STATUS=$(curl "$URL")
194-
local SERVICE_NAME="Gradio"
195-
196-
if [ "$HTTP_STATUS" = '{"status":"ok"}' ]; then
197-
echo "[ $SERVICE_NAME ] HTTP status is 200. UI server is running successfully..."
198-
else
199-
echo "[ $SERVICE_NAME ] UI server has failed..."
200-
fi
201-
}
202-
203162
function stop_docker() {
204163
local compose_file="$1"
205164

@@ -247,10 +206,6 @@ function main() {
247206
validate_megaservice
248207
echo "::endgroup::"
249208

250-
echo "::group::validate_gradio"
251-
validate_gradio
252-
echo "::endgroup::"
253-
254209
stop_docker "${docker_compose_files[${i}]}"
255210
sleep 5s
256211
done

CodeGen/tests/test_compose_on_gaudi.sh

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -146,46 +146,6 @@ function validate_megaservice() {
146146

147147
}
148148

149-
function validate_frontend() {
150-
cd $WORKPATH/ui/svelte
151-
local conda_env_name="OPEA_e2e"
152-
export PATH=${HOME}/miniforge3/bin/:$PATH
153-
if conda info --envs | grep -q "$conda_env_name"; then
154-
echo "$conda_env_name exist!"
155-
else
156-
conda create -n ${conda_env_name} python=3.12 -y
157-
fi
158-
source activate ${conda_env_name}
159-
160-
sed -i "s/localhost/$ip_address/g" playwright.config.ts
161-
162-
conda install -c conda-forge nodejs=22.6.0 -y
163-
npm install && npm ci && npx playwright install --with-deps
164-
node -v && npm -v && pip list
165-
166-
exit_status=0
167-
npx playwright test || exit_status=$?
168-
169-
if [ $exit_status -ne 0 ]; then
170-
echo "[TEST INFO]: ---------frontend test failed---------"
171-
exit $exit_status
172-
else
173-
echo "[TEST INFO]: ---------frontend test passed---------"
174-
fi
175-
}
176-
177-
function validate_gradio() {
178-
local URL="http://${ip_address}:5173/health"
179-
local HTTP_STATUS=$(curl "$URL")
180-
local SERVICE_NAME="Gradio"
181-
182-
if [ "$HTTP_STATUS" = '{"status":"ok"}' ]; then
183-
echo "[ $SERVICE_NAME ] HTTP status is 200. UI server is running successfully..."
184-
else
185-
echo "[ $SERVICE_NAME ] UI server has failed..."
186-
fi
187-
}
188-
189149
function stop_docker() {
190150
local compose_file="$1"
191151

@@ -234,10 +194,6 @@ function main() {
234194
validate_megaservice
235195
echo "::endgroup::"
236196

237-
echo "::group::validate_gradio"
238-
validate_gradio
239-
echo "::endgroup::"
240-
241197
stop_docker "${docker_compose_files[${i}]}"
242198
sleep 5s
243199
done

CodeGen/tests/test_compose_on_rocm.sh

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

112112
}
113113

114-
function validate_frontend() {
115-
cd $WORKPATH/ui/svelte
116-
local conda_env_name="OPEA_e2e"
117-
export PATH=${HOME}/miniconda3/bin/:$PATH
118-
if conda info --envs | grep -q "$conda_env_name"; then
119-
echo "$conda_env_name exist!"
120-
else
121-
conda create -n ${conda_env_name} python=3.12 -y
122-
fi
123-
source activate ${conda_env_name}
124-
125-
sed -i "s/localhost/$ip_address/g" playwright.config.ts
126-
127-
conda install -c conda-forge nodejs=22.6.0 -y
128-
npm install && npm ci && npx playwright install --with-deps
129-
node -v && npm -v && pip list
130-
131-
exit_status=0
132-
npx playwright test || exit_status=$?
133-
134-
if [ $exit_status -ne 0 ]; then
135-
echo "[TEST INFO]: ---------frontend test failed---------"
136-
exit $exit_status
137-
else
138-
echo "[TEST INFO]: ---------frontend test passed---------"
139-
fi
140-
}
141-
142-
143114
function stop_docker() {
144115
cd $WORKPATH/docker_compose/amd/gpu/rocm/
145116
docker compose stop && docker compose rm -f
@@ -167,10 +138,6 @@ function main() {
167138
validate_megaservice
168139
echo "::endgroup::"
169140

170-
echo "::group::validate_frontend"
171-
validate_frontend
172-
echo "::endgroup::"
173-
174141
echo "::group::stop_docker"
175142
stop_docker
176143
echo "::endgroup::"

CodeGen/tests/test_compose_on_xeon.sh

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -157,48 +157,6 @@ function validate_megaservice() {
157157

158158
}
159159

160-
function validate_frontend() {
161-
cd $WORKPATH/ui/svelte
162-
local conda_env_name="OPEA_e2e"
163-
export PATH=${HOME}/miniforge3/bin/:$PATH
164-
if conda info --envs | grep -q "$conda_env_name"; then
165-
echo "$conda_env_name exist!"
166-
else
167-
conda create -n ${conda_env_name} python=3.12 -y
168-
fi
169-
source activate ${conda_env_name}
170-
171-
sed -i "s/localhost/$ip_address/g" playwright.config.ts
172-
173-
conda install -c conda-forge nodejs=22.6.0 -y
174-
npm install && npm ci && npx playwright install --with-deps
175-
node -v && npm -v && pip list
176-
177-
export no_proxy="localhost,127.0.0.1,$ip_address"
178-
179-
exit_status=0
180-
npx playwright test || exit_status=$?
181-
182-
if [ $exit_status -ne 0 ]; then
183-
echo "[TEST INFO]: ---------frontend test failed---------"
184-
exit $exit_status
185-
else
186-
echo "[TEST INFO]: ---------frontend test passed---------"
187-
fi
188-
}
189-
190-
function validate_gradio() {
191-
local URL="http://${ip_address}:5173/health"
192-
local HTTP_STATUS=$(curl "$URL")
193-
local SERVICE_NAME="Gradio"
194-
195-
if [ "$HTTP_STATUS" = '{"status":"ok"}' ]; then
196-
echo "[ $SERVICE_NAME ] HTTP status is 200. UI server is running successfully..."
197-
else
198-
echo "[ $SERVICE_NAME ] UI server has failed..."
199-
fi
200-
}
201-
202160
function stop_docker() {
203161
local compose_file="$1"
204162

@@ -246,14 +204,6 @@ function main() {
246204
validate_megaservice
247205
echo "::endgroup::"
248206

249-
# echo "::group::validate_gradio"
250-
# validate_gradio
251-
# echo "::endgroup::"
252-
253-
echo "::group::validate_ui"
254-
validate_frontend
255-
echo "::endgroup::"
256-
257207
stop_docker "${docker_compose_files[${i}]}"
258208
sleep 5s
259209
done

CodeGen/tests/test_compose_openeuler_on_xeon.sh

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -157,47 +157,6 @@ function validate_megaservice() {
157157

158158
}
159159

160-
function validate_frontend() {
161-
cd $WORKPATH/ui/svelte
162-
echo "[TEST INFO]: Preparing frontend test using Docker..."
163-
164-
sed -i "s/localhost/$ip_address/g" playwright.config.ts
165-
166-
echo "[TEST INFO]: Running frontend tests in Docker..."
167-
exit_status=0
168-
169-
docker run --rm \
170-
--network="host" \
171-
-v $PWD:/work \
172-
-w /work \
173-
mcr.microsoft.com/playwright:v1.40.0-focal \
174-
/bin/bash -c "
175-
npm install &&
176-
npm ci &&
177-
npx playwright install &&
178-
npx playwright test
179-
" || exit_status=$?
180-
181-
if [ $exit_status -ne 0 ]; then
182-
echo "[TEST INFO]: ---------frontend test failed---------"
183-
exit $exit_status
184-
else
185-
echo "[TEST INFO]: ---------frontend test passed---------"
186-
fi
187-
}
188-
189-
function validate_gradio() {
190-
local URL="http://${ip_address}:5173/health"
191-
local HTTP_STATUS=$(curl "$URL")
192-
local SERVICE_NAME="Gradio"
193-
194-
if [ "$HTTP_STATUS" = '{"status":"ok"}' ]; then
195-
echo "[ $SERVICE_NAME ] HTTP status is 200. UI server is running successfully..."
196-
else
197-
echo "[ $SERVICE_NAME ] UI server has failed..."
198-
fi
199-
}
200-
201160
function stop_service() {
202161
local compose_file="$1"
203162

@@ -245,10 +204,6 @@ function main() {
245204
validate_megaservice
246205
echo "::endgroup::"
247206

248-
echo "::group::validate_gradio"
249-
validate_gradio
250-
echo "::endgroup::"
251-
252207
stop_service "${docker_compose_files[${i}]}"
253208
sleep 5s
254209
done

CodeGen/tests/test_compose_tgi_on_epyc.sh

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -159,47 +159,6 @@ function validate_megaservice() {
159159

160160
}
161161

162-
function validate_frontend() {
163-
cd $WORKPATH/ui/svelte
164-
local conda_env_name="OPEA_e2e"
165-
export PATH=${HOME}/miniforge3/bin/:$PATH
166-
if conda info --envs | grep -q "$conda_env_name"; then
167-
echo "$conda_env_name exist!"
168-
else
169-
conda create -n ${conda_env_name} python=3.12 -y
170-
fi
171-
source activate ${conda_env_name}
172-
173-
sed -i "s/localhost/$ip_address/g" playwright.config.ts
174-
175-
conda install -c conda-forge nodejs=22.6.0 -y
176-
# npm install && npm ci && npx playwright install --with-deps
177-
npm install && npm ci && npx playwright install
178-
node -v && npm -v && pip list
179-
180-
exit_status=0
181-
npx playwright test || exit_status=$?
182-
183-
if [ $exit_status -ne 0 ]; then
184-
echo "[TEST INFO]: ---------frontend test failed---------"
185-
exit $exit_status
186-
else
187-
echo "[TEST INFO]: ---------frontend test passed---------"
188-
fi
189-
}
190-
191-
function validate_gradio() {
192-
local URL="http://${ip_address}:5173/health"
193-
local HTTP_STATUS=$(curl "$URL")
194-
local SERVICE_NAME="Gradio"
195-
196-
if [ "$HTTP_STATUS" = '{"status":"ok"}' ]; then
197-
echo "[ $SERVICE_NAME ] HTTP status is 200. UI server is running successfully..."
198-
else
199-
echo "[ $SERVICE_NAME ] UI server has failed..."
200-
fi
201-
}
202-
203162
function stop_docker() {
204163
local compose_file="$1"
205164

@@ -247,10 +206,6 @@ function main() {
247206
validate_megaservice
248207
echo "::endgroup::"
249208

250-
echo "::group::validate_gradio"
251-
validate_gradio
252-
echo "::endgroup::"
253-
254209
stop_docker "${docker_compose_files[${i}]}"
255210
sleep 5s
256211
done

0 commit comments

Comments
 (0)