[Server][Conformance] Kicking off adoption of conformance testing (#181)

This commit is contained in:
Christopher Hertel 2025-12-28 07:32:37 +01:00 • committed by GitHub
commit 2f29b1dbe5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -69,6 +69,46 @@ jobs:
- name: Tests
run: vendor/bin/phpunit --testsuite=inspector
conformance:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
coverage: "none"
- name: Setup Node
uses: actions/setup-node@v5
with:
node-version: '22'
- name: Install Composer
uses: "ramsey/composer-install@v3"
- name: Run server
run: php -S localhost:8000 examples/server/conformance/server.php &
- name: Wait for server to start
run: sleep 5
- name: Tests
run: |
exit_code=0
OUTPUT=$(npx @modelcontextprotocol/conformance server --url http://localhost:8000/) || exit_code=1
echo "$OUTPUT"
# Example: "Total: 3 passed, 16 failed"
passedTests=$(echo "$OUTPUT" | sed -nE 's/.*Total: ([0-9]+) passed.*/\1/p')
passedTests=${passedTests:-0}
REQUIRED_TESTS_TO_PASS=20
echo "Required tests to pass: $REQUIRED_TESTS_TO_PASS"
[ "$passedTests" -ge "$REQUIRED_TESTS_TO_PASS" ] || exit $exit_code
qa:
runs-on: ubuntu-latest
steps: