@@ -64,9 +64,6 @@ sub setup {
64
64
65
65
$self -> es_client;
66
66
67
- # Run the Delete Index Tests before mapping deployment
68
- $self -> test_delete_mappings;
69
-
70
67
# Deploy project mappings
71
68
$self -> put_mappings;
72
69
}
@@ -355,102 +352,6 @@ sub prepare_user_test_data {
355
352
);
356
353
}
357
354
358
- sub test_delete_mappings {
359
- my $self = $_ [0];
360
-
361
- $self -> test_delete_fails;
362
- $self -> test_delete_all;
363
- }
364
-
365
- sub test_delete_fails {
366
- my $self = $_ [0];
367
-
368
- my $iexitcode ;
369
- my $irunok ;
370
-
371
- subtest ' delete all not permitted' => sub {
372
-
373
- # mapping script - delete indices
374
- {
375
- local @ARGV = qw( mapping --delete --all) ;
376
- local %ENV = (%ENV );
377
-
378
- delete $ENV {' PLACK_ENV' };
379
- delete $ENV {' MOJO_MODE' };
380
-
381
- $irunok = MetaCPAN::Script::Runner::run;
382
- $iexitcode = $MetaCPAN::Script::Runner::EXIT_CODE ;
383
- }
384
-
385
- ok( !$irunok , " delete all fails" );
386
- is( $iexitcode , 1, " Exit Code '1' - Permission Error" );
387
- };
388
- }
389
-
390
- sub test_delete_all {
391
- my $self = $_ [0];
392
-
393
- subtest ' delete all deletes unknown index' => sub {
394
- subtest ' create index' => sub {
395
- my $smockindexjson = q( {
396
- "mock_index" : {
397
- "properties" : {
398
- "mock_field" : {
399
- "index" : "not_analyzed",
400
- "ignore_above" : 2048,
401
- "type" : "string"
402
- }
403
- }
404
- }
405
- }) ;
406
-
407
- local @ARGV = (
408
- ' mapping' , ' --create_index' ,
409
- ' mock_index' , ' --patch_mapping' ,
410
- $smockindexjson
411
- );
412
-
413
- ok(
414
- MetaCPAN::Script::Runner::run,
415
- " creation 'mock_index' succeeds"
416
- );
417
- is( $MetaCPAN::Script::Runner::EXIT_CODE ,
418
- 0, " Exit Code '0' - No Error" );
419
- };
420
- subtest ' info shows unknonwn index' => sub {
421
- local @ARGV = ( ' mapping' , ' --show_cluster_info' );
422
- my $mapping = MetaCPAN::Script::Mapping-> new_with_options(
423
- $self -> _config );
424
-
425
- ok( $mapping -> run, " show info succeeds" );
426
- is( $mapping -> exit_code, 0, " Exit Code '0' - No Error" );
427
-
428
- ok( defined $mapping -> indices_info, ' Index Info built' );
429
- ok( defined $mapping -> indices_info-> {' mock_index' },
430
- ' Unknown Index printed' );
431
- };
432
- subtest ' delete all succeeds' => sub {
433
- local @ARGV = qw( mapping --delete --all) ;
434
-
435
- ok( MetaCPAN::Script::Runner::run, " delete all succeeds" );
436
- is( $MetaCPAN::Script::Runner::EXIT_CODE ,
437
- 0, " Exit Code '0' - No Error" );
438
- };
439
- subtest ' info does not show unknown index' => sub {
440
- local @ARGV = ( ' mapping' , ' --show_cluster_info' );
441
- my $mapping = MetaCPAN::Script::Mapping-> new_with_options(
442
- $self -> _config );
443
-
444
- ok( $mapping -> run, " show info succeeds" );
445
- is( $mapping -> exit_code, 0, " Exit Code '0' - No Error" );
446
-
447
- ok( defined $mapping -> indices_info, ' Index Info built' );
448
- ok( !defined $mapping -> indices_info-> {' mock_index' },
449
- ' Unknown Index not printed' );
450
- };
451
- };
452
- }
453
-
454
355
sub test_mappings {
455
356
my $self = $_ [0];
456
357
@@ -473,16 +374,6 @@ sub test_index_missing {
473
374
ok( $mapping -> run, " deletion 'cover' succeeds" );
474
375
is( $mapping -> exit_code, 0, " Exit Code '0' - No Error" );
475
376
};
476
- subtest ' mapping verification fails' => sub {
477
- local @ARGV = qw( mapping --verify) ;
478
- my $mapping
479
- = MetaCPAN::Script::Mapping-> new_with_options(
480
- $self -> _config );
481
-
482
- is( $mapping -> run, 0, " verification execution fails" );
483
- is( $mapping -> exit_code, 1,
484
- " Exit Code '1' - Verification Error" );
485
- };
486
377
subtest ' re-create cover index' => sub {
487
378
local @ARGV = (
488
379
' mapping' , ' --create_index' ,
@@ -536,16 +427,6 @@ sub test_field_mismatch {
536
427
537
428
is( $mapping -> exit_code, 0, " Exit Code '0' - No Error" );
538
429
};
539
- subtest ' field verification fails' => sub {
540
- local @ARGV = qw( mapping --verify) ;
541
- my $mapping
542
- = MetaCPAN::Script::Mapping-> new_with_options(
543
- $self -> _config );
544
-
545
- is( $mapping -> run, 0, " verification fails" );
546
- is( $mapping -> exit_code, 1,
547
- " Exit Code '1' - Verification Error" );
548
- };
549
430
subtest ' mapping re-establish field' => sub {
550
431
local @ARGV = (
551
432
' mapping' , ' --update_index' ,
0 commit comments