#!/bin/sh
# Run upstream's integration tests in t/ against the installed git-lfs.
set -eu

gopath="$AUTOPKGTEST_TMP/gopath"
src="$gopath/src/github.com/git-lfs/git-lfs"
mkdir -p "$(dirname "$src")"
cp -a . "$src"
cd "$src"

# The helper commands in t/cmd import the git-lfs packages from the source
# tree and their dependencies from the installed -dev packages.
export GOPATH="$gopath:/usr/share/gocode"
export GO111MODULE=off
export GOCACHE="$AUTOPKGTEST_TMP/go-cache"

# git-lfs-transfer (scutiger) is not in Debian. Skip its tests even when CI is
# set, which would otherwise turn the skip into a failure.
export TEST_SKIP_LFS_TRANSFER=1

mkdir -p bin
ln -s /usr/bin/git-lfs bin/git-lfs

# parallel tests are flaky in bookworm, running sequentially
#make -C t test PROVE_EXTRA_ARGS="-j$(nproc)"
make -C t test
