diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index add9b3d7..4bb490fc 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -92,5 +92,8 @@ jobs: - name: PHPUnit tests run: make test + - name: PHPUnit gigantic tests + run: "composer require --dev apis-guru/openapi-directory nexmo/api-specification; make unit_gigantic" + - name: Code coverage run: make coverage diff --git a/Makefile b/Makefile index 7d9358f0..1fd7f592 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,10 @@ install: composer.json package.json test: unit test-recursion.json test-recursion2.yaml test-recursion3_index.yaml test-empty-maps.json unit: - $(DOCKER_PHP) php $(PHPARGS) $(XPHPARGS) vendor/bin/phpunit --verbose --colors=always $(TESTCASE) + $(DOCKER_PHP) php $(PHPARGS) $(XPHPARGS) vendor/bin/phpunit --exclude-group gigantic --verbose --colors=always $(TESTCASE) + +unit_gigantic: # run test which requires big packages (>778 MB): apis-guru/openapi-directory, nexmo/api-specification + $(DOCKER_PHP) php $(PHPARGS) $(XPHPARGS) vendor/bin/phpunit --group gigantic --verbose --colors=always # test specific JSON files in tests/spec/data/ # e.g. test-recursion will run validation on tests/spec/data/recursion.json diff --git a/README.md b/README.md index d7cd0715..71334469 100644 --- a/README.md +++ b/README.md @@ -320,6 +320,8 @@ You may use the docker environment for local development: docker-compose build make IN_DOCKER=1 install make IN_DOCKER=1 test + make IN_DOCKER=1 unit # run all tests except a big test (below) + make IN_DOCKER=1 unit_gigantic # run only a big test ... diff --git a/composer.json b/composer.json index 3dbff339..c73439ee 100644 --- a/composer.json +++ b/composer.json @@ -28,8 +28,6 @@ "phpunit/phpunit": "^6.5 || ^7.5 || ^8.5 || ^9.4", "oai/openapi-specification": "3.0.3", "mermade/openapi3-examples": "1.0.0", - "apis-guru/openapi-directory": "1.0.0", - "nexmo/api-specification": "1.0.0", "phpstan/phpstan": "^0.12.0 || ^1.9" }, "conflict": { diff --git a/tests/spec/OpenApiTest.php b/tests/spec/OpenApiTest.php index 433bd352..158908b9 100644 --- a/tests/spec/OpenApiTest.php +++ b/tests/spec/OpenApiTest.php @@ -184,7 +184,9 @@ public function specProvider() } /** + * This test requires 2 big packages (>778 MB): apis-guru/openapi-directory, nexmo/api-specification. So it is separated from running with other PHPUnit tests * @dataProvider specProvider + * @group gigantic */ public function testSpecs($openApiFile) {