Problem/Motivation
in #3357969: For web server dependent unattended updates run the entire life cycle in a separate process that will not be affected by hosting time limits I was looking at moving \Drupal\Tests\automatic_updates\Functional\StatusCheckTest::testStatusChecksOnAdminPages to a build test.
I realized it testing 2 things
- Logic in automatic_updates_cron that we don’t run status checks more than 1x an hour(if cron runs more than 1x hour)
- which status check messages show on a page: summaries vs messages, errors vs warning
For 2) it probably doesn’t matter how the status checks are run. So it we could switch this to $this->container->get('automatic_updates.status_checker')->run(); the test could be simplified and could remain and a functional test.
HookCronTest is very broken. We could fix that test and also have it test that cron will not run status check more than 1x an hour. This would allow simplifying testStatusChecksOnAdminPages as described above
Proposed resolution
- Fix
\Drupal\Tests\automatic_updates\Kernel\HookCronTestsee MR comments as to why this broken. - Add test in
\Drupal\Tests\automatic_updates\Kernel\HookCronTestthat cron does not run readiness check more 1x an hour - Once 2) is done we can simplify
\Drupal\Tests\automatic_updates\Functional\StatusCheckTest::testStatusChecksOnAdminPagesbecause won't need to test that if cron runs more than once an hour status checks will not be re-run. This can just run status checker to because it just needs to test what we show not if cron run status checks
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork automatic_updates-3374753
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
tedbow#3357969: For web server dependent unattended updates run the entire life cycle in a separate process that will not be affected by hosting time limits is major so making this major because it blocks it
Comment #4
tedbowComment #5
tedbowTurns out sites do run cron up to every 5 minutes. Rescoping this to fix HookCronTest and then take out the 1 hour check from
\Drupal\Tests\automatic_updates\Functional\StatusCheckTest::testStatusChecksOnAdminPagesbecause it be tested in HookCronTestComment #6
tedbowComment #7
tedbowCreated a follow-up
Comment #8
phenaproximaCouple of comments could use rephrasing, but otherwise I think this is a very clear improvement!
Comment #9
tedbowComment #10
tedbowComment #11
phenaproximaA wonderful improvement!
Comment #13
phenaproxima