Mercurial > hg
view tests/test-churn.t @ 21424:d13b4ecdb680
test: split test-largefile.t in multiple file
The `test-largefiles.t` unified test is significantly longer (about 30%) than
any other tests in the mercurial test suite. As a result, its is alway the last
test my test runner is waiting for at the end of a run.
In practice, this means that `test-largefile.t` is wasting half a minute of my
life every times I'm running the mercurial test suites. This probably mean more
a few cumulated day by now.
I've finally decided to split it up in multiple smaller tests to bring it back in
reasonable length.
This changeset extracts independent test cases in two files. One dedicated to
wire protocole testing, and another one dedicated to all other tests that could
be independently extracted.
No test case were haltered in the making of this changeset.
Various timing available below. All timing have been done on a with 90 jobs on a
64 cores machine. Similar result are shown on firefly (20 jobs on 12 core).
General timing of the whole run
--------------------------------
We see a 25% real time improvement for no significant cpu time impact.
Before split:
real 2m1.149s
user 58m4.662s
sys 11m28.563s
After split:
real 1m31.977s
user 57m45.993s
sys 11m33.634s
Last test to finish (using run-test.py --time)
----------------------------------------------
test-largefile.t is now finishing at the same time than other slow tests.
Before split:
Time Test
119.280 test-largefiles.t
93.995 test-mq.t
89.897 test-subrepo.t
86.920 test-glog.t
85.508 test-rename-merge2.t
83.594 test-revset.t
79.824 test-keyword.t
78.077 test-mq-header-date.t
After split:
Time Test
90.414 test-mq.t
88.594 test-largefiles.t
85.363 test-subrepo.t
81.059 test-glog.t
78.927 test-rename-merge2.t
78.021 test-revset.t
77.777 test-command-template.t
Timing of largefile test themself
-----------------------------------
Running only tests prefixed with "test-largefiles".
No significant change in cumulated time.
Before:
Time Test
58.673 test-largefiles.t
2.931 test-largefiles-cache.t
0.583 test-largefiles-small-disk.t
After:
Time Test
31.754 test-largefiles.t
17.460 test-largefiles-misc.t
8.888 test-largefiles-wireproto.t
2.864 test-largefiles-cache.t
0.580 test-largefiles-small-disk.t
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Fri, 16 May 2014 13:18:57 -0700 |
parents | 9846b40d01e7 |
children | 73b3218bb078 |
line wrap: on
line source
$ echo "[extensions]" >> $HGRCPATH $ echo "churn=" >> $HGRCPATH create test repository $ hg init repo $ cd repo $ echo a > a $ hg ci -Am adda -u user1 -d 6:00 adding a $ echo b >> a $ echo b > b $ hg ci -m changeba -u user2 -d 9:00 a $ hg ci -Am addb -u user2 -d 9:30 adding b $ echo c >> a $ echo c >> b $ echo c > c $ hg ci -m changeca -u user3 -d 12:00 a $ hg ci -m changecb -u user3 -d 12:15 b $ hg ci -Am addc -u user3 -d 12:30 adding c $ mkdir -p d/e $ echo abc > d/e/f1.txt $ hg ci -Am "add d/e/f1.txt" -u user1 -d 12:45 d/e/f1.txt $ mkdir -p d/g $ echo def > d/g/f2.txt $ hg ci -Am "add d/g/f2.txt" -u user1 -d 13:00 d/g/f2.txt churn separate directories $ cd d $ hg churn e user1 1 *************************************************************** churn all $ hg churn user1 3 *************************************************************** user3 3 *************************************************************** user2 2 ****************************************** churn excluding one dir $ hg churn -X e user3 3 *************************************************************** user1 2 ****************************************** user2 2 ****************************************** churn up to rev 2 $ hg churn -r :2 user2 2 *************************************************************** user1 1 ******************************** $ cd .. churn with aliases $ cat > ../aliases <<EOF > user1 alias1 > user3 alias3 > not-an-alias > EOF churn with .hgchurn $ mv ../aliases .hgchurn $ hg churn skipping malformed alias: not-an-alias alias1 3 ************************************************************** alias3 3 ************************************************************** user2 2 ***************************************** $ rm .hgchurn churn with column specifier $ COLUMNS=40 hg churn user1 3 *********************** user3 3 *********************** user2 2 *************** churn by hour $ hg churn -f '%H' -s 06 1 ***************** 09 2 ********************************* 12 4 ****************************************************************** 13 1 ***************** churn with separated added/removed lines $ hg rm d/g/f2.txt $ hg ci -Am "removed d/g/f2.txt" -u user1 -d 14:00 d/g/f2.txt $ hg churn --diffstat user1 +3/-1 +++++++++++++++++++++++++++++++++++++++++-------------- user3 +3/-0 +++++++++++++++++++++++++++++++++++++++++ user2 +2/-0 +++++++++++++++++++++++++++ churn --diffstat with color $ hg --config extensions.color= churn --config color.mode=ansi \ > --diffstat --color=always user1 +3/-1 \x1b[0;32m+++++++++++++++++++++++++++++++++++++++++\x1b[0m\x1b[0;31m--------------\x1b[0m (esc) user3 +3/-0 \x1b[0;32m+++++++++++++++++++++++++++++++++++++++++\x1b[0m (esc) user2 +2/-0 \x1b[0;32m+++++++++++++++++++++++++++\x1b[0m (esc) changeset number churn $ hg churn -c user1 4 *************************************************************** user3 3 *********************************************** user2 2 ******************************** $ echo 'with space = no-space' >> ../aliases $ echo a >> a $ hg commit -m a -u 'with space' -d 15:00 churn with space in alias $ hg churn --aliases ../aliases -r tip no-space 1 ************************************************************ $ cd .. Issue833: ZeroDivisionError $ hg init issue-833 $ cd issue-833 $ touch foo $ hg ci -Am foo adding foo this was failing with a ZeroDivisionError $ hg churn test 0 $ cd .. Ignore trailing or leading spaces in emails $ cd repo $ touch bar $ hg ci -Am'bar' -u 'user4 <user4@x.com>' adding bar $ touch foo $ hg ci -Am'foo' -u 'user4 < user4@x.com >' adding foo $ hg log -l2 --template '[{author|email}]\n' [ user4@x.com ] [user4@x.com] $ hg churn -c user1 4 ********************************************************* user3 3 ******************************************* user2 2 ***************************** user4@x.com 2 ***************************** with space 1 ************** Test multibyte sequences in names $ echo bar >> bar $ hg --encoding utf-8 ci -m'changed bar' -u 'El NiƱo <nino@x.com>' $ hg --encoding utf-8 churn -ct '{author|person}' user1 4 ********************************************************** user3 3 ******************************************** user2 2 ***************************** user4 2 ***************************** El Ni\xc3\xb1o 1 *************** (esc) with space 1 *************** $ cd ..