Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ vendor
examples/**/dev.log
examples/**/cache
examples/**/sessions
tests/Conformance/client-conformance.json
tests/Conformance/server-conformance.json
tests/Conformance/results
tests/Conformance/sessions
tests/Conformance/logs/*.log
Expand Down
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@ conformance-server:
docker compose -f tests/Conformance/Fixtures/docker-compose.yml up -d
@echo "Waiting for server to start..."
@sleep 5
cd tests/Conformance && npx @modelcontextprotocol/conformance server --url http://localhost:8000/ || true
rm -rf tests/Conformance/results
cd tests/Conformance && npx @modelcontextprotocol/conformance server --url http://localhost:8000/ --output-dir results || true
php tests/Conformance/score.php server
docker compose -f tests/Conformance/Fixtures/docker-compose.yml down

conformance-client:
cd tests/Conformance && npx @modelcontextprotocol/conformance client --command "php $(CURDIR)/tests/Conformance/client.php" --suite all --expected-failures conformance-baseline.yml || true
rm -rf tests/Conformance/results
cd tests/Conformance && npx @modelcontextprotocol/conformance client --command "php $(CURDIR)/tests/Conformance/client.php" --suite all --expected-failures conformance-baseline.yml --output-dir results || true
php tests/Conformance/score.php client

coverage:
XDEBUG_MODE=coverage vendor/bin/phpunit --testsuite=unit --coverage-html=coverage
Expand Down
19 changes: 11 additions & 8 deletions tests/Conformance/score.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,20 @@
continue;
}

++$total;

foreach ($checks as $check) {
if ('FAILURE' === ($check['status'] ?? null)) {
$failures[] = $file->getRelativePath();

continue 2;
switch ($check['status'] ?? null) {
case 'FAILURE':
$failures[] = $file->getRelativePath();
break;
case 'SUCCESS':
++$passed;
break;
default:
continue 2;
}
}

++$passed;
++$total;
}
}

$pct = $total > 0 ? (int) round($passed / $total * 100) : 0;
Expand Down