Skip to content

Conversation

@amirhshokri
Copy link
Contributor

@amirhshokri amirhshokri commented Aug 24, 2025

This PR enhances the test coverage for the queue:prune-failed command, focusing specifically on scenarios involving the --hours option. Previously, tests only verified pruning at the date level. The new tests ensure precise pruning at the hour level, covering important edge cases.

Benefits:

  • Edge case handling: The prune logic uses a strict less than comparison. For example, if a job failed at 11:00 and pruning is performed at 11:00, only jobs that failed before 11:00 are deleted. These tests verify that behavior.

  • Coverage: Tests verify pruning behavior for all PrunableFailedJobProvider implementations supported by this command:

    src/Illuminate/Queue/Failed/DatabaseFailedJobProvider.php
    src/Illuminate/Queue/Failed/DatabaseUuidFailedJobProvider.php
    src/Illuminate/Queue/Failed/FileFailedJobProvider.php

@taylorotwell taylorotwell merged commit d743845 into laravel:12.x Aug 25, 2025
62 checks passed
@amirhshokri amirhshokri deleted the 12.x-add-tests-for-queue-prune-command branch August 25, 2025 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants