diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index c152c7a480a..0b412158291 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -29,6 +29,7 @@ This serves two purposes: - Minor: `Includes::path()` and `Includes::get()` methods now normalizes paths to be basenames to match the behaviour of the other include methods in https://github.com/hydephp/develop/pull/1738. This means that nested directories are no longer supported, as you should use a data collection for that. - Minor: The `processing_time_ms` attribute in the `sitemap.xml` file has now been removed in https://github.com/hydephp/develop/pull/1744 - Improved the sitemap data generation to be smarter and more dynamic in https://github.com/hydephp/develop/pull/1744 +- Skipped build tasks will now exit with an exit code of 3 instead of 0 in https://github.com/hydephp/develop/pull/1749 - The `hasFeature` method on the Hyde facade and HydeKernel now only accepts a Feature enum value instead of a string for its parameter. - Changed how the documentation search is generated, to be an `InMemoryPage` instead of a post-build task. - Media asset files are now copied using the new build task instead of the deprecated `BuildService::transferMediaAssets()` method. diff --git a/packages/framework/src/Framework/Features/BuildTasks/BuildTaskSkippedException.php b/packages/framework/src/Framework/Features/BuildTasks/BuildTaskSkippedException.php index cc4cff9b406..e10e8d60f31 100644 --- a/packages/framework/src/Framework/Features/BuildTasks/BuildTaskSkippedException.php +++ b/packages/framework/src/Framework/Features/BuildTasks/BuildTaskSkippedException.php @@ -8,7 +8,7 @@ class BuildTaskSkippedException extends RuntimeException { - public function __construct(string $message = 'Task was skipped', int $code = 0) + public function __construct(string $message = 'Task was skipped', int $code = 3) { parent::__construct($message, $code); } diff --git a/packages/framework/tests/Feature/Commands/BuildSitemapCommandTest.php b/packages/framework/tests/Feature/Commands/BuildSitemapCommandTest.php index ee13bc9bf03..ab66436b8a4 100644 --- a/packages/framework/tests/Feature/Commands/BuildSitemapCommandTest.php +++ b/packages/framework/tests/Feature/Commands/BuildSitemapCommandTest.php @@ -40,7 +40,7 @@ public function testSitemapIsNotGeneratedWhenConditionsAreNotMet() ->expectsOutputToContain('Generating sitemap...') ->expectsOutputToContain('Skipped') ->expectsOutput(' > Cannot generate sitemap without a valid base URL') - ->assertExitCode(0); + ->assertExitCode(3); $this->assertFileDoesNotExist(Hyde::path('_site/sitemap.xml')); } diff --git a/packages/framework/tests/Unit/BuildTaskSkippedExceptionTest.php b/packages/framework/tests/Unit/BuildTaskSkippedExceptionTest.php index 3d3e91aa581..8d48ab00f16 100644 --- a/packages/framework/tests/Unit/BuildTaskSkippedExceptionTest.php +++ b/packages/framework/tests/Unit/BuildTaskSkippedExceptionTest.php @@ -39,7 +39,7 @@ public function testDefaultExceptionCode() { $exception = new BuildTaskSkippedException(); - $this->assertSame(0, $exception->getCode()); + $this->assertSame(3, $exception->getCode()); } public function testCustomExceptionCode() diff --git a/packages/framework/tests/Unit/BuildTaskUnitTest.php b/packages/framework/tests/Unit/BuildTaskUnitTest.php index fa5494f7407..48c49b8bbda 100644 --- a/packages/framework/tests/Unit/BuildTaskUnitTest.php +++ b/packages/framework/tests/Unit/BuildTaskUnitTest.php @@ -192,7 +192,7 @@ public function testTaskSkipping() })->run(); }); - $this->assertSame(0, $task->property('exitCode')); + $this->assertSame(3, $task->property('exitCode')); $this->assertSame('Skipped', trim($task->buffer[1])); $this->assertSame(' > Task was skipped', $task->buffer[2]); } @@ -205,7 +205,7 @@ public function testTaskSkippingWithCustomMessage() })->run(); }); - $this->assertSame(0, $task->property('exitCode')); + $this->assertSame(3, $task->property('exitCode')); $this->assertSame('Skipped', trim($task->buffer[1])); $this->assertSame(' > Custom reason', $task->buffer[2]); }