diff tests/test-sparse-revlog.t @ 52440:24c3b3dbab08

test-sparse-revlog: make the large bundle generation more robust and useful We do the following: - adding a `--lazy` flag that skip the bundle generation if it already has the right content. - adding a `--validate` flag that make sure the generated bundle match the expected content Generate it on the fly with all this flag during the tests.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 04 Dec 2024 15:05:56 +0100
parents 9feb175c028d
children db85e2aaf66e
line wrap: on
line diff
--- a/tests/test-sparse-revlog.t	Wed Dec 04 05:29:28 2024 +0100
+++ b/tests/test-sparse-revlog.t	Wed Dec 04 15:05:56 2024 +0100
@@ -11,28 +11,32 @@
 
   $ bundlepath="$TESTDIR/artifacts/cache/big-file-churn.hg"
 
+#if pure
   $ expectedhash=`cat "$bundlepath".md5`
-
-#if slow
-
-  $ if [ ! -f "$bundlepath" ]; then
-  >     "$TESTDIR"/artifacts/scripts/generate-churning-bundle.py > /dev/null
-  > fi
-
-#else
-
   $ if [ ! -f "$bundlepath" ]; then
   >     echo 'skipped: missing artifact, run "'"$TESTDIR"'/artifacts/scripts/generate-churning-bundle.py"'
   >     exit 80
   > fi
-
-#endif
-
   $ currenthash=`f -M "$bundlepath" | cut -d = -f 2`
   $ if [ "$currenthash" != "$expectedhash" ]; then
   >     echo 'skipped: outdated artifact, md5 "'"$currenthash"'" expected "'"$expectedhash"'" run "'"$TESTDIR"'/artifacts/scripts/generate-churning-bundle.py"'
   >     exit 80
   > fi
+#else
+
+#if slow
+  $ LAZY_GEN=""
+
+#else
+  $ LAZY_GEN="--lazy"
+#endif
+
+#endif
+
+If the validation fails, either something is broken or the expected md5 need updating.
+To update the md5, invoke the script without --validate
+
+  $ "$TESTDIR"/artifacts/scripts/generate-churning-bundle.py --validate $LAZY_GEN > /dev/null
 
   $ cat >> $HGRCPATH << EOF
   > [format]