use of org.junit.jupiter.api.condition.DisabledOnOs in project gocd by gocd.
the class ExecTaskBuilderTest method shouldNormalizeWorkingDirectory.
@Test
@DisabledOnOs(OS.WINDOWS)
void shouldNormalizeWorkingDirectory() {
ExecTask execTask = new ExecTask("ant", "", "folder\\child");
CommandBuilder builder = (CommandBuilder) execTaskBuilder.createBuilder(builderFactory, execTask, pipelineStub("label", "."), resolver);
assertThat(builder.getWorkingDir().getPath()).isEqualTo("./folder/child");
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project spring-boot by spring-projects.
the class BootBuildImageIntegrationTests method buildsImageWithBuildpackFromDirectory.
@TestTemplate
@DisabledOnOs(OS.WINDOWS)
void buildsImageWithBuildpackFromDirectory() throws IOException {
writeMainClass();
writeLongNameResource();
writeBuildpackContent();
BuildResult result = this.gradleBuild.build("bootBuildImage", "--pullPolicy=IF_NOT_PRESENT");
String projectName = this.gradleBuild.getProjectDir().getName();
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
assertThat(result.getOutput()).contains("docker.io/library/" + projectName);
assertThat(result.getOutput()).contains("---> Hello World buildpack");
removeImages(projectName);
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project gocd by gocd.
the class AgentBootstrapperFunctionalTest method shouldDownloadJarIfTheCurrentOneIsWrong.
@Test
@DisabledOnOs(OS.WINDOWS)
public void shouldDownloadJarIfTheCurrentOneIsWrong() throws Exception {
File agentJar = new File("agent.jar");
agentJar.delete();
createRandomFile(agentJar);
long original = agentJar.length();
new AgentBootstrapper() {
@Override
void jvmExit(int returnValue) {
}
}.go(false, new AgentBootstrapperArgs().setServerUrl(new URL("http://" + "localhost" + ":" + server.getPort() + "/go")).setRootCertFile(null).setSslVerificationMode(AgentBootstrapperArgs.SslMode.NONE));
assertThat(agentJar.length(), not(original));
agentJar.delete();
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project gocd by gocd.
the class CommandLineTest method shouldLogPasswordsOnOutputAsStarsUnderLinux.
@Test
@DisabledOnOs(OS.WINDOWS)
void shouldLogPasswordsOnOutputAsStarsUnderLinux() {
CommandLine line = CommandLine.createCommandLine("echo").withArg("My Password is:").withArg(new PasswordArgument("secret")).withEncoding("utf-8");
InMemoryStreamConsumer output = new InMemoryStreamConsumer();
InMemoryStreamConsumer displayOutputStreamConsumer = InMemoryStreamConsumer.inMemoryConsumer();
ProcessWrapper processWrapper = line.execute(output, new EnvironmentVariableContext(), null);
processWrapper.waitForExit();
assertThat(output.getAllOutput(), containsString("secret"));
assertThat(displayOutputStreamConsumer.getAllOutput(), not(containsString("secret")));
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project gocd by gocd.
the class CommandLineTest method shouldBeAbleToRunCommandsFromRelativeDirectories.
@Test
@DisabledOnOs(OS.WINDOWS)
void shouldBeAbleToRunCommandsFromRelativeDirectories() throws IOException {
File shellScript = Files.createFile(temporaryFolder.resolve("hello-world.sh")).toFile();
FileUtils.writeStringToFile(shellScript, "echo ${PWD}", UTF_8);
assertThat(shellScript.setExecutable(true), is(true));
CommandLine line = CommandLine.createCommandLine("../hello-world.sh").withWorkingDir(subFolder).withEncoding("utf-8");
InMemoryStreamConsumer out = new InMemoryStreamConsumer();
line.execute(out, new EnvironmentVariableContext(), null).waitForExit();
assertThat(out.getAllOutput().trim(), endsWith("subFolder"));
}
Aggregations