diff --git a/build.ps1 b/build.ps1 index e32a2098f..1cac8f232 100644 --- a/build.ps1 +++ b/build.ps1 @@ -16,7 +16,7 @@ Param( # Print the build and publish command instead of executing them if set [switch] $DryRun = $false, # Output debug info for tests: 'empty' (no additional test output), 'debug' (test cmd & stderr outputed), 'verbose' (test cmd, stderr, stdout outputed) - [String] $TestsDebug = '' + [String] $TestsDebug = 'verbose' ) $ErrorActionPreference = 'Stop' diff --git a/tests/agent.Tests.ps1 b/tests/agent.Tests.ps1 index d225c86b1..bcf99a75d 100644 --- a/tests/agent.Tests.ps1 +++ b/tests/agent.Tests.ps1 @@ -83,11 +83,18 @@ Describe "[$global:IMAGE_NAME] image has correct applications in the PATH" { } It 'has git-lfs (and thus git) installed' { - $exitCode, $stdout, $stderr = Run-Program 'docker' "exec $global:CONTAINERNAME $global:CONTAINERSHELL -C `"`& git lfs version`"" + $exitCode, $stdout, $stderr = Run-Program 'docker' "exec $global:CONTAINERNAME $global:CONTAINERSHELL -C `"`$global:GIT_LFS_VERSION = git lfs version 2>&1 ; Write-Host `$global:GIT_LFS_VERSION`"" $exitCode | Should -Be 0 $stdout.Trim() | Should -Match "git-lfs/${global:GITLFSVERSION}" } + It 'can use git with a long path' { + $longPath = 'C:\source\temp\' + ('a' * 260) + '\repo' + $repository = 'https://github.com/jenkinsci/pipeline-model-definition-plugin.git' + $exitCode, $stdout, $stderr = Run-Program 'docker' "exec $global:CONTAINERNAME $global:CONTAINERSHELL -C `"New-Item -ItemType Directory -Path ${longPath} ; cd ${longPath} ; & git init ; & git remote add origin $repository ; & git fetch origin ; & git checkout master`"" + $exitCode | Should -Be 0 + } + It 'does not include jenkins-agent.ps1 (inbound-agent)' { $exitCode, $stdout, $stderr = Run-Program 'docker' "exec $global:CONTAINERNAME $global:CONTAINERSHELL -C `"if (Test-Path C:/ProgramData/Jenkins/jenkins-agent.ps1) { exit -1 } else { exit 0 }`"" $exitCode | Should -Be 0