Skip to content

Commit 3d42836

Browse files
authored
chore(tests): check git lfs env instead of git lfs version (#1082)
1 parent e4446dc commit 3d42836

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

tests/agent.Tests.ps1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,12 @@ Describe "[$global:IMAGE_NAME] image has correct applications in the PATH" {
8383
}
8484

8585
It 'has git-lfs (and thus git) installed' {
86-
$exitCode, $stdout, $stderr = Run-Program 'docker' "exec $global:CONTAINERNAME $global:CONTAINERSHELL -C `"`& git lfs version`""
86+
$exitCode, $stdout, $stderr = Run-Program 'docker' "exec $global:CONTAINERNAME $global:CONTAINERSHELL -C `"`& git lfs env`""
8787
$exitCode | Should -Be 0
88-
$stdout.Trim() | Should -Match "git-lfs/${global:GITLFSVERSION}"
88+
$r = [regex] "^git-lfs/(?<version>\d+\.\d+\.\d+)"
89+
$m = $r.Match($stdout)
90+
$m | Should -Not -Be $null
91+
$m.Groups['version'].ToString() | Should -Be "$global:GITLFSVERSION"
8992
}
9093

9194
It 'does not include jenkins-agent.ps1 (inbound-agent)' {

tests/tests_agent.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ GIT_LFS_VERSION='3.7.1'
6363

6464
run docker exec "${cid}" sh -c "command -v git"
6565
assert_success
66-
run docker exec "${cid}" git lfs version
66+
run docker exec "${cid}" git lfs env
6767
assert_output --partial "${GIT_LFS_VERSION}"
6868

6969
run docker exec "${cid}" sh -c "printenv | grep AGENT_WORKDIR"

0 commit comments

Comments
 (0)