22
33namespace Tests \Routes \Wiki \Managers ;
44
5- use App \Jobs \CirrusSearch \ElasticSearchIndexInit ;
65use App \Jobs \ElasticSearchAliasInit ;
76use App \Jobs \MediawikiInit ;
87use App \Jobs \ProvisionWikiDbJob ;
@@ -41,12 +40,10 @@ class CreateTest extends TestCase {
4140 */
4241 public function testWikiCreateDispatchesSomeJobs ($ elasticSearchConfig ) {
4342 $ enabledForNewWikis = $ elasticSearchConfig ['enabledForNewWikis ' ];
44- $ clusterWithoutSharedIndex = $ elasticSearchConfig ['clusterWithoutSharedIndex ' ] ?? null ;
4543 $ sharedIndexHost = $ elasticSearchConfig ['sharedIndexHost ' ] ?? null ;
4644 $ sharedIndexPrefix = $ elasticSearchConfig ['sharedIndexPrefix ' ] ?? null ;
4745
4846 Config::set ('wbstack.elasticsearch_enabled_by_default ' , $ enabledForNewWikis );
49- Config::set ('wbstack.elasticsearch_cluster_without_shared_index ' , $ clusterWithoutSharedIndex );
5047 Config::set ('wbstack.elasticsearch_shared_index_host ' , $ sharedIndexHost );
5148 Config::set ('wbstack.elasticsearch_shared_index_prefix ' , $ sharedIndexPrefix );
5249
@@ -73,21 +70,13 @@ public function testWikiCreateDispatchesSomeJobs($elasticSearchConfig) {
7370 ]
7471 );
7572
76- if ($ enabledForNewWikis && $ clusterWithoutSharedIndex ) {
77- Queue::assertPushed (function (ElasticSearchIndexInit $ job ) use ($ clusterWithoutSharedIndex ) {
78- return $ job ->cluster () === $ clusterWithoutSharedIndex ;
79- });
80- } else {
81- Queue::assertNotPushed (ElasticSearchIndexInit::class);
82- }
83-
8473 if ($ enabledForNewWikis && $ sharedIndexHost && $ sharedIndexPrefix ) {
8574 Queue::assertPushed (ElasticSearchAliasInit::class, 1 );
8675 } else {
8776 Queue::assertNotPushed (ElasticSearchAliasInit::class);
8877 }
8978
90- if ($ enabledForNewWikis && !$ clusterWithoutSharedIndex && ! ($ sharedIndexHost && $ sharedIndexPrefix )) {
79+ if ($ enabledForNewWikis && !($ sharedIndexHost && $ sharedIndexPrefix )) {
9180 $ response ->assertStatus (503 )
9281 ->assertJsonPath ('message ' , 'Search enabled, but its configuration is invalid ' );
9382
@@ -117,18 +106,6 @@ public function testWikiCreateDispatchesSomeJobs($elasticSearchConfig) {
117106 }
118107
119108 public static function createDispatchesSomeJobsProvider () {
120- yield [[
121- 'enabledForNewWikis ' => true ,
122- 'clusterWithoutSharedIndex ' => 'all ' ,
123- 'sharedIndexHost ' => 'somehost ' ,
124- 'sharedIndexPrefix ' => 'testing_1 ' ,
125- ]];
126-
127- yield [[
128- 'enabledForNewWikis ' => true ,
129- 'clusterWithoutSharedIndex ' => 'default ' ,
130- ]];
131-
132109 yield [[
133110 'enabledForNewWikis ' => true ,
134111 'sharedIndexHost ' => 'somehost ' ,
0 commit comments