Search in sources :

Example 46 with MissionHealthCheckMatcher

use of com.github.nagyesta.abortmission.core.matcher.MissionHealthCheckMatcher in project lowkey-vault by nagyesta.

the class MissionOutlineDefinition method defineOutline.

@Override
protected Map<String, Consumer<AbortMissionCommandOps>> defineOutline() {
    return Map.of(SHARED_CONTEXT, ops -> {
        final MissionHealthCheckMatcher integrationTestMatcher = matcher().classNamePattern(".*IntegrationTest").build();
        final MissionHealthCheckEvaluator integrationTests = percentageBasedEvaluator(integrationTestMatcher).build();
        final MissionHealthCheckEvaluator reportOnly = reportOnlyEvaluator(matcher().anyClass().build()).build();
        ops.registerHealthCheck(integrationTests);
        ops.registerHealthCheck(reportOnly);
    });
}
Also used : MissionHealthCheckEvaluator(com.github.nagyesta.abortmission.core.healthcheck.MissionHealthCheckEvaluator) MissionHealthCheckMatcher(com.github.nagyesta.abortmission.core.matcher.MissionHealthCheckMatcher)

Example 47 with MissionHealthCheckMatcher

use of com.github.nagyesta.abortmission.core.matcher.MissionHealthCheckMatcher in project lowkey-vault by nagyesta.

the class MissionOutlineDefinition method defineOutline.

@Override
protected Map<String, Consumer<AbortMissionCommandOps>> defineOutline() {
    return Map.of(SHARED_CONTEXT, ops -> {
        final TagDependencyNameExtractor extractor = new TagDependencyNameExtractor();
        Stream.of("Key", "Secret").forEach(type -> {
            final MissionHealthCheckMatcher typeMatcher = matcher().dependencyWith(type).extractor(extractor).build();
            final MissionHealthCheckEvaluator featurePercentage = percentageBasedEvaluator(typeMatcher).abortThreshold(ABORT_THRESHOLD).burnInTestCount(TOTAL_BURN_IN_TEST_COUNT).build();
            ops.registerHealthCheck(featurePercentage);
            Stream.of("Create", "Get", "Delete", "List", "Update", "ListDeleted", "Recover", "Purge", "Backup", "Restore").forEach(subtype -> {
                final MissionHealthCheckMatcher subTypeMatcher = matcher().dependencyWith(type + subtype).extractor(extractor).build();
                final MissionHealthCheckEvaluator subFeaturePercentage = percentageBasedEvaluator(subTypeMatcher).abortThreshold(ABORT_THRESHOLD).burnInTestCount(BURN_IN_TEST_COUNT).build();
                ops.registerHealthCheck(subFeaturePercentage);
            });
        });
        Stream.of("CreateVault", "KeyImport", "KeyEncrypt", "KeySign", "RSA", "EC", "OCT").forEach(tag -> {
            final MissionHealthCheckMatcher matcher = matcher().dependencyWith(tag).extractor(extractor).build();
            final MissionHealthCheckEvaluator tagPercentage = percentageBasedEvaluator(matcher).abortThreshold(ABORT_THRESHOLD).burnInTestCount(BURN_IN_TEST_COUNT).build();
            ops.registerHealthCheck(tagPercentage);
        });
    });
}
Also used : MissionHealthCheckEvaluator(com.github.nagyesta.abortmission.core.healthcheck.MissionHealthCheckEvaluator) TagDependencyNameExtractor(com.github.nagyesta.abortmission.booster.cucumber.matcher.TagDependencyNameExtractor) MissionHealthCheckMatcher(com.github.nagyesta.abortmission.core.matcher.MissionHealthCheckMatcher)

Aggregations

MissionHealthCheckMatcher (com.github.nagyesta.abortmission.core.matcher.MissionHealthCheckMatcher)47 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)29 MethodSource (org.junit.jupiter.params.provider.MethodSource)21 Test (org.junit.jupiter.api.Test)15 Registry (java.rmi.registry.Registry)7 StageTimeMeasurement (com.github.nagyesta.abortmission.core.telemetry.StageTimeMeasurement)5 MissionHealthCheckEvaluator (com.github.nagyesta.abortmission.core.healthcheck.MissionHealthCheckEvaluator)4 LaunchStatisticsService (com.github.nagyesta.abortmission.strongback.rmi.service.LaunchStatisticsService)3 RemoteException (java.rmi.RemoteException)3 NullSource (org.junit.jupiter.params.provider.NullSource)3 ValueSource (org.junit.jupiter.params.provider.ValueSource)3 InOrder (org.mockito.InOrder)3 TagDependencyNameExtractor (com.github.nagyesta.abortmission.booster.jupiter.extractor.TagDependencyNameExtractor)2 DependencyNameExtractor (com.github.nagyesta.abortmission.core.extractor.DependencyNameExtractor)2 StringDependencyNameExtractor (com.github.nagyesta.abortmission.core.extractor.impl.StringDependencyNameExtractor)2 StageStatisticsCollectorFactory (com.github.nagyesta.abortmission.core.healthcheck.StageStatisticsCollectorFactory)2 StageStatisticsSnapshot (com.github.nagyesta.abortmission.core.healthcheck.StageStatisticsSnapshot)2 MissionStatisticsCollector (com.github.nagyesta.abortmission.core.healthcheck.impl.MissionStatisticsCollector)2 HashMap (java.util.HashMap)2 Consumer (java.util.function.Consumer)2