test: more .git cleanup (#12238)

Co-authored-by: Mac Malone <mac@lean-fro.org>
This commit is contained in:
Sebastian Ullrich 2026-01-29 18:43:31 +01:00 committed by GitHub
parent 5b0b365406
commit 2b2b72d113
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 13 additions and 25 deletions

View file

@ -6,20 +6,13 @@ source ../common.sh
# Test Lake's management of a single Git-cloned dependency.
echo "# SETUP"
set -x
mkdir hello
pushd hello
$LAKE init hello
rm -f lean-toolchain
$LAKE update
git init
git checkout -b master
git config user.name test
git config user.email test@example.com
git add --all
git commit -m "initial commit"
init_git
popd
set +x
HELLO_MAP="{\"hello\" : \"file://$(pwd)/hello\"}"
@ -74,4 +67,5 @@ git -C .lake/packages/hello remote set-url origin $TEST_URL
LAKE_PKG_URL_MAP=$TEST_MAP test_no_warn build
# Cleanup
rm -rf hello/.git
rm -f produced.out

View file

@ -7,17 +7,10 @@ source ../common.sh
# We reinitialize the bar repository on each test. This requires updating the
# locked manifest to the new hash to ensure things work properly.
echo "# SETUP"
set -x
pushd bar
git init
git checkout -b master
git config user.name test
git config user.email test@example.com
git add --all
git commit -m "initial commit"
init_git
GIT_REV=`git rev-parse HEAD`
popd
set +x
LOCKED_REV='0538596b94a0510f55dc820cabd3bde41ad93c3e'
@ -62,4 +55,5 @@ test_manifest v1.0.0
test_manifest v1.1.0
# cleanup
rm -rf bar/.git
rm -f produced.out

View file

@ -6,16 +6,9 @@ source ../common.sh
# Since committing a Git repository to a Git repository is not well-supported,
# We reinitialize the `bar1` repository on each test.
echo "# SETUP"
set -x
pushd bar1
git init
git checkout -b master
git config user.name test
git config user.email test@example.com
git add --all
git commit -m "initial commit"
init_git
popd
set +x
# Test the functionality of package overrides
@ -41,4 +34,5 @@ test_out "bar2" exe bar
test_out "foo" exe foo
# Cleanup
rm -rf bar1/.git
rm -f produced.out

View file

@ -68,7 +68,7 @@ popd
# Main tests
# ---
cd DiamondExample-D
pushd DiamondExample-D
# Test build succeeds on v1
git switch v1 --detach
@ -83,3 +83,9 @@ sed_i '/name/ s/A/A-v1/' .lake/packages/DiamondExample-B/lakefile.toml
sed_i '/name/ s/A/A-v2/' .lake/packages/DiamondExample-C/lakefile.toml
test_run update
test_err 'could not disambiguate the module `DiamondExampleA.Ring.Lemmas`' build
popd
# Cleanup
rm -rf DiamondExample-*/.git
rm -f produced.out