refactor: move server rs workspace entries into crates
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user