use of jetbrains.buildServer.serverSide.SFinishedBuild in project teamcity-powershell by JetBrains.
the class PowerShellIntegrationTests method should_run_simple_command_file_ps1.
@Test(dataProvider = "supportedBitnessProvider")
@TestFor(issues = "TW-29803")
public void should_run_simple_command_file_ps1(@NotNull final PowerShellBitness bits) throws Throwable {
final File dir = createTempDir();
final File code = new File(dir, "code.ps1");
FileUtil.writeFileAndReportErrors(code, "echo works");
setRunnerParameter(PowerShellConstants.RUNNER_EXECUTION_MODE, PowerShellExecutionMode.PS1.getValue());
setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_MODE, PowerShellScriptMode.FILE.getValue());
setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_FILE, code.getPath());
setRunnerParameter(PowerShellConstants.RUNNER_BITNESS, bits.getValue());
final SFinishedBuild build = doTest(null);
dumpBuildLogLocally(build);
Assert.assertTrue(build.getBuildStatus().isSuccessful());
Assert.assertTrue(getBuildLog(build).contains("works"));
}
use of jetbrains.buildServer.serverSide.SFinishedBuild in project teamcity-powershell by JetBrains.
the class PowerShellIntegrationTests method should_run_simple_command_file_stdin.
@Test(dataProvider = "supportedBitnessProvider")
@TestFor(issues = "TW-29803")
public void should_run_simple_command_file_stdin(@NotNull final PowerShellBitness bits) throws Throwable {
final File code = createTempFile("echo works");
setRunnerParameter(PowerShellConstants.RUNNER_MIN_VERSION, "2.0");
setRunnerParameter(PowerShellConstants.RUNNER_EXECUTION_MODE, PowerShellExecutionMode.STDIN.getValue());
setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_MODE, PowerShellScriptMode.FILE.getValue());
setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_FILE, code.getPath());
setRunnerParameter(PowerShellConstants.RUNNER_BITNESS, bits.getValue());
final SFinishedBuild build = doTest(null);
dumpBuildLogLocally(build);
Assert.assertTrue(build.getBuildStatus().isSuccessful());
Assert.assertTrue(getBuildLog(build).contains("works"));
}
use of jetbrains.buildServer.serverSide.SFinishedBuild in project teamcity-powershell by JetBrains.
the class PowerShellIntegrationTests method testMultilineArguments.
@SuppressWarnings("TestMethodWithIncorrectSignature")
@Test(dataProvider = "supportedBitnessProvider")
@TestFor(issues = "TW-65627")
public void testMultilineArguments(@NotNull final PowerShellBitness bits) throws Throwable {
setRunnerParameter(PowerShellConstants.RUNNER_EXECUTION_MODE, PowerShellExecutionMode.PS1.getValue());
setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_MODE, PowerShellScriptMode.CODE.getValue());
setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_CODE, "param(\n" + "\t[string] $param1 = \"\"\n" + ")\n" + "\n" + "Write-Output \"praram1: $param1.\"");
setRunnerParameter(PowerShellConstants.RUNNER_BITNESS, bits.getValue());
setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_ARGUMENTS, "-param1 \"line1a = line1b\nline2a = line2b\"");
setBuildConfigurationParameter(PowerShellConstants.PARAM_ARGS_MULTILINE, "true");
final SFinishedBuild build = doTest(null);
dumpBuildLogLocally(build);
Assert.assertTrue(build.getBuildStatus().isSuccessful());
Assert.assertTrue(getBuildLog(build).contains("\"line1a = line1b line2a = line2b\""));
Assert.assertTrue(getBuildLog(build).contains("praram1: line1a = line1b line2a = line2b."));
}
use of jetbrains.buildServer.serverSide.SFinishedBuild in project teamcity-powershell by JetBrains.
the class PowerShellIntegrationTests method should_proper_bitness_run.
@Test(dataProvider = "supportedBitnessProvider")
public void should_proper_bitness_run(@NotNull final PowerShellBitness bits) throws Throwable {
setRunnerParameter(PowerShellConstants.RUNNER_EXECUTION_MODE, PowerShellExecutionMode.PS1.getValue());
setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_MODE, PowerShellScriptMode.CODE.getValue());
setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_CODE, "Write-Host \"ptr: $([IntPtr]::size)\"\r\n");
setRunnerParameter(PowerShellConstants.RUNNER_BITNESS, bits.getValue());
final SFinishedBuild build = doTest(null);
dumpBuildLogLocally(build);
Assert.assertTrue(build.getBuildStatus().isSuccessful());
final String output = bits == PowerShellBitness.x64 ? "8" : "4";
Assert.assertTrue(getBuildLog(build).contains("ptr: " + output + " NO"));
}
use of jetbrains.buildServer.serverSide.SFinishedBuild in project teamcity-powershell by JetBrains.
the class PowerShellIntegrationTests method testShouldKeepGeneratedFiles_Global.
@SuppressWarnings("TestMethodWithIncorrectSignature")
@Test(dataProvider = "supportedBitnessProvider")
@TestFor(issues = { "TW-39841", "TW-49772" })
public void testShouldKeepGeneratedFiles_Global(@NotNull final PowerShellBitness bits) throws Throwable {
setRunnerParameter(PowerShellConstants.RUNNER_EXECUTION_MODE, PowerShellExecutionMode.PS1.getValue());
setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_MODE, PowerShellScriptMode.CODE.getValue());
setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_CODE, "echo works\r\n");
setRunnerParameter(PowerShellConstants.RUNNER_BITNESS, bits.getValue());
setBuildConfigurationParameter("teamcity.dont.delete.temp.files", "true");
final SFinishedBuild build = doTest(null);
assertEquals(1, getTempFiles().length);
dumpBuildLogLocally(build);
Assert.assertTrue(build.getBuildStatus().isSuccessful());
Assert.assertTrue(getBuildLog(build).contains("works"));
}
Aggregations