chore: run all tests in ci without "local" feature (#761)

This commit is contained in:
Guy Lichtman 2026-03-24 01:03:16 +02:00 committed by GitHub
parent f89e412200
commit baf22d37bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 44 additions and 1 deletions

View file

@ -98,6 +98,40 @@ jobs:
- name: Run tests - name: Run tests
run: cargo test --all-features run: cargo test --all-features
test-no-local:
name: Run Tests (no local feature)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
# install nodejs
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Set up Python
run: uv python install
- name: Create venv for python
run: uv venv
- uses: Swatinem/rust-cache@v2
- name: Run tests without local feature
run: |
FEATURES=$(cargo metadata --no-deps --format-version 1 \
| jq -r '[.packages[] | select(.name == "rmcp") | .features | keys[]
| select(startswith("__") | not)
| select(. != "local")] | join(",")')
cargo test -p rmcp --features "$FEATURES"
coverage: coverage:
name: Code Coverage name: Code Coverage
runs-on: ubuntu-latest runs-on: ubuntu-latest

View file

@ -10,6 +10,15 @@ fix: fmt
test: test:
cargo test --all-features cargo test --all-features
if command -v jq > /dev/null 2>&1; then \
FEATURES=$(cargo metadata --no-deps --format-version 1 \
| jq -r '[.packages[] | select(.name == "rmcp") | .features | keys[] \
| select(startswith("__") | not) \
| select(. != "local")] | join(",")') && \
cargo test -p rmcp --features "$FEATURES"; \
else \
echo "warning: jq not found, skipping non-local feature tests"; \
fi
cov: cov:
cargo llvm-cov --lcov --output-path {{justfile_directory()}}/target/llvm-cov-target/coverage.lcov cargo llvm-cov --lcov --output-path {{justfile_directory()}}/target/llvm-cov-target/coverage.lcov