chiark / gitweb /
test suite: Save much stuff to $AUTOPKGTEST_ARTIFACTS.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 12 Jul 2018 11:57:32 +0000 (12:57 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 12 Jul 2018 12:44:42 +0000 (13:44 +0100)
We take some care to make this of reasonable size.  In particular,
we delete raw tarballs (typically, IMPORT) and .git's sample hooks.

And, we git gc the git trees.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
tests/lib

index 90b157c1ff47473042a0886673eb200f15946d03..dee2b95a0af2607e0b82d60ad039339dc98dc1da 100644 (file)
@@ -1,6 +1,7 @@
 dgit (5.9+exp1) experimental; urgency=medium
 
   * test suite: Use  dch -r -D sid ''  not  dch -r sid.  Closes:#903441.
+  * test suite: Save much stuff to $AUTOPKGTEST_ARTIFACTS.
 
  --
 
index e06ae224b56ce409032f93c765e241b63bfe8ed7..87dd37617e7f6769a8eb42657e745ecf7af9b177 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -17,6 +17,8 @@ funcs: ${FUNCNAME[*]}
 lines: ${BASH_LINENO[*]}
 files: ${BASH_SOURCE[*]}
 END
+       t-save-artifacts
+
        exit 16
 }
 
@@ -409,9 +411,31 @@ t-fscks () {
 t-ok () {
        : '========================================'
        t-fscks
+       t-save-artifacts
        echo ok.
 }
 
+t-save-artifacts () {
+       artifacts="$AUTOPKGTEST_ARTIFACTS"
+       if [ x"$artifacts" = x ]; then return; fi
+       if [ x"tmp" = x ]; then return; fi
+       : '(((((((((( t-save-artifacts ))))))))))'
+       cp -a "$tmp"/. "$artifacts"/.
+       cd "$artifacts"/.
+       find . \( -name \*.tar -o -name \*.sample \) -print0 | \
+               xargs -0r rm -v
+       find . \( -name .git \
+               -o -path ./salsa/\* \
+               -o -path ./git/\*.git \
+               \) -type d \
+               \! -path '*/.git/*/.git' -exec sh -xec '
+                       cd "$1"
+                       "$2"/playtree-save-refs
+                       git gc --prune=all
+               ' x '{}' "$troot" \;
+       : ')))))))))) t-save-artifacts ))))))))))'
+}
+
 t-rm-dput-dropping () {
        rm -f $tmp/${p}_${v}_*.upload
 }