From 52dc1d760985fb2e7e6e8e94a09d685103e073af Mon Sep 17 00:00:00 2001 From: nod_ <nod_@598310.no-reply.drupal.org> Date: Tue, 13 Aug 2024 10:28:12 +0200 Subject: [PATCH] Issue #3467391 by catch, smustgrave: Reduce CPU requirement and concurrency for unit tests --- .gitlab-ci/pipeline.yml | 3 ++- core/modules/phpass/tests/src/Unit/PasswordVerifyTest.php | 1 + core/phpcs.xml.dist | 3 ++- .../Drupal/Tests/Component/Datetime/TimeWithNoRequestTest.php | 1 + core/tests/Drupal/Tests/Component/Utility/RectangleTest.php | 1 + core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php | 1 + core/tests/Drupal/Tests/Component/Utility/XssTest.php | 1 + .../Composer/Plugin/Scaffold/Functional/ComposerHookTest.php | 1 + core/tests/Drupal/Tests/Core/Command/QuickStartTest.php | 1 + core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php | 1 + .../Core/EventSubscriber/ActiveLinkResponseFilterTest.php | 1 + core/tests/Drupal/Tests/Core/Recipe/RecipeQuickStartTest.php | 1 + core/tests/Drupal/Tests/Core/Security/RequestSanitizerTest.php | 1 + core/tests/Drupal/Tests/Core/Site/SettingsTest.php | 1 + core/tests/Drupal/Tests/Core/Test/PhpUnitCliTest.php | 1 + core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php | 1 + core/tests/Drupal/Tests/Scripts/TestSiteApplicationTest.php | 1 + 17 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci/pipeline.yml b/.gitlab-ci/pipeline.yml index aee319106be0..3c45b444356e 100644 --- a/.gitlab-ci/pipeline.yml +++ b/.gitlab-ci/pipeline.yml @@ -204,7 +204,8 @@ variables: - <<: *with-database variables: TESTSUITE: PHPUnit-Unit - KUBERNETES_CPU_REQUEST: "16" + KUBERNETES_CPU_REQUEST: "1" + CONCURRENCY: 6 'âœ…ï¸ PHPStan Tests': <<: [ *default-job-settings ] diff --git a/core/modules/phpass/tests/src/Unit/PasswordVerifyTest.php b/core/modules/phpass/tests/src/Unit/PasswordVerifyTest.php index dd897c00a0fd..f32cb022447f 100644 --- a/core/modules/phpass/tests/src/Unit/PasswordVerifyTest.php +++ b/core/modules/phpass/tests/src/Unit/PasswordVerifyTest.php @@ -14,6 +14,7 @@ * * @coversDefaultClass \Drupal\phpass\Password\PhpassHashedPassword * @group phpass + * @group #slow */ class PasswordVerifyTest extends UnitTestCase { diff --git a/core/phpcs.xml.dist b/core/phpcs.xml.dist index 54bdfe45052a..8467644b0479 100644 --- a/core/phpcs.xml.dist +++ b/core/phpcs.xml.dist @@ -8,8 +8,9 @@ <exclude-pattern>*/node_modules/*</exclude-pattern> <!--Exclude third party code.--> <exclude-pattern>./assets/vendor/*</exclude-pattern> - <!--Exclude the PHPStan baseline from coding standards.--> + <!--Exclude the PHPStan baseline and temp dir from coding standards.--> <exclude-pattern>./core/.phpstan-baseline.php</exclude-pattern> + <exclude-pattern>./core/phpstan-tmp/*</exclude-pattern> <!-- Exclude third-party code maintained within core that does not follow our standards. --> <!-- @todo This rule may be removed when https://www.drupal.org/node/1848264 is resolved. --> <exclude-pattern>./core/lib/Drupal/Component/Diff/</exclude-pattern> diff --git a/core/tests/Drupal/Tests/Component/Datetime/TimeWithNoRequestTest.php b/core/tests/Drupal/Tests/Component/Datetime/TimeWithNoRequestTest.php index 69bac3cb0282..d4b02de5d30a 100644 --- a/core/tests/Drupal/Tests/Component/Datetime/TimeWithNoRequestTest.php +++ b/core/tests/Drupal/Tests/Component/Datetime/TimeWithNoRequestTest.php @@ -12,6 +12,7 @@ * * @coversDefaultClass \Drupal\Component\Datetime\Time * @group Datetime + * @group #slow * @runTestsInSeparateProcesses * @preserveGlobalState disabled */ diff --git a/core/tests/Drupal/Tests/Component/Utility/RectangleTest.php b/core/tests/Drupal/Tests/Component/Utility/RectangleTest.php index f7a77f6e7db5..c43054055fbc 100644 --- a/core/tests/Drupal/Tests/Component/Utility/RectangleTest.php +++ b/core/tests/Drupal/Tests/Component/Utility/RectangleTest.php @@ -10,6 +10,7 @@ /** * @coversDefaultClass \Drupal\Component\Utility\Rectangle * @group Image + * @group #slow */ class RectangleTest extends TestCase { diff --git a/core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php b/core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php index 0cc920d5f0da..f2fd94290332 100644 --- a/core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php +++ b/core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php @@ -9,6 +9,7 @@ /** * @group Utility + * @group #slow * * @coversDefaultClass \Drupal\Component\Utility\UrlHelper */ diff --git a/core/tests/Drupal/Tests/Component/Utility/XssTest.php b/core/tests/Drupal/Tests/Component/Utility/XssTest.php index 15b1f0384342..6f8e09425b02 100644 --- a/core/tests/Drupal/Tests/Component/Utility/XssTest.php +++ b/core/tests/Drupal/Tests/Component/Utility/XssTest.php @@ -23,6 +23,7 @@ * CVE-2006-1226 (= rev. 1.112?), CVE-2008-0273, CVE-2008-3740. * * @group Utility + * @group #slow * @coversDefaultClass \Drupal\Component\Utility\Xss * @runTestsInSeparateProcesses */ diff --git a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ComposerHookTest.php b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ComposerHookTest.php index 7c7a10909c1b..14d896ad1823 100644 --- a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ComposerHookTest.php +++ b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ComposerHookTest.php @@ -23,6 +23,7 @@ * information. * * @group Scaffold + * @group #slow */ class ComposerHookTest extends BuildTestBase { diff --git a/core/tests/Drupal/Tests/Core/Command/QuickStartTest.php b/core/tests/Drupal/Tests/Core/Command/QuickStartTest.php index 17c12d2d394e..07a3740f36a7 100644 --- a/core/tests/Drupal/Tests/Core/Command/QuickStartTest.php +++ b/core/tests/Drupal/Tests/Core/Command/QuickStartTest.php @@ -24,6 +24,7 @@ * @requires extension pdo_sqlite * * @group Command + * @group #slow */ class QuickStartTest extends TestCase { diff --git a/core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php b/core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php index e01add014774..845937dee547 100644 --- a/core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php +++ b/core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php @@ -14,6 +14,7 @@ /** * @coversDefaultClass \Drupal\Core\DrupalKernel * @group DrupalKernel + * @group #slow */ class DrupalKernelTest extends UnitTestCase { diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/ActiveLinkResponseFilterTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/ActiveLinkResponseFilterTest.php index cdd08cfbf431..4c830fecfe5f 100644 --- a/core/tests/Drupal/Tests/Core/EventSubscriber/ActiveLinkResponseFilterTest.php +++ b/core/tests/Drupal/Tests/Core/EventSubscriber/ActiveLinkResponseFilterTest.php @@ -27,6 +27,7 @@ /** * @coversDefaultClass \Drupal\Core\EventSubscriber\ActiveLinkResponseFilter * @group EventSubscriber + * @group #slow */ class ActiveLinkResponseFilterTest extends UnitTestCase { diff --git a/core/tests/Drupal/Tests/Core/Recipe/RecipeQuickStartTest.php b/core/tests/Drupal/Tests/Core/Recipe/RecipeQuickStartTest.php index c71cd91bff05..65bedfff3d0d 100644 --- a/core/tests/Drupal/Tests/Core/Recipe/RecipeQuickStartTest.php +++ b/core/tests/Drupal/Tests/Core/Recipe/RecipeQuickStartTest.php @@ -25,6 +25,7 @@ * * @group Command * @group Recipe + * @group #slow */ class RecipeQuickStartTest extends TestCase { diff --git a/core/tests/Drupal/Tests/Core/Security/RequestSanitizerTest.php b/core/tests/Drupal/Tests/Core/Security/RequestSanitizerTest.php index ee3394b6391d..59f17d3e15fa 100644 --- a/core/tests/Drupal/Tests/Core/Security/RequestSanitizerTest.php +++ b/core/tests/Drupal/Tests/Core/Security/RequestSanitizerTest.php @@ -15,6 +15,7 @@ * @runTestsInSeparateProcesses * @preserveGlobalState disabled * @group Security + * @group #slow */ class RequestSanitizerTest extends UnitTestCase { diff --git a/core/tests/Drupal/Tests/Core/Site/SettingsTest.php b/core/tests/Drupal/Tests/Core/Site/SettingsTest.php index d378dcf983c3..cb00324bdaf3 100644 --- a/core/tests/Drupal/Tests/Core/Site/SettingsTest.php +++ b/core/tests/Drupal/Tests/Core/Site/SettingsTest.php @@ -14,6 +14,7 @@ * @coversDefaultClass \Drupal\Core\Site\Settings * @runTestsInSeparateProcesses * @group Site + * @group #slow */ class SettingsTest extends UnitTestCase { diff --git a/core/tests/Drupal/Tests/Core/Test/PhpUnitCliTest.php b/core/tests/Drupal/Tests/Core/Test/PhpUnitCliTest.php index 5ec76e7820fc..bfb3c31e58ee 100644 --- a/core/tests/Drupal/Tests/Core/Test/PhpUnitCliTest.php +++ b/core/tests/Drupal/Tests/Core/Test/PhpUnitCliTest.php @@ -10,6 +10,7 @@ /** * @group TestSuites * @group Test + * @group #slow */ class PhpUnitCliTest extends UnitTestCase { diff --git a/core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php b/core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php index d183cd752d17..9c8f72087e16 100644 --- a/core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php +++ b/core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php @@ -19,6 +19,7 @@ * * @coversDefaultClass \Drupal\Core\Update\UpdateRegistry * @group Update + * @group #slow * @runTestsInSeparateProcesses * @preserveGlobalState disabled */ diff --git a/core/tests/Drupal/Tests/Scripts/TestSiteApplicationTest.php b/core/tests/Drupal/Tests/Scripts/TestSiteApplicationTest.php index 893a55e93092..a5e71bfb4d8c 100644 --- a/core/tests/Drupal/Tests/Scripts/TestSiteApplicationTest.php +++ b/core/tests/Drupal/Tests/Scripts/TestSiteApplicationTest.php @@ -26,6 +26,7 @@ * @see \Drupal\TestSite\Commands\TestSiteTearDownCommand * * @group Setup + * @group #slow * @runTestsInSeparateProcesses * @preserveGlobalState disabled */ -- GitLab