From b79ca88c6d5c371189531298274c2bdeb3f00076 Mon Sep 17 00:00:00 2001 From: OhMyFelix Date: Fri, 6 Mar 2026 13:09:53 +0000 Subject: [PATCH 1/3] CI: remove stale Coveralls config Drop the leftover php-coveralls configuration now that coverage is handled by the shared Codecov workflow. --- tests/.coveralls.yml | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 tests/.coveralls.yml diff --git a/tests/.coveralls.yml b/tests/.coveralls.yml deleted file mode 100644 index 403f48b..0000000 --- a/tests/.coveralls.yml +++ /dev/null @@ -1,4 +0,0 @@ -# for php-coveralls -service_name: github-actions -coverage_clover: coverage.xml -json_path: coverage.json \ No newline at end of file From b1e30562cb717a5fb6c0ec09d7c53b918baf9b85 Mon Sep 17 00:00:00 2001 From: OhMyFelix Date: Fri, 6 Mar 2026 15:22:49 +0000 Subject: [PATCH 2/3] Tests: stabilize discovery coverage Preload the discovery fixture classes in the test so parallel runs do not intermittently miss discovered tools, resources, and prompts. --- tests/Cases/DI/McpExtension.discovery.phpt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/Cases/DI/McpExtension.discovery.phpt b/tests/Cases/DI/McpExtension.discovery.phpt index 968fd1a..123fe52 100644 --- a/tests/Cases/DI/McpExtension.discovery.phpt +++ b/tests/Cases/DI/McpExtension.discovery.phpt @@ -12,12 +12,22 @@ use Mcp\Server\Configuration; use Nette\DI\Compiler; use Tester\Assert; use Tests\Toolkit\ServerInspector; +use Tests\Toolkit\Tests; require_once __DIR__ . '/../../bootstrap.php'; +require_once __DIR__ . '/../../Mocks/Mcp/CalculatorTool.php'; +require_once __DIR__ . '/../../Mocks/Mcp/FileResource.php'; +require_once __DIR__ . '/../../Mocks/Mcp/GreetingPrompt.php'; + +function discoveryTempDir(string $name): string +{ + return Tests::TEMP_PATH . '/' . $name . '-' . getmypid() . '-' . bin2hex(random_bytes(4)); +} // Test discovery disabled (explicitly disabled, default is enabled) Toolkit::test(function (): void { $container = ContainerBuilder::of() + ->withTempDir(discoveryTempDir('mcp-discovery-disabled')) ->withCompiler(static function (Compiler $compiler): void { $compiler->addExtension('mcp', new McpExtension()); $compiler->addConfig(Neonkit::load(<<<'NEON' @@ -51,6 +61,7 @@ Toolkit::test(function (): void { // Test discovery enabled with custom scanDirs - discovers tools, resources, and prompts Toolkit::test(function (): void { $container = ContainerBuilder::of() + ->withTempDir(discoveryTempDir('mcp-discovery-enabled')) ->withCompiler(static function (Compiler $compiler): void { $compiler->addExtension('mcp', new McpExtension()); $compiler->addConfig(Neonkit::load(<<<'NEON' @@ -114,6 +125,7 @@ Toolkit::test(function (): void { } $container = ContainerBuilder::of() + ->withTempDir(discoveryTempDir('mcp-discovery-cache')) ->withCompiler(static function (Compiler $compiler): void { $compiler->addExtension('mcp', new McpExtension()); $compiler->addConfig(Neonkit::load(<<<'NEON' From c1a212e9511f5163fb8da29fb880b6879f5edc72 Mon Sep 17 00:00:00 2001 From: OhMyFelix Date: Sat, 7 Mar 2026 15:33:20 +0000 Subject: [PATCH 3/3] Tests: use contributte/tester temp dir defaults --- tests/Cases/DI/McpExtension.discovery.phpt | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tests/Cases/DI/McpExtension.discovery.phpt b/tests/Cases/DI/McpExtension.discovery.phpt index 123fe52..dbb091a 100644 --- a/tests/Cases/DI/McpExtension.discovery.phpt +++ b/tests/Cases/DI/McpExtension.discovery.phpt @@ -12,22 +12,15 @@ use Mcp\Server\Configuration; use Nette\DI\Compiler; use Tester\Assert; use Tests\Toolkit\ServerInspector; -use Tests\Toolkit\Tests; require_once __DIR__ . '/../../bootstrap.php'; require_once __DIR__ . '/../../Mocks/Mcp/CalculatorTool.php'; require_once __DIR__ . '/../../Mocks/Mcp/FileResource.php'; require_once __DIR__ . '/../../Mocks/Mcp/GreetingPrompt.php'; -function discoveryTempDir(string $name): string -{ - return Tests::TEMP_PATH . '/' . $name . '-' . getmypid() . '-' . bin2hex(random_bytes(4)); -} - // Test discovery disabled (explicitly disabled, default is enabled) Toolkit::test(function (): void { $container = ContainerBuilder::of() - ->withTempDir(discoveryTempDir('mcp-discovery-disabled')) ->withCompiler(static function (Compiler $compiler): void { $compiler->addExtension('mcp', new McpExtension()); $compiler->addConfig(Neonkit::load(<<<'NEON' @@ -61,7 +54,6 @@ Toolkit::test(function (): void { // Test discovery enabled with custom scanDirs - discovers tools, resources, and prompts Toolkit::test(function (): void { $container = ContainerBuilder::of() - ->withTempDir(discoveryTempDir('mcp-discovery-enabled')) ->withCompiler(static function (Compiler $compiler): void { $compiler->addExtension('mcp', new McpExtension()); $compiler->addConfig(Neonkit::load(<<<'NEON' @@ -125,7 +117,6 @@ Toolkit::test(function (): void { } $container = ContainerBuilder::of() - ->withTempDir(discoveryTempDir('mcp-discovery-cache')) ->withCompiler(static function (Compiler $compiler): void { $compiler->addExtension('mcp', new McpExtension()); $compiler->addConfig(Neonkit::load(<<<'NEON'