Prechádzať zdrojové kódy

Parallel testing with paratest

shalvah 5 rokov pred
rodič
commit
0c8afe8d54
3 zmenil súbory, kde vykonal 30 pridanie a 11 odobranie
  1. 9 6
      composer.dingo.json
  2. 6 3
      composer.json
  3. 15 2
      phpunit.xml

+ 9 - 6
composer.dingo.json

@@ -21,20 +21,21 @@
         "illuminate/console": "^5.7|^6.0|^7.0",
         "illuminate/routing": "^5.7|^6.0|^7.0",
         "illuminate/support": "^5.7|^6.0|^7.0",
+        "knuckleswtf/pastel": "dev-master",
         "league/flysystem": "^1.0",
-        "knuckleswtf/pastel": "^1.1",
         "mpociot/reflection-docblock": "^1.0.1",
         "nunomaduro/collision": "^3.0|^4.0",
         "ramsey/uuid": "^3.8|^4.0",
-        "symfony/var-exporter": "^4.0|^5.0",
-        "shalvah/clara": "^2.5"
+        "shalvah/clara": "^2.6",
+        "symfony/var-exporter": "^4.0|^5.0"
     },
     "require-dev": {
         "dingo/api": "^2.3",
         "dms/phpunit-arraysubset-asserts": "^0.1.0",
-        "league/fractal": "^0.17.0",
+        "brianium/paratest": "^4.0",
+        "league/fractal": "^0.19.0",
         "orchestra/testbench": "^3.7|^4.0|^5.0",
-        "phpstan/phpstan": "^0.11.15",
+        "phpstan/phpstan": "^0.12.19",
         "phpunit/phpunit": "^8.0"
     },
     "suggest": {
@@ -53,7 +54,9 @@
     "scripts": {
         "lint": "phpstan analyse -c ./phpstan.neon src",
         "test": "phpunit --stop-on-failure --group dingo",
-        "test-ci": "phpunit --group dingo"
+        "test-ci": "phpunit --group dingo",
+        "test-parallel": "paratest -p3 --stop-on-failure --parallel-suite --group dingo tests",
+        "test-parallel-ci": "paratest -p3 --parallel-suite --group dingo tests"
     },
     "extra": {
         "laravel": {

+ 6 - 3
composer.json

@@ -33,17 +33,18 @@
         "knuckleswtf/pastel": "dev-master",
         "league/flysystem": "^1.0",
         "mpociot/reflection-docblock": "^1.0.1",
-        "nunomaduro/collision": "^4.0",
+        "nunomaduro/collision": "^3.0|^4.0",
         "ramsey/uuid": "^3.8|^4.0",
         "shalvah/clara": "^2.6",
         "symfony/var-exporter": "^4.0|^5.0"
     },
     "require-dev": {
+        "brianium/paratest": "^4.0",
         "dms/phpunit-arraysubset-asserts": "^0.1.0",
         "laravel/lumen-framework": "^5.7|^6.0|^7.0",
         "league/fractal": "^0.19.0",
         "orchestra/testbench": "^3.7|^4.0|^5.0",
-        "phpstan/phpstan": "^0.11.15",
+        "phpstan/phpstan": "^0.12.19",
         "phpunit/phpunit": "^8.0"
     },
     "suggest": {
@@ -62,7 +63,9 @@
     "scripts": {
         "lint": "phpstan analyse -c ./phpstan.neon src",
         "test": "phpunit --stop-on-failure --exclude-group dingo",
-        "test-ci": "phpunit --exclude-group dingo"
+        "test-ci": "phpunit --exclude-group dingo",
+        "test-parallel": "paratest -p3 --stop-on-failure --parallel-suite --exclude-group dingo tests",
+        "test-parallel-ci": "paratest -p3 --parallel-suite --exclude-group dingo tests"
     },
     "extra": {
         "laravel": {

+ 15 - 2
phpunit.xml

@@ -2,6 +2,7 @@
 <phpunit backupGlobals="false"
          backupStaticAttributes="false"
          bootstrap="vendor/autoload.php"
+         cacheResult="true"
          colors="true"
          convertErrorsToExceptions="true"
          convertNoticesToExceptions="true"
@@ -9,8 +10,20 @@
          processIsolation="false"
          stopOnFailure="false">
     <testsuites>
-        <testsuite name="Versionable Suite">
-            <directory>tests/</directory>
+        <testsuite name="Generator Tests">
+            <file>tests/Unit/DingoGeneratorTest.php</file>
+            <file>tests/Unit/LaravelGeneratorTest.php</file>
+            <file>tests/Unit/GeneratorPluginSystemTest.php</file>
+        </testsuite>
+        <testsuite name="RouteMatcher Tests">
+            <file>tests/Unit/RouteMatcherDingoTest.php</file>
+            <file>tests/Unit/RouteMatcherTest.php</file>
+        </testsuite>
+        <testsuite name="Full Test">
+            <file>tests/GenerateDocumentationTest.php</file>
+        </testsuite>
+        <testsuite name="Postman Collection Test">
+            <file>tests/Unit/PostmanCollectionWriterTest.php</file>
         </testsuite>
     </testsuites>
     <filter>