Closed (fixed)
Project:
Drupal core
Version:
8.5.x-dev
Component:
cron system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
21 Aug 2017 at 10:50 UTC
Updated:
27 Oct 2017 at 10:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
fazni commentedComment #3
fazni commentedComment #4
fazni commentedComment #6
fazni commentedComment #7
fazni commentedComment #8
fazni commentedComment #9
fazni commentedComment #10
valthebaldComment #11
valthebaldThe cron service gets a bunch of other services in its constructor. Can we inject time service in the same way (i.e. adding another constructor parameter)?
Comment #12
chenderson commentedI am working on this at DrupalCon Vienna
Comment #13
chenderson commentedAs suggested by valthebald I have added the time service into the constructor.
Comment #14
valthebaldExactly what I was looking for, thank you @chenderson!
Adding issue summary, tagging, moving to RTBC
Comment #15
dawehnerWe should make the
$timeparameter optional as otherwise code subclassing this class and overriding the constructor, would break.Comment #16
chenderson commented@valthebald thanks :)
@dawehner I have made the $time parameter optional and have set the tests running.
Just wondering for future reference, is it required to run all the test variations for this type of change? Also I assume I needed change this back to 'Needs review' given the updated patch?
Comment #17
valthebald@chenderson - there is no need to add all possible test combinations, default one is enough.
@dawehner - according to https://www.drupal.org/node/2562903#classes, only interfaces should be considered public API, and CronInterface does not set any expectations on constructor parameters
Comment #18
dawehnerJust an example: http://cgit.drupalcode.org/ultimate_cron/tree/src/UltimateCron.php?h=8.x...
I think avoiding BC breaks when we can easily is not really worth discussing :)
Comment #19
valthebald@dawehner: oki-doki! :)
testbot is happy, I dare move the issue back to RTBC
Comment #20
MixologicRe #17 Thank you valdthebald. Testbot maintainer here trying to figure out why we're racking up such high costs. RTBC automatic retesting is running 14 tests a day.
Comment #21
catchCommitted d26fe82 and pushed to 8.5.x. Thanks!