use of org.junit.jupiter.api.condition.EnabledIfSystemProperty in project data-center-helm-charts by atlassian.
the class HelmOutputComparisonTest method record_helm_template_output_matches_expectations.
@ParameterizedTest
@EnumSource(Product.class)
@EnabledIfSystemProperty(named = "recordOutput", matches = "true")
void record_helm_template_output_matches_expectations(final Product product) throws Exception {
final var actualOutputFile = helm.captureHelmTemplateOutput(product, getHelmValuesFile(product));
stripBlankLines(actualOutputFile);
Path destination = Paths.get("src/test/resources/expected_helm_output/" + product + "/output.yaml");
Files.copy(actualOutputFile, destination, StandardCopyOption.REPLACE_EXISTING);
}
use of org.junit.jupiter.api.condition.EnabledIfSystemProperty in project zephyr by sunshower-io.
the class DirectoryScannerTest method ensureKernelDefaultDeploymentDirectoryIsScannedForRemovals.
@Test
@SneakyThrows
@EnabledIfSystemProperty(named = "flakytests", matches = "true")
void ensureKernelDefaultDeploymentDirectoryIsScannedForRemovals() {
val file = createFile();
kernel.addEventListener(eventListener, ModuleEvents.REMOVED, ModuleEvents.INSTALLED);
context.put(EntryPoint.ContextEntries.ARGS, new String[] { "--scan" });
scanner.initialize(context);
val latch = new CyclicBarrier(1);
watch(latch);
val installable = ProjectPlugins.TEST_PLUGIN_1.getFile();
latch.await();
latch.reset();
executorService.submit(() -> {
try {
do {
Thread.sleep(150);
} while (!scanner.running);
Files.transferTo(installable, new File(file, "whatever.war"));
latch.await();
} catch (Exception ex) {
fail();
}
});
latch.await();
latch.reset();
verify(eventListener, timeout(10000)).onEvent(eq(ModuleEvents.REMOVED), any());
reset(eventListener);
executorService.submit(() -> {
try {
System.out.println("deleting");
Thread.sleep(150);
java.nio.file.Files.delete(new File(file, "whatever.war").getAbsoluteFile().toPath());
} catch (Exception ex) {
}
});
scanner.stop();
verify(eventListener, timeout(10000)).onEvent(eq(ModuleEvents.REMOVED), any());
}
use of org.junit.jupiter.api.condition.EnabledIfSystemProperty in project mongo-java-server by bwaldvogel.
the class AbstractPerformanceTest method testComplexUpsert.
// https://github.com/bwaldvogel/mongo-java-server/issues/84
@Test
@EnabledIfSystemProperty(named = "run-mongo-java-server-performance-tests", matches = "true")
public void testComplexUpsert() throws Exception {
Document incUpdate = new Document();
Document updateQuery = new Document("$inc", incUpdate);
incUpdate.put("version", 1);
for (int hour = 0; hour < 24; hour++) {
for (int minute = 0; minute < 60; minute++) {
incUpdate.put("data." + hour + "." + minute + ".requests", 0);
incUpdate.put("data." + hour + "." + minute + ".responses", 0);
incUpdate.put("data." + hour + "." + minute + ".duration", 0);
}
}
for (int i = 0; i < 10; i++) {
long start = System.currentTimeMillis();
collection.updateOne(json("_id: 1"), updateQuery, new UpdateOptions().upsert(true));
long stop = System.currentTimeMillis();
log.info("Update took {} ms", stop - start);
}
}
use of org.junit.jupiter.api.condition.EnabledIfSystemProperty in project trellis-extensions by trellis-ldp.
the class SNSNotificationServiceTest method testNotification.
@Test
@EnabledIfSystemProperty(named = "trellis.aws.topic", matches = "arn:aws:sns:.*")
void testNotification() {
when(mockNotification.getIdentifier()).thenReturn(identifier);
when(mockNotification.getAgents()).thenReturn(singleton(agent));
when(mockNotification.getObject()).thenReturn(of(object));
when(mockNotification.getTypes()).thenReturn(singleton(AS.Create));
when(mockNotification.getObjectTypes()).thenReturn(singleton(LDP.RDFSource));
when(mockNotification.getCreated()).thenReturn(time);
final NotificationService svc = new SNSNotificationService(serializer);
svc.emit(mockNotification);
verify(mockNotification).getIdentifier();
}
use of org.junit.jupiter.api.condition.EnabledIfSystemProperty in project spring-cloud-dataflow-acceptance-tests by spring-cloud.
the class BatchRemotePartitioningAT method runBatchRemotePartitionJobCloudFoundry.
@Test
@EnabledIfSystemProperty(named = "PLATFORM_TYPE", matches = "cloudfoundry")
public void runBatchRemotePartitionJobCloudFoundry() {
logger.info("runBatchRemotePartitionJob - cloudfoundry");
final String prefix = CFConnectionProperties.CLOUDFOUNDRY_PROPERTIES;
String taskDefinition = TASK_NAME + String.format(" --%s.%s=%s", prefix, "username", cfConnectionProperties.getUsername()) + String.format(" --%s.%s=%s", prefix, "password", cfConnectionProperties.getPassword()) + String.format(" --%s.%s=%s", prefix, "org", cfConnectionProperties.getOrg()) + String.format(" --%s.%s=%s", prefix, "username", cfConnectionProperties.getUsername()) + String.format(" --%s.%s=%s", prefix, "space", cfConnectionProperties.getSpace()) + String.format(" --%s.%s=%s", prefix, "url", cfConnectionProperties.getUrl().toString()) + String.format(" --%s.%s=%s", prefix, "skipSslValidation", cfConnectionProperties.isSkipSslValidation());
TaskBuilder taskBuilder = Task.builder(dataFlowOperations);
try (Task task = taskBuilder.name(randomName()).definition(taskDefinition).description("runBatchRemotePartitionJob - cloudfoundry").build()) {
long launchId = task.launch(Collections.EMPTY_MAP, Arrays.asList("--platform=cloudfoundry"));
Awaitility.await().until(() -> task.executionStatus(launchId) == TaskExecutionStatus.COMPLETE);
assertThat(task.executions().size()).isEqualTo(1);
assertThat(task.execution(launchId).isPresent()).isTrue();
assertThat(task.execution(launchId).get().getExitCode()).isEqualTo(EXIT_CODE_SUCCESS);
}
}
Aggregations