diff --git a/infection.json5 b/infection.json5 index 5b57c86d0..940e3a3c4 100644 --- a/infection.json5 +++ b/infection.json5 @@ -15,6 +15,6 @@ "mutators": { "@default": true }, - "timeout": 300, + "timeout": 30, "testFrameworkOptions": "--exclude-group=serial" } diff --git a/src/Command/Api/ApiCommandHelper.php b/src/Command/Api/ApiCommandHelper.php index feca40ffd..bb807ddbe 100644 --- a/src/Command/Api/ApiCommandHelper.php +++ b/src/Command/Api/ApiCommandHelper.php @@ -274,12 +274,14 @@ private function isApiSpecChecksumCacheValid(\Symfony\Component\Cache\CacheItem } /** + * Breaking caching during tests will cause performance issues and timeouts. + * * @return array + * @infection-ignore-all */ private function getCloudApiSpec(string $specFilePath): array { $cacheKey = basename($specFilePath); $cache = new PhpArrayAdapter(__DIR__ . '/../../../var/cache/' . $cacheKey . '.cache', new NullAdapter()); - // @infection-ignore-all $cacheItemChecksum = $cache->getItem($cacheKey . '.checksum'); $cacheItemSpec = $cache->getItem($cacheKey); diff --git a/src/Helpers/LocalMachineHelper.php b/src/Helpers/LocalMachineHelper.php index 84371adf4..9e9810a46 100644 --- a/src/Helpers/LocalMachineHelper.php +++ b/src/Helpers/LocalMachineHelper.php @@ -324,12 +324,15 @@ public function isBrowserAvailable(): bool { /** * Starts a background browser/tab for the current site or a specified URL. * + * Exclude from mutation testing as we don't want real browser windows opened. + * * @param string|null $uri Optional URI or site path to open in browser. If omitted, or if a site path * is specified, the current site home page uri will be prepended if the site's * hostname resolves. * @param string|null $browser The command to run to launch a browser. * @return bool TRUE if browser was opened. FALSE if browser was disabled by the user or a * default browser could not be found. + * @infection-ignore-all */ public function startBrowser(string $uri = NULL, string $browser = NULL): bool { // We can only open a browser if we have a DISPLAY environment variable on diff --git a/tests/phpunit/src/Commands/Api/ApiCommandTest.php b/tests/phpunit/src/Commands/Api/ApiCommandTest.php index 37162470d..4c93a3da3 100644 --- a/tests/phpunit/src/Commands/Api/ApiCommandTest.php +++ b/tests/phpunit/src/Commands/Api/ApiCommandTest.php @@ -361,12 +361,8 @@ public function providerTestApiCommandDefinitionParameters(): array { /** * @dataProvider providerTestApiCommandDefinitionParameters - * @param $useSpecCache - * @param $commandName - * @param $method - * @param $usage */ - public function testApiCommandDefinitionParameters(mixed $useSpecCache, mixed $commandName, mixed $method, mixed $usage): void { + public function testApiCommandDefinitionParameters(string $useSpecCache, string $commandName, string $method, string $usage): void { putenv('ACQUIA_CLI_USE_CLOUD_API_SPEC_CACHE=' . $useSpecCache); $this->command = $this->getApiCommandByName($commandName); diff --git a/tests/phpunit/src/Commands/DocsCommandTest.php b/tests/phpunit/src/Commands/DocsCommandTest.php index b8e2f365f..cb7f3e1cc 100644 --- a/tests/phpunit/src/Commands/DocsCommandTest.php +++ b/tests/phpunit/src/Commands/DocsCommandTest.php @@ -21,7 +21,7 @@ protected function createCommand(): CommandBase { /** * @dataProvider providerTestDocsCommand */ - public function testDocsCommand(mixed $input, mixed $expectedOutput): void { + public function testDocsCommand(int $input, string $expectedOutput): void { $localMachineHelper = $this->mockLocalMachineHelper(); $localMachineHelper->startBrowser(Argument::any())->shouldBeCalled();