refactor: move server rs workspace entries into crates

This commit is contained in:
2026-04-21 11:01:25 +08:00
parent 5a60ab3972
commit f6bf5f665e
47 changed files with 244 additions and 233 deletions

View File

@@ -6,11 +6,11 @@ usage() {
cat <<'EOF'
Usage:
./server-rs/scripts/test.sh
SERVER_RS_TEST_PACKAGE=api-server ./server-rs/scripts/test.sh
SERVER_RS_TEST_CRATE=api-server ./server-rs/scripts/test.sh
Notes:
1. Run cargo test for the server-rs workspace by default
2. Use SERVER_RS_TEST_PACKAGE to target one workspace package only
2. Use SERVER_RS_TEST_CRATE to target one workspace crate only
EOF
}
@@ -32,9 +32,11 @@ echo "[server-rs:test] working dir: ${SERVER_RS_DIR}"
cd "${SERVER_RS_DIR}"
if [[ -n "${SERVER_RS_TEST_PACKAGE:-}" ]]; then
echo "[server-rs:test] target package: ${SERVER_RS_TEST_PACKAGE}"
cargo test -p "${SERVER_RS_TEST_PACKAGE}" --manifest-path "${MANIFEST_PATH}"
TARGET_CRATE="${SERVER_RS_TEST_CRATE:-${SERVER_RS_TEST_PACKAGE:-}}"
if [[ -n "${TARGET_CRATE}" ]]; then
echo "[server-rs:test] target crate: ${TARGET_CRATE}"
cargo test -p "${TARGET_CRATE}" --manifest-path "${MANIFEST_PATH}"
else
cargo test --manifest-path "${MANIFEST_PATH}"
fi