Skip to content

Commit 64f797f

Browse files
committed
refine UI test
Signed-off-by: ZePan110 <[email protected]>
1 parent ed1cf28 commit 64f797f

14 files changed

+122
-404
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ jobs:
106106
fi
107107
done
108108
109+
run_test_cases="$run_test_cases test_ui.sh"
109110
if [ -z "$run_test_cases" ] && [[ $(printf '%s\n' "${changed_files[@]}" | grep ${{ inputs.example }} | grep /tests/) ]]; then
110111
run_test_cases=$other_test_cases
111112
fi

ChatQnA/tests/test_compose_on_xeon.sh

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

133133
}
134134

135-
function validate_frontend() {
136-
cd $WORKPATH/ui/svelte
137-
local conda_env_name="OPEA_e2e"
138-
export PATH=${HOME}/miniforge3/bin/:$PATH
139-
if conda info --envs | grep -q "$conda_env_name"; then
140-
echo "$conda_env_name exist!"
141-
else
142-
conda create -n ${conda_env_name} python=3.12 -y
143-
fi
144-
145-
source activate ${conda_env_name}
146-
147-
sed -i "s/localhost/$ip_address/g" playwright.config.ts
148-
149-
conda install -c conda-forge nodejs=22.6.0 -y
150-
npm install && npm ci && npx playwright install --with-deps
151-
node -v && npm -v && pip list
152-
153-
exit_status=0
154-
npx playwright test || exit_status=$?
155-
156-
if [ $exit_status -ne 0 ]; then
157-
echo "[TEST INFO]: ---------frontend test failed---------"
158-
exit $exit_status
159-
else
160-
echo "[TEST INFO]: ---------frontend test passed---------"
161-
fi
162-
}
163-
164135
function stop_docker() {
165136
cd $WORKPATH/docker_compose/intel/cpu/xeon
166137
docker compose -f compose.yaml -f compose.telemetry.yaml down
@@ -188,10 +159,6 @@ function main() {
188159
validate_megaservice
189160
echo "::endgroup::"
190161

191-
echo "::group::validate_frontend"
192-
validate_frontend
193-
echo "::endgroup::"
194-
195162
echo "::group::stop_docker"
196163
stop_docker
197164
echo "::endgroup::"

ChatQnA/tests/test_compose_pinecone_on_epyc.sh

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -176,39 +176,6 @@ function validate_megaservice() {
176176

177177
}
178178

179-
function validate_frontend() {
180-
echo "[ TEST INFO ]: --------- frontend test started ---------"
181-
cd $WORKPATH/ui/svelte
182-
local conda_env_name="OPEA_e2e"
183-
export PATH=${HOME}/miniforge3/bin/:$PATH
184-
if conda info --envs | grep -q "$conda_env_name"; then
185-
echo "$conda_env_name exist!"
186-
else
187-
conda create -n ${conda_env_name} python=3.12 -y
188-
fi
189-
CONDA_ROOT=$(conda info --base)
190-
source "${CONDA_ROOT}/etc/profile.d/conda.sh"
191-
conda activate ${conda_env_name}
192-
echo "[ TEST INFO ]: --------- conda env activated ---------"
193-
194-
sed -i "s/localhost/$ip_address/g" playwright.config.ts
195-
196-
conda install -c conda-forge nodejs=22.6.0 -y
197-
# npm install && npm ci && npx playwright install --with-deps
198-
npm install && npm ci && npx playwright install
199-
node -v && npm -v && pip list
200-
201-
exit_status=0
202-
npx playwright test || exit_status=$?
203-
204-
if [ $exit_status -ne 0 ]; then
205-
echo "[TEST INFO]: ---------frontend test failed---------"
206-
exit $exit_status
207-
else
208-
echo "[TEST INFO]: ---------frontend test passed---------"
209-
fi
210-
}
211-
212179
function stop_docker() {
213180
echo "In stop docker"
214181
echo $WORKPATH

ChatQnA/tests/test_compose_pinecone_on_xeon.sh

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

175175
}
176176

177-
function validate_frontend() {
178-
echo "[ TEST INFO ]: --------- frontend test started ---------"
179-
cd $WORKPATH/ui/svelte
180-
local conda_env_name="OPEA_e2e"
181-
export PATH=${HOME}/miniforge3/bin/:$PATH
182-
if conda info --envs | grep -q "$conda_env_name"; then
183-
echo "$conda_env_name exist!"
184-
else
185-
conda create -n ${conda_env_name} python=3.12 -y
186-
fi
187-
source activate ${conda_env_name}
188-
echo "[ TEST INFO ]: --------- conda env activated ---------"
189-
190-
sed -i "s/localhost/$ip_address/g" playwright.config.ts
191-
192-
conda install -c conda-forge nodejs=22.6.0 -y
193-
npm install && npm ci && npx playwright install --with-deps
194-
node -v && npm -v && pip list
195-
196-
exit_status=0
197-
npx playwright test || exit_status=$?
198-
199-
if [ $exit_status -ne 0 ]; then
200-
echo "[TEST INFO]: ---------frontend test failed---------"
201-
exit $exit_status
202-
else
203-
echo "[TEST INFO]: ---------frontend test passed---------"
204-
fi
205-
}
206-
207177
function stop_docker() {
208178
echo "In stop docker"
209179
echo $WORKPATH

ChatQnA/tests/test_compose_qdrant_on_epyc.sh

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

168168
}
169169

170-
function validate_frontend() {
171-
cd $WORKPATH/ui/svelte
172-
local conda_env_name="OPEA_e2e"
173-
export PATH=${HOME}/miniforge3/bin/:$PATH
174-
if conda info --envs | grep -q "$conda_env_name"; then
175-
echo "$conda_env_name exist!"
176-
else
177-
conda create -n ${conda_env_name} python=3.12 -y
178-
fi
179-
CONDA_ROOT=$(conda info --base)
180-
source "${CONDA_ROOT}/etc/profile.d/conda.sh"
181-
conda activate ${conda_env_name}
182-
183-
sed -i "s/localhost/$ip_address/g" playwright.config.ts
184-
185-
# npm install && npm ci && npx playwright install --with-deps
186-
npm install && npm ci && npx playwright install
187-
node -v && npm -v && pip list
188-
189-
exit_status=0
190-
npx playwright test || exit_status=$?
191-
192-
if [ $exit_status -ne 0 ]; then
193-
echo "[TEST INFO]: ---------frontend test failed---------"
194-
exit $exit_status
195-
else
196-
echo "[TEST INFO]: ---------frontend test passed---------"
197-
fi
198-
}
199-
200170
function stop_docker() {
201171
cd $WORKPATH/docker_compose/amd/cpu/epyc
202172
docker compose -f compose_qdrant.yaml down
@@ -224,10 +194,6 @@ function main() {
224194
validate_megaservice
225195
echo "::endgroup::"
226196

227-
echo "::group::validate_frontend"
228-
validate_frontend
229-
echo "::endgroup::"
230-
231197
echo "::group::stop_docker"
232198
stop_docker
233199
echo "::endgroup::"

ChatQnA/tests/test_compose_qdrant_on_xeon.sh

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -159,33 +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-
npm install && npm ci && npx playwright install --with-deps
176-
node -v && npm -v && pip list
177-
178-
exit_status=0
179-
npx playwright test || 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-
189162
function stop_docker() {
190163
cd $WORKPATH/docker_compose/intel/cpu/xeon
191164
docker compose -f compose_qdrant.yaml down
@@ -213,10 +186,6 @@ function main() {
213186
validate_megaservice
214187
echo "::endgroup::"
215188

216-
echo "::group::validate_frontend"
217-
validate_frontend
218-
echo "::endgroup::"
219-
220189
echo "::group::stop_docker"
221190
stop_docker
222191
echo "::endgroup::"

ChatQnA/tests/test_compose_tgi_on_epyc.sh

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -178,39 +178,6 @@ function validate_megaservice() {
178178

179179
}
180180

181-
function validate_frontend() {
182-
echo "[ TEST INFO ]: --------- frontend test started ---------"
183-
cd $WORKPATH/ui/svelte
184-
local conda_env_name="OPEA_e2e"
185-
export PATH=${HOME}/miniforge3/bin/:$PATH
186-
if conda info --envs | grep -q "$conda_env_name"; then
187-
echo "$conda_env_name exist!"
188-
else
189-
conda create -n ${conda_env_name} python=3.12 -y
190-
fi
191-
CONDA_ROOT=$(conda info --base)
192-
source "${CONDA_ROOT}/etc/profile.d/conda.sh"
193-
conda activate ${conda_env_name}
194-
echo "[ TEST INFO ]: --------- conda env activated ---------"
195-
196-
sed -i "s/localhost/$ip_address/g" playwright.config.ts
197-
198-
conda install -c conda-forge nodejs=22.6.0 -y
199-
# npm install && npm ci && npx playwright install --with-deps
200-
npm install && npm ci && npx playwright install
201-
node -v && npm -v && pip list
202-
203-
exit_status=0
204-
npx playwright test || exit_status=$?
205-
206-
if [ $exit_status -ne 0 ]; then
207-
echo "[TEST INFO]: ---------frontend test failed---------"
208-
exit $exit_status
209-
else
210-
echo "[TEST INFO]: ---------frontend test passed---------"
211-
fi
212-
}
213-
214181
function stop_docker() {
215182
cd $WORKPATH/docker_compose/amd/cpu/epyc
216183
docker compose -f compose_tgi.yaml -f compose_tgi.telemetry.yaml down
@@ -238,10 +205,6 @@ function main() {
238205
validate_megaservice
239206
echo "::endgroup::"
240207

241-
echo "::group::validate_frontend"
242-
validate_frontend
243-
echo "::endgroup::"
244-
245208
echo "::group::stop_docker"
246209
stop_docker
247210
echo "::endgroup::"

ChatQnA/tests/test_compose_tgi_on_gaudi.sh

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

173173
}
174174

175-
function validate_frontend() {
176-
cd $WORKPATH/ui/svelte
177-
local conda_env_name="OPEA_e2e"
178-
export PATH=${HOME}/miniforge3/bin/:$PATH
179-
if conda info --envs | grep -q "$conda_env_name"; then
180-
echo "$conda_env_name exist!"
181-
else
182-
conda create -n ${conda_env_name} python=3.12 -y
183-
fi
184-
source activate ${conda_env_name}
185-
186-
sed -i "s/localhost/$ip_address/g" playwright.config.ts
187-
188-
conda install -c conda-forge nodejs=22.6.0 -y
189-
npm install && npm ci && npx playwright install --with-deps
190-
node -v && npm -v && pip list
191-
192-
export no_proxy="localhost,127.0.0.1,$ip_address"
193-
194-
exit_status=0
195-
npx playwright test || exit_status=$?
196-
197-
if [ $exit_status -ne 0 ]; then
198-
echo "[TEST INFO]: ---------frontend test failed---------"
199-
exit $exit_status
200-
else
201-
echo "[TEST INFO]: ---------frontend test passed---------"
202-
fi
203-
}
204-
205175
function stop_docker() {
206176
cd $WORKPATH/docker_compose/intel/hpu/gaudi
207177
docker compose -f compose_tgi.yaml -f compose_tgi.telemetry.yaml down
@@ -229,10 +199,6 @@ function main() {
229199
validate_megaservice
230200
echo "::endgroup::"
231201

232-
echo "::group::validate_frontend"
233-
validate_frontend
234-
echo "::endgroup::"
235-
236202
echo "::group::stop_docker"
237203
stop_docker
238204
echo "::endgroup::"

ChatQnA/tests/test_compose_tgi_on_xeon.sh

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

171171
}
172172

173-
function validate_frontend() {
174-
echo "[ TEST INFO ]: --------- frontend test started ---------"
175-
cd $WORKPATH/ui/svelte
176-
local conda_env_name="OPEA_e2e"
177-
export PATH=${HOME}/miniforge3/bin/:$PATH
178-
if conda info --envs | grep -q "$conda_env_name"; then
179-
echo "$conda_env_name exist!"
180-
else
181-
conda create -n ${conda_env_name} python=3.12 -y
182-
fi
183-
source activate ${conda_env_name}
184-
echo "[ TEST INFO ]: --------- conda env activated ---------"
185-
186-
sed -i "s/localhost/$ip_address/g" playwright.config.ts
187-
188-
conda install -c conda-forge nodejs=22.6.0 -y
189-
npm install && npm ci && npx playwright install --with-deps
190-
node -v && npm -v && pip list
191-
192-
exit_status=0
193-
npx playwright test || exit_status=$?
194-
195-
if [ $exit_status -ne 0 ]; then
196-
echo "[TEST INFO]: ---------frontend test failed---------"
197-
exit $exit_status
198-
else
199-
echo "[TEST INFO]: ---------frontend test passed---------"
200-
fi
201-
}
202-
203173
function stop_docker() {
204174
cd $WORKPATH/docker_compose/intel/cpu/xeon
205175
docker compose -f compose_tgi.yaml -f compose_tgi.telemetry.yaml down
@@ -227,10 +197,6 @@ function main() {
227197
validate_megaservice
228198
echo "::endgroup::"
229199

230-
echo "::group::validate_frontend"
231-
validate_frontend
232-
echo "::endgroup::"
233-
234200
echo "::group::stop_docker"
235201
stop_docker
236202
echo "::endgroup::"

0 commit comments

Comments
 (0)