test: generate the `test-sparse-revlog` artifact when slow-test is allowed
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sun, 24 Feb 2019 19:55:20 +0100
changeset 41810 090a41251f09
parent 41809 4cbccb50df46
child 41811 118c1ec4f31b
test: generate the `test-sparse-revlog` artifact when slow-test is allowed The `test-sparse-revlog.t` logic requires a large bundle to be generated. This bundle can be reused from one run to the next but its initial generation is slow. With this patch, if the bundle is missing and slow tests are permitted, the bundle will be generated during the test run. This should ensure that CI run this test.
tests/test-sparse-revlog.t
--- a/tests/test-sparse-revlog.t	Sun Feb 24 19:56:23 2019 +0100
+++ b/tests/test-sparse-revlog.t	Sun Feb 24 19:55:20 2019 +0100
@@ -12,10 +12,22 @@
   $ bundlepath="$TESTDIR/artifacts/cache/big-file-churn.hg"
 
   $ 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"'