[8.x] Create ScheduleTestCommand #35573
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, we have a couple ways to run scheduled jobs in our local environments. In Homestead we can enable
schedule:run
to be enabled for a site. We also have the relatively newschedule:work
command that starts a long running worker in your terminal.I've never turned on scheduling in Homestead, because I don't want the jobs running running around the clock on there. And while
schedule:work
is nice, chances are you are going to need to manipulate when your commands are scheduled if you want to run some of them. You're not going to wait around for a command that runs at 1AM every morning.As a (hopefully) simpler alternative, this PR introduces a new command that allows you to execute whichever scheduled task you'd like.
Then make your selection, and the scheduled command will run.
While we are no longer testing the timing aspect of the scheduled job, we are still able to see the side effects from things like
sendOutputTo()
, hooks, and pings, and we are able to test truth and environment constraints.