Skip to content

Commit c591ff7

Browse files
committed
appveyor.yml: ensure tests are functional on Windows
1 parent 9afae6f commit c591ff7

File tree

4 files changed

+37
-18
lines changed

4 files changed

+37
-18
lines changed

appveyor.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
1+
image: Visual Studio 2017
2+
13
skip_branch_with_pr: true
24

35
environment:
6+
GIT_LFS_NO_TEST_COUNT: 1
47
GOPATH: $(HOMEDRIVE)$(HOMEPATH)\go
58
MSYSTEM: MINGW64
69

710
clone_folder: $(GOPATH)\src\github.com\git-lfs\git-lfs
811

912
install:
1013
- rd C:\Go /s /q
14+
- rd C:\Perl /s /q
15+
- refreshenv
1116
- cinst golang --version 1.8.3 -y
1217
- cinst InnoSetup -y
18+
- cinst strawberryperl -y
19+
- refreshenv
1320
- cinst make
14-
- cpan App::cpanminus
15-
- cpanm TAP::Harness::Env
1621
- refreshenv
1722
- ps: |
1823
echo "Go directories in machine PATH environment:"

script/cibuild

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,15 @@ pushd t >/dev/null
1212
if [[ $UNAME == MINGW* || $UNAME == MSYS* || $UNAME == CYGWIN* ]]; then
1313
X=".exe"
1414
fi
15-
VERBOSE_LOGS=1 make X="$X" clean && make X="$X" PROVE_EXTRA_ARGS=-j9
15+
16+
PROVE="prove"
17+
PROVE_EXTRA_ARGS="-j9"
18+
if [ -n "$APPVEYOR" ]; then
19+
export PATH="/c/Strawberry/perl/bin:.:$PATH"
20+
PROVE="prove.bat"
21+
PROVE_EXTRA_ARGS="$PROVE_EXTRA_ARGS --exec bash"
22+
fi
23+
24+
VERBOSE_LOGS=1 make X="$X" clean
25+
VERBOSE_LOGS=1 make X="$X" PROVE="$PROVE" PROVE_EXTRA_ARGS="$PROVE_EXTRA_ARGS"
1626
popd >/dev/null

t/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ all : $(DEFAULT_TEST_TARGET)
2323

2424
test : $(TEST_CMDS)
2525
$(RM) -r remote test_count{,.lock}
26-
bash -c '. ./testenv.sh && setup'
27-
prove $(PROVE_EXTRA_ARGS) ./t-*.sh
28-
bash -c '. ./testenv.sh && shutdown'
26+
@GIT_LFS_NO_TEST_COUNT= bash -c '. ./testenv.sh && setup'
27+
$(PROVE) $(PROVE_EXTRA_ARGS) ./t-*.sh
28+
@GIT_LFS_NO_TEST_COUNT= bash -c '. ./testenv.sh && shutdown'
2929

3030
./t-%.sh : $(TEST_CMDS)
3131
$(RM) -r remote test_count{,.lock}
32-
prove -v $(PROVE_EXTRA_ARGS) $@
32+
$(PROVE) -v $(PROVE_EXTRA_ARGS) $@
3333

3434
.PHONY : clean
3535
clean :

t/testhelpers.sh

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -505,14 +505,16 @@ setup() {
505505
git lfs version | sed -e 's/^/# /g'
506506
git version | sed -e 's/^/# /g'
507507

508-
LFSTEST_URL="$LFS_URL_FILE" \
509-
LFSTEST_SSL_URL="$LFS_SSL_URL_FILE" \
510-
LFSTEST_CLIENT_CERT_URL="$LFS_CLIENT_CERT_URL_FILE" \
511-
LFSTEST_DIR="$REMOTEDIR" \
512-
LFSTEST_CERT="$LFS_CERT_FILE" \
513-
LFSTEST_CLIENT_CERT="$LFS_CLIENT_CERT_FILE" \
514-
LFSTEST_CLIENT_KEY="$LFS_CLIENT_KEY_FILE" \
515-
lfstest-count-tests increment
508+
if [ -z "$GIT_LFS_NO_TEST_COUNT" ]; then
509+
LFSTEST_URL="$LFS_URL_FILE" \
510+
LFSTEST_SSL_URL="$LFS_SSL_URL_FILE" \
511+
LFSTEST_CLIENT_CERT_URL="$LFS_CLIENT_CERT_URL_FILE" \
512+
LFSTEST_DIR="$REMOTEDIR" \
513+
LFSTEST_CERT="$LFS_CERT_FILE" \
514+
LFSTEST_CLIENT_CERT="$LFS_CLIENT_CERT_FILE" \
515+
LFSTEST_CLIENT_KEY="$LFS_CLIENT_KEY_FILE" \
516+
lfstest-count-tests increment
517+
fi
516518

517519
wait_for_file "$LFS_URL_FILE"
518520
wait_for_file "$LFS_SSL_URL_FILE"
@@ -564,9 +566,11 @@ shutdown() {
564566
# every t/t-*.sh file should cleanup its trashdir
565567
[ -z "$KEEPTRASH" ] && rm -rf "$TRASHDIR"
566568

567-
LFSTEST_DIR="$REMOTEDIR" \
568-
LFS_URL_FILE="$LFS_URL_FILE" \
569-
lfstest-count-tests decrement
569+
if [ -z "$GIT_LFS_NO_TEST_COUNT" ]; then
570+
LFSTEST_DIR="$REMOTEDIR" \
571+
LFS_URL_FILE="$LFS_URL_FILE" \
572+
lfstest-count-tests decrement
573+
fi
570574
}
571575

572576
tap_show_plan() {

0 commit comments

Comments
 (0)