This is an automated email from the ASF dual-hosted git repository.
young pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git
The following commit(s) were added to refs/heads/master by this push:
new 06ee142b2 chore(cli/test_admin_ui): use a real built dashboard (#12683)
06ee142b2 is described below
commit 06ee142b247cbe1ca4dc5d49e377e39efdf3f9a1
Author: YYYoung <[email protected]>
AuthorDate: Tue Oct 21 09:37:40 2025 +0800
chore(cli/test_admin_ui): use a real built dashboard (#12683)
---
t/cli/test_admin_ui.sh | 44 +++++++++++++++++++++++++++++++++-----------
1 file changed, 33 insertions(+), 11 deletions(-)
diff --git a/t/cli/test_admin_ui.sh b/t/cli/test_admin_ui.sh
index 2dd2cb465..fa0411ccd 100755
--- a/t/cli/test_admin_ui.sh
+++ b/t/cli/test_admin_ui.sh
@@ -31,6 +31,22 @@ if [ ! $? -eq 0 ]; then
exit 1
fi
+# build apisix-dashboard
+corepack enable pnpm
+
+## prepare apisix-dashboard source code
+source .requirements
+git clone --revision=${APISIX_DASHBOARD_COMMIT} --depth 1
https://github.com/apache/apisix-dashboard.git
+pushd apisix-dashboard
+
+## compile
+pnpm install --frozen-lockfile && pnpm run build
+popd
+
+## copy the dist files to the ui directory
+mkdir ui
+cp -R apisix-dashboard/dist/* ui/ && rm -r apisix-dashboard
+
make run
## check /ui redirects to /ui/ with 301
@@ -50,11 +66,6 @@ fi
## check /ui/ accessible
-mkdir -p ui/assets
-echo "test_html" > ui/index.html
-echo "test_js" > ui/assets/test.js
-echo "test_css" > ui/assets/test.css
-
code=$(curl -v -k -i -m 20 -o /dev/null -s -w %{http_code}
http://127.0.0.1:9180/ui/)
if [ ! $code -eq 200 ]; then
echo "failed: /ui/ not accessible"
@@ -69,19 +80,30 @@ if [ ! $code -eq 200 ]; then
exit 1
fi
-## check /ui/assets/test.js accessible
+## check /ui/assets/*.js accessible
+
+js_file=$(find ui/assets -name "*.js" | head -n 1)
+code=$(curl -v -k -i -m 20 -o /dev/null -s -w %{http_code}
http://127.0.0.1:9180/${js_file})
+if [ ! $code -eq 200 ]; then
+ echo "failed: ${js_file} not accessible"
+ exit 1
+fi
+
+## check /ui/assets/*.css accessible
-code=$(curl -v -k -i -m 20 -o /dev/null -s -w %{http_code}
http://127.0.0.1:9180/ui/assets/test.js)
+css_file=$(find ui/assets -name "*.css" | head -n 1)
+code=$(curl -v -k -i -m 20 -o /dev/null -s -w %{http_code}
http://127.0.0.1:9180/${css_file})
if [ ! $code -eq 200 ]; then
- echo "failed: /ui/assets/test.js not accessible"
+ echo "failed: ${css_file} not accessible"
exit 1
fi
-## check /ui/assets/test.css accessible
+## check /ui/assets/*.svg accessible
-code=$(curl -v -k -i -m 20 -o /dev/null -s -w %{http_code}
http://127.0.0.1:9180/ui/assets/test.css)
+svg_file=$(find ui/assets -name "*.svg" | head -n 1)
+code=$(curl -v -k -i -m 20 -o /dev/null -s -w %{http_code}
http://127.0.0.1:9180/${svg_file})
if [ ! $code -eq 200 ]; then
- echo "failed: /ui/assets/test.css not accessible"
+ echo "failed: ${svg_file} not accessible"
exit 1
fi