[Server][Conformance] Kicking off adoption of conformance testing (#181)
This commit is contained in:
parent
7f02285753
commit
2f29b1dbe5
1 changed files with 236 additions and 0 deletions
40
.github/workflows/pipeline.yaml
vendored
40
.github/workflows/pipeline.yaml
vendored
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue