File tree Expand file tree Collapse file tree 7 files changed +60
-7
lines changed
app/code/Magento/Analytics
dev/tests/integration/testsuite/Magento/Analytics/Cron Expand file tree Collapse file tree 7 files changed +60
-7
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ class SubscriptionUpdateHandler
2424 /**
2525 * Config path for schedule setting of update handler.
2626 */
27- public const UPDATE_CRON_STRING_PATH = "crontab/default /jobs/analytics_update/schedule/cron_expr " ;
27+ public const UPDATE_CRON_STRING_PATH = "crontab/analytics /jobs/analytics_update/schedule/cron_expr " ;
2828
2929 /**
3030 * Flag code for the previous Base URL.
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ class CollectionTime extends Value
2323 /**
2424 * The path to config setting of schedule of collection data cron.
2525 */
26- public const CRON_SCHEDULE_PATH = 'crontab/default /jobs/analytics_collect_data/schedule/cron_expr ' ;
26+ public const CRON_SCHEDULE_PATH = 'crontab/analytics /jobs/analytics_collect_data/schedule/cron_expr ' ;
2727
2828 /**
2929 * @var WriterInterface
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ class SubscriptionHandler
2424 /**
2525 * Config path for schedule setting of subscription handler.
2626 */
27- public const CRON_STRING_PATH = 'crontab/default /jobs/analytics_subscribe/schedule/cron_expr ' ;
27+ public const CRON_STRING_PATH = 'crontab/analytics /jobs/analytics_subscribe/schedule/cron_expr ' ;
2828
2929 /**
3030 * Config value for schedule setting of subscription handler.
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" ?>
2+ <!--
3+ /**
4+ * Copyright 2025 Adobe
5+ * All Rights Reserved.
6+ */
7+ -->
8+ <config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" urn:magento:module:Magento_Cron:etc/cron_groups.xsd" >
9+ <group id =" analytics" >
10+ <schedule_generate_every >15</schedule_generate_every >
11+ <schedule_ahead_for >20</schedule_ahead_for >
12+ <schedule_lifetime >15</schedule_lifetime >
13+ <history_cleanup_every >10</history_cleanup_every >
14+ <history_success_lifetime >60</history_success_lifetime >
15+ <history_failure_lifetime >4320</history_failure_lifetime >
16+ <use_separate_process >1</use_separate_process >
17+ </group >
18+ </config >
Original file line number Diff line number Diff line change 66 */
77-->
88<config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" urn:magento:module:Magento_Cron:etc/crontab.xsd" >
9- <group id =" default " >
9+ <group id =" analytics " >
1010 <job name =" analytics_subscribe" instance =" Magento\Analytics\Cron\SignUp" method =" execute" />
1111 <job name =" analytics_update" instance =" Magento\Analytics\Cron\Update" method =" execute" />
1212 <job name =" analytics_collect_data" instance =" Magento\Analytics\Cron\CollectData" method =" execute" />
Original file line number Diff line number Diff line change 260260 <item name =" analytics/general/token" xsi : type =" string" >1</item >
261261 </argument >
262262 <argument name =" environment" xsi : type =" array" >
263- <item name =" crontab/default /jobs/analytics_collect_data/schedule/cron_expr" xsi : type =" string" >1</item >
264- <item name =" crontab/default /jobs/analytics_update/schedule/cron_expr" xsi : type =" string" >1</item >
265- <item name =" crontab/default /jobs/analytics_subscribe/schedule/cron_expr" xsi : type =" string" >1</item >
263+ <item name =" crontab/analytics /jobs/analytics_collect_data/schedule/cron_expr" xsi : type =" string" >1</item >
264+ <item name =" crontab/analytics /jobs/analytics_update/schedule/cron_expr" xsi : type =" string" >1</item >
265+ <item name =" crontab/analytics /jobs/analytics_subscribe/schedule/cron_expr" xsi : type =" string" >1</item >
266266 </argument >
267267 </arguments >
268268 </type >
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Copyright 2025 Adobe
4+ * All Rights Reserved.
5+ */
6+
7+ declare (strict_types=1 );
8+
9+ namespace Magento \Analytics \Cron ;
10+
11+ use Magento \Cron \Model \Config as CronConfig ;
12+ use Magento \Framework \App \Config \ReinitableConfigInterface ;
13+ use Magento \Framework \App \Config \Storage \WriterInterface ;
14+ use Magento \TestFramework \Helper \Bootstrap ;
15+ use PHPUnit \Framework \TestCase ;
16+
17+ class CronGroupConfigTest extends TestCase
18+ {
19+ /**
20+ * @magentoAppIsolation enabled
21+ */
22+ public function testAnalyticsJobsAreInAnalyticsGroup (): void
23+ {
24+ /** @var CronConfig $cronConfig */
25+ $ cronConfig = Bootstrap::getObjectManager ()->get (CronConfig::class);
26+ $ jobsByGroup = $ cronConfig ->getJobs ();
27+
28+ $ this ->assertArrayHasKey ('analytics ' , $ jobsByGroup , 'Cron group "analytics" should exist ' );
29+
30+ $ analyticsJobs = $ jobsByGroup ['analytics ' ];
31+ $ this ->assertArrayHasKey ('analytics_subscribe ' , $ analyticsJobs );
32+ $ this ->assertArrayHasKey ('analytics_update ' , $ analyticsJobs );
33+ $ this ->assertArrayHasKey ('analytics_collect_data ' , $ analyticsJobs );
34+ }
35+ }
You can’t perform that action at this time.
0 commit comments