comparison tests/test-archive @ 2571:83cfd95eafb5

tests: add timeouts, make run-tests.py clean up dead daemon processes test timeout feature is needed for test with python 2.5 beta. if test does not complete in time (30 seconds is default), it is killed. some times daemon process used in test can be alive after the test is killed by user or by timeout. tests now record daemon pids into $DAEMON_PIDS and run-tests.py kills all living daemons after every test. final little change is to add newline to end of pid file printed by "hg serve", else "cat hg.pid >> $DAEMON_FILES" gives garbage.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Thu, 06 Jul 2006 11:45:34 -0700
parents 76ff5efe8181
children
comparison
equal deleted inserted replaced
2570:2264b2b077a1 2571:83cfd95eafb5
15 hg commit -m 3 15 hg commit -m 3
16 echo "[web]" >> .hg/hgrc 16 echo "[web]" >> .hg/hgrc
17 echo "name = test-archive" >> .hg/hgrc 17 echo "name = test-archive" >> .hg/hgrc
18 echo "allow_archive = gz bz2, zip" >> .hg/hgrc 18 echo "allow_archive = gz bz2, zip" >> .hg/hgrc
19 hg serve -p 20059 -d --pid-file=hg.pid 19 hg serve -p 20059 -d --pid-file=hg.pid
20 cat hg.pid >> $DAEMON_PIDS
20 21
21 TIP=`hg id -v | cut -f1 -d' '` 22 TIP=`hg id -v | cut -f1 -d' '`
22 QTIP=`hg id -q` 23 QTIP=`hg id -q`
23 cat > getarchive.py <<EOF 24 cat > getarchive.py <<EOF
24 import sys, urllib2 25 import sys, urllib2
29 EOF 30 EOF
30 http_proxy= python getarchive.py "$TIP" gz | gunzip | tar tf - | sed "s/$QTIP/TIP/" 31 http_proxy= python getarchive.py "$TIP" gz | gunzip | tar tf - | sed "s/$QTIP/TIP/"
31 http_proxy= python getarchive.py "$TIP" bz2 | bunzip2 | tar tf - | sed "s/$QTIP/TIP/" 32 http_proxy= python getarchive.py "$TIP" bz2 | bunzip2 | tar tf - | sed "s/$QTIP/TIP/"
32 http_proxy= python getarchive.py "$TIP" zip > archive.zip 33 http_proxy= python getarchive.py "$TIP" zip > archive.zip
33 unzip -t archive.zip | sed "s/$QTIP/TIP/" 34 unzip -t archive.zip | sed "s/$QTIP/TIP/"
34
35 kill `cat hg.pid`
36 sleep 1 # wait for server to scream and die
37 35
38 hg archive -t tar test.tar 36 hg archive -t tar test.tar
39 tar tf test.tar 37 tar tf test.tar
40 38
41 hg archive -t tbz2 -X baz test.tar.bz2 39 hg archive -t tbz2 -X baz test.tar.bz2