Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.4.5, 3.5, 3.9
-
MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_39_STABLE
-
MOODLE_39_STABLE
-
MDL-63580-master -
Hide
Setup
- Put into your local directory the attached test file test_cron_run_single_task.php (This script execute \mod_forum\task\cron_task using the deprecated function cron_run_single_task).
- Log in as an admin
- Go to Site administration / Server / System paths
- Set "Path to PHP CLI" to the path to your PHP executable.
- On Linux, you can use the value returned by the command "which php" on your terminal.
- On Windows, you can use the value returned by the command "where php" on your terminal.
- Enable the debugging mode in Site administration / Development / Debugging
- Set debug to 'DEVELOPER: extra Moodle debug messages for developers' value.
Testing Scenario 1: Test cron_run_single_task is deprecated.
- Log in as an admin
- Go to this URL in your browser: http://MOODLESITE/local/test_cron_run_single_task.php
- Expected result: Check you can see this message:
cron_run_single_task() is deprecated. Please use \tool_task\run_from_cli::execute() instead.
line 3326 of /lib/deprecatedlib.php: call to debugging()
line 11 of /local/test_cron_run_single_task.php: call to cron_run_single_task()
Execute scheduled task: Forum mailings and maintenance jobs ...
Testing Scenario 2: Run schedule task from Scheduled Tasks manager
- Log in as an admin
- Go to Site administration / Server / Tasks / Scheduled tasks
- Click "Run now" for the "Forum mailings and maintenance jobs" task ('\mod_forum\task\cron_task').
- Expected result: Confirm that the task executes successfully without any errors (except maybe when the outgoing email settings have not been properly configured and that Moodle can't send email messages. This is fine. The important thing is that the task executes okay.)
Testing Scenario 3: Check CLI script schedule_task.php in admin/cli works fine.
- Run the next command in your console from your root Moodle installation.
php admin/cli/scheduled_task.php
- Expected result: Confirm that you could see the help.
- Run the next command in your console. Be sure, you are in the Path on your Moodle installation.
php admin/cli/scheduled_task.php --execute='\mod_forum\task\cron_task'
- Expected result: Confirm that the task executes successfully without any errors (except maybe when the outgoing email settings have not been properly configured and that Moodle can't send email messages. This is fine. The important thing is that the task executes okay.)
- Run the next command in your console from your root Moodle installation.
php admin/cli/scheduled_task.php --list
- Expected result: Confirm that the script executes successfully listing all the scheduled tasks.
Testing Scenario 4: Check CLI script schedule_task.php in admin/tool/task/cli works fine and show a deprecated message.
- Run the next command in your console. Be sure, you are in the Path on your Moodle installation.
php admin/tool/task/cli/schedule_task.php --execute='\mod_forum\task\cron_task'
- Expected result: Confirm that the task executes successfully without any errors (except maybe when the outgoing email settings have not been properly configured and that Moodle can't send email messages. This is fine. The important thing is that the task executes okay.) and show the next debugging message on the top:
++ admin/tool/task/cli/schedule_task.php is deprecated. Please use admin/cli/schedule_task.php instead. ++
* line 39 of /admin/tool/task/cli/schedule_task.php: call to debugging()
Testing Scenario 5: Check CLI script adhoc_task.php in admin/cli works fine.
- Run the next command in your console. Be sure, you are in the root folder on your Moodle installation.
php admin/cli/adhoc_task.php
- Expected result: Confirm that you could see the help.
- Run attached testadhoc_task.php script to queue a new adhoc task.
- Run the next command in your console. Be sure, you are in theroot folder on your Moodle installation.
php admin/cli/adhoc_task.php --execute
- Expected result: Confirm that the task executes successfully without any errors.
- Run attached testadhoc_task.php script to queue a new adhoc task.
- Run the next command in your console. Be sure, you are in the root folder on your Moodle installation.
php admin/cli/adhoc_task.php --execute --showsql --showdebugging
- Expected result: Confirm that the task executes successfully without any errors and with SQL and debugging output.
Testing Scenario 6: Check CLI script adhoc_task.php in admin/tool/task/cli works fine.
- Run attached testadhoc_task.php script to queue a new adhoc task.
- Run the next command in your console. Be sure, you are in the Path on your Moodle installation.
php admin/tool/task/cli/adhoc_task.php --execute
- Expected result: Confirm that the task executes successfully without any errors and show a deprecated message on the top:
++ admin/tool/task/cli/adhoc_task.php is deprecated. Please use admin/cli/adhoc_task.php instead. ++
* line 50 of /admin/tool/task/cli/adhoc_task.php: call to debugging()
Testing Scenario 7: Check the H5P overview show 'Run now' in the H5P scheduled task
- Login as an admin.
- Go to Site administration/H5P/H5P overview
- Expected result: Confirm you can see 'Run now' below the Status in the feature H5P scheduled task.
ShowSetup Put into your local directory the attached test file test_cron_run_single_task.php (This script execute \mod_forum\task\cron_task using the deprecated function cron_run_single_task). Log in as an admin Go to Site administration / Server / System paths Set " Path to PHP CLI " to the path to your PHP executable. On Linux, you can use the value returned by the command "which php" on your terminal. On Windows, you can use the value returned by the command "where php" on your terminal. Enable the debugging mode in Site administration / Development / Debugging Set debug to ' DEVELOPER: extra Moodle debug messages for developers' value. Testing Scenario 1: Test cron_run_single_task is deprecated. Log in as an admin Go to this URL in your browser: http://MOODLESITE/local/test_cron_run_single_task.php Expected result: Check you can see this message: cron_run_single_task() is deprecated. Please use \tool_task\run_from_cli::execute() instead. line 3326 of /lib/deprecatedlib.php: call to debugging() line 11 of /local/test_cron_run_single_task.php: call to cron_run_single_task() Execute scheduled task: Forum mailings and maintenance jobs ... Testing Scenario 2: Run schedule task from Scheduled Tasks manager Log in as an admin Go to Site administration / Server / Tasks / Scheduled tasks Click " Run now " for the " Forum mailings and maintenance jobs " task ('\mod_forum\task\cron_task'). Expected result: Confirm that the task executes successfully without any errors (except maybe when the outgoing email settings have not been properly configured and that Moodle can't send email messages. This is fine. The important thing is that the task executes okay.) Testing Scenario 3: Check CLI script schedule_task.php in admin/cli works fine. Run the next command in your console from your root Moodle installation. php admin/cli/scheduled_task.php Expected result: Confirm that you could see the help. Run the next command in your console. Be sure, you are in the Path on your Moodle installation. php admin/cli/scheduled_task.php --execute='\mod_forum\task\cron_task' Expected result: Confirm that the task executes successfully without any errors (except maybe when the outgoing email settings have not been properly configured and that Moodle can't send email messages. This is fine. The important thing is that the task executes okay.) Run the next command in your console from your root Moodle installation. php admin/cli/scheduled_task.php --list Expected result: Confirm that the script executes successfully listing all the scheduled tasks. Testing Scenario 4: Check CLI script schedule_task.php in admin/tool/task/cli works fine and show a deprecated message. Run the next command in your console. Be sure, you are in the Path on your Moodle installation. php admin/tool/task/cli/schedule_task.php --execute='\mod_forum\task\cron_task' Expected result: Confirm that the task executes successfully without any errors (except maybe when the outgoing email settings have not been properly configured and that Moodle can't send email messages. This is fine. The important thing is that the task executes okay.) and show the next debugging message on the top: ++ admin/tool/task/cli/schedule_task.php is deprecated. Please use admin/cli/schedule_task.php instead. ++ * line 39 of /admin/tool/task/cli/schedule_task.php: call to debugging() Testing Scenario 5: Check CLI script adhoc_task.php in admin/cli works fine. Run the next command in your console. Be sure, you are in the root folder on your Moodle installation. php admin/cli/adhoc_task.php Expected result: Confirm that you could see the help. Run attached testadhoc_task.php script to queue a new adhoc task. Run the next command in your console. Be sure, you are in theroot folder on your Moodle installation. php admin/cli/adhoc_task.php --execute Expected result: Confirm that the task executes successfully without any errors. Run attached testadhoc_task.php script to queue a new adhoc task. Run the next command in your console. Be sure, you are in the root folder on your Moodle installation. php admin/cli/adhoc_task.php --execute --showsql --showdebugging Expected result: Confirm that the task executes successfully without any errors and with SQL and debugging output. Testing Scenario 6: Check CLI script adhoc_task.php in admin/tool/task/cli works fine. Run attached testadhoc_task.php script to queue a new adhoc task. Run the next command in your console. Be sure, you are in the Path on your Moodle installation. php admin/tool/task/cli/adhoc_task.php --execute Expected result: Confirm that the task executes successfully without any errors and show a deprecated message on the top: ++ admin/tool/task/cli/adhoc_task.php is deprecated. Please use admin/cli/adhoc_task.php instead. ++ * line 50 of /admin/tool/task/cli/adhoc_task.php: call to debugging() Testing Scenario 7: Check the H5P overview show 'Run now' in the H5P scheduled task Login as an admin. Go to Site administration/H5P/H5P overview Expected result: Confirm you can see 'Run now' below the Status in the feature H5P scheduled task .
-
3
-
Moppies Moodle 3.8 Sprint 1, Moppies Moodle 3.8 Sprint 2, Moppies Moodle 3.8 Sprint 3, Moppies Moodle 3.8 Sprint 4, Moppies Kanban
Description
Working on MDL-60514 we created a new class that does cron_run_single_task() never used again in the core.
Attachments
- Screenshot_1.png
- 346 kB
- Screenshot_2.png
- 223 kB
- Screenshot_3.png
- 90 kB
- testadhoc_task.php
- 0.1 kB
Issue Links
- has been marked as being related by
-
MDL-69227 Have the deprecated task cli's just call the new cli's
-
- Closed
-
-
MDL-66925 Enable cli/adhoc_task.php to be run as a pseudo daemon with --keep-alive=60
-
- Closed
-
- has to be done after
-
MDL-60514 Scheduled task mod_forum\task\cron_task fails when executed as "Run now"
-
- Closed
-
- has to be done before
-
MDL-63594 Final deprecation of cron_run_single_task() function
-
- Closed
-
- is blocked by
-
MDL-60514 Scheduled task mod_forum\task\cron_task fails when executed as "Run now"
-
- Closed
-