test: dont fail on githook symlinks

Since introducing git hooks, these tests fail locally because copytree
can't handle the relative symlinks. Add a helper for this common pattern
and set ignore_dangling_symlinks to safely skip these symlinks.

Signed-off-by: Caleb Connolly <kc@postmarketos.org>
Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230629-suffix-type-hint-v1-2-e92802ae20a8@postmarketos.org%3E
This commit is contained in:
Caleb Connolly 2023-07-12 23:09:08 +01:00 committed by Oliver Smith
parent 1a00c04f74
commit d32be64820
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
5 changed files with 15 additions and 8 deletions

View file

@ -4,10 +4,10 @@
import glob
import os
import pytest
import shutil
import sys
import pmb_test # noqa
import pmb_test.git
import pmb.helpers.pkgrel_bump
import pmb.helpers.logging
@ -39,7 +39,7 @@ def pmbootstrap(args, tmpdir, parameters, zero_exit=True):
# Copy .git dir to fake pmaports
dot_git = tmpdir + "/_aports/.git"
if not os.path.exists(dot_git):
shutil.copytree(args.aports + "/.git", dot_git)
pmb_test.git.copy_dotgit(args, aports)
try:
pmb.helpers.run.user(args, ["./pmbootstrap.py", "--work=" + tmpdir,