File tree Expand file tree Collapse file tree 6 files changed +35
-2
lines changed
Expand file tree Collapse file tree 6 files changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44The format is based on [ Keep a Changelog] ( http://keepachangelog.com/en/1.0.0/ )
55and this project adheres to [ Semantic Versioning] ( http://semver.org/spec/v2.0.0.html ) .
66
7+ ## 1.0.2 - 2020-12-27
8+
9+ ** Fixed**
10+
11+ - Undefined offset error for closure commands
12+
713## 1.0.1 - 2020-12-07
814
915** Fixed**
Original file line number Diff line number Diff line change @@ -52,11 +52,11 @@ STACKKIT_CLOUD_SCHEDULER_APP_URL=https://yourdomainname.com/cloud-scheduler-job
5252
5353# Cloud Scheduler Example
5454
55- Here is an example job that will run ` php artisan inspire ` every minute.
55+ Here is an example job that will run ` php artisan schedule:run ` every minute.
5656
5757These are the most important settings:
5858- Target must be ` HTTP `
59- - URL must be ` https://yourdomainname.com/cloud-scheduler-job `
59+ - URL and AUD (audience) must be ` https://yourdomainname.com/cloud-scheduler-job `
6060- Auth header must be OIDC token!
6161
6262<img src =" /example.png " >
Original file line number Diff line number Diff line change @@ -96,6 +96,10 @@ private function getScheduledCommand($command)
9696 $ events = $ this ->schedule ->events ();
9797
9898 foreach ($ events as $ event ) {
99+ if (!is_string ($ event ->command )) {
100+ continue ;
101+ }
102+
99103 $ eventCommand = $ this ->commandWithoutArtisan ($ event ->command );
100104
101105 if ($ command === $ eventCommand ) {
Original file line number Diff line number Diff line change @@ -21,5 +21,8 @@ protected function schedule(Schedule $schedule)
2121 })->after (function () {
2222 Log::warning ('log before ' );
2323 });
24+ $ schedule ->call (function () {
25+ Log::info ('log call ' );
26+ });
2427 }
2528}
Original file line number Diff line number Diff line change @@ -229,4 +229,24 @@ public function in_case_of_signature_verification_failure_it_will_retry()
229229 Event::assertDispatched (CacheHit::class);
230230 Event::assertDispatched (KeyWritten::class);
231231 }
232+
233+ /** @test */
234+ public function it_can_run_the_schedule_run_command ()
235+ {
236+ $ this ->fakeCommand ->shouldReceive ('capture ' )->andReturn ('schedule:run ' );
237+ $ this ->openId ->shouldReceive ('guardAgainstInvalidOpenIdToken ' )->andReturnNull ();
238+ $ this ->openId ->shouldReceive ('getKidFromOpenIdToken ' )->andReturnNull ();
239+ $ this ->openId ->shouldReceive ('decodeOpenIdToken ' )->andReturnNull ();
240+
241+ Log::swap (new LogFake ());
242+
243+ $ this ->taskHandler ->handle ();
244+
245+ Log::assertLoggedMessage ('info ' , 'log after ' );
246+ Log::assertLoggedMessage ('warning ' , 'log before ' );
247+ Log::assertLoggedMessage ('info ' , 'log call ' );
248+
249+ // @todo - can't test commands run from schedule:run because testbench has no artisan binary.
250+ // Log::assertLoggedMessage('debug', 'did something testy');
251+ }
232252}
You can’t perform that action at this time.
0 commit comments