Skip to content

Commit 83d1efe

Browse files
szedergitster
authored andcommitted
travis-ci: fix running P4 and Git LFS tests in Linux build jobs
Linux build jobs on Travis CI skip the P4 and Git LFS tests since commit 657343a (travis-ci: move Travis CI code into dedicated scripts, 2017-09-10), claiming there are no P4 or Git LFS installed. The reason is that P4 and Git LFS binaries are not installed to a directory in the default $PATH, but their directories are prepended to $PATH. This worked just fine before said commit, because $PATH was set in a scriptlet embedded in our '.travis.yml', thus its new value was visible during the rest of the build job. However, after these embedded scriptlets were moved into dedicated scripts executed in separate shell processes, any variable set in one of those scripts is only visible in that single script but not in any of the others. In this case, 'ci/install-dependencies.sh' downloads P4 and Git LFS and modifies $PATH, but to no effect, because 'ci/run-tests.sh' only sees Travis CI's default $PATH. Move adjusting $PATH to 'ci/lib-travisci.sh', which is sourced in all other 'ci/' scripts, so all those scripts will see the updated $PATH value. Signed-off-by: SZEDER Gábor <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8376eb4 commit 83d1efe

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

ci/install-dependencies.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,18 @@ case "${TRAVIS_OS_NAME:-linux}" in
1212
linux)
1313
export GIT_TEST_HTTPD=YesPlease
1414

15-
mkdir --parents custom/p4
16-
pushd custom/p4
15+
mkdir --parents "$P4_PATH"
16+
pushd "$P4_PATH"
1717
wget --quiet "$P4WHENCE/bin.linux26x86_64/p4d"
1818
wget --quiet "$P4WHENCE/bin.linux26x86_64/p4"
1919
chmod u+x p4d
2020
chmod u+x p4
21-
export PATH="$(pwd):$PATH"
2221
popd
23-
mkdir --parents custom/git-lfs
24-
pushd custom/git-lfs
22+
mkdir --parents "$GIT_LFS_PATH"
23+
pushd "$GIT_LFS_PATH"
2524
wget --quiet "$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
2625
tar --extract --gunzip --file "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
2726
cp git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs .
28-
export PATH="$(pwd):$PATH"
2927
popd
3028
;;
3129
osx)

ci/lib-travisci.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,11 @@ skip_branch_tip_with_tag () {
2626
set -e
2727

2828
skip_branch_tip_with_tag
29+
30+
case "${TRAVIS_OS_NAME:-linux}" in
31+
linux)
32+
P4_PATH="$(pwd)/custom/p4"
33+
GIT_LFS_PATH="$(pwd)/custom/git-lfs"
34+
export PATH="$GIT_LFS_PATH:$P4_PATH:$PATH"
35+
;;
36+
esac

0 commit comments

Comments
 (0)