comparison tests/test-exchange-obsmarkers-case-C4.t @ 31968:02c696bb881c

obsolescence: add test case C-4 for obsolescence markers exchange About 3 years ago, in August 2014, the logic to select what markers to select on push was ported from the evolve extension to Mercurial core. However, for some unclear reasons, the tests for that logic were not ported alongside. I realised it a couple of weeks ago while working on another push related issue. I've made a clean up pass on the tests and they are now ready to integrate the core test suite. This series of changesets do not change any logic. I just adds test for logic that has been around for about 10 versions of Mercurial. They are a patch for each test case. It makes it easier to review and postpone one with documentation issues without rejecting the wholes series. This patch introduce C.4: multiple successors, one is pruned Each test case comes it in own test file. It help parallelism and does not introduce a significant overhead from having a single unified giant test file. Here are timing to support this claim. # Multiple test files version: # run-tests.py --local -j 1 test-exchange-*.t 53.40s user 6.82s system 85% cpu 1:10.76 total 52.79s user 6.97s system 85% cpu 1:09.97 total 52.94s user 6.82s system 85% cpu 1:09.69 total # Single test file version: # run-tests.py --local -j 1 test-exchange-obsmarkers.t 52.97s user 6.85s system 85% cpu 1:10.10 total 52.64s user 6.79s system 85% cpu 1:09.63 total 53.70s user 7.00s system 85% cpu 1:11.17 total
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Mon, 10 Apr 2017 16:53:12 +0200
parents
children b11e8c67fb0f
comparison
equal deleted inserted replaced
31967:9316d27c4b1a 31968:02c696bb881c
1 ============================================
2 Testing obsolescence markers push: Cases C.4
3 ============================================
4
5 Mercurial pushes obsolescences markers relevant to the "pushed-set", the set of
6 all changesets that requested to be "in sync" after the push (even if they are
7 already on both side).
8
9 This test belongs to a series of tests checking such set is properly computed
10 and applied. This does not tests "obsmarkers" discovery capabilities.
11
12 Category C: advanced case
13 TestCase 4: multiple successors, one is pruned
14
15 C.4 multiple successors, one is pruned
16 ======================================
17
18 .. (A similarish situation can appends with split markers see the Z section)
19 ..
20 .. {{{
21 .. A
22 .. B ○⇢ø⇠⊗ C
23 .. \|/
24 .. ● O
25 .. }}}
26 ..
27 .. Marker exist from:
28 ..
29 .. * `A ø⇠○ B`
30 .. * `A ø⇠○ C`
31 .. * C (prune)
32 ..
33 .. Command run:
34 ..
35 .. * hg push -r O
36 ..
37 .. Expected exchange:
38 ..
39 .. * `A ø⇠○ C`
40 .. * C (prune)
41 ..
42 .. Expected exclude:
43 ..
44 .. * `A ø⇠○ B`
45
46 Setup
47 -----
48
49 $ . $TESTDIR/testlib/exchange-obsmarker-util.sh
50
51 Implemented as the non-split version
52
53 $ setuprepos C.4
54 creating test repo for test case C.4
55 - pulldest
56 - main
57 - pushdest
58 cd into `main` and proceed with env setup
59 $ cd main
60 $ mkcommit A
61 $ hg update -q 0
62 $ mkcommit B
63 created new head
64 $ hg update -q 0
65 $ mkcommit C
66 created new head
67 $ hg debugobsolete --hidden `getid 'desc(A)'` `getid 'desc(B)'`
68 $ hg debugobsolete --hidden `getid 'desc(A)'` `getid 'desc(C)'`
69 $ hg prune -qd '0 0' .
70 $ hg log -G --hidden
71 x 7f7f229b13a6 (draft): C
72 |
73 | o 35b183996678 (draft): B
74 |/
75 | x f5bc6836db60 (draft): A
76 |/
77 @ a9bdc8b26820 (public): O
78
79 $ inspect_obsmarkers
80 obsstore content
81 ================
82 f5bc6836db60e308a17ba08bf050154ba9c4fad7 35b1839966785d5703a01607229eea932db42f87 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
83 f5bc6836db60e308a17ba08bf050154ba9c4fad7 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
84 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
85 $ cd ..
86 $ cd ..
87
88 Actual Test
89 -----------
90
91 $ dotest C.4 O
92 ## Running testcase C.4
93 # testing echange of "O" (a9bdc8b26820)
94 ## initial state
95 # obstore: main
96 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
97 f5bc6836db60e308a17ba08bf050154ba9c4fad7 35b1839966785d5703a01607229eea932db42f87 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
98 f5bc6836db60e308a17ba08bf050154ba9c4fad7 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
99 # obstore: pushdest
100 # obstore: pulldest
101 ## pushing "O" from main to pushdest
102 pushing to pushdest
103 searching for changes
104 no changes found
105 remote: 2 new obsolescence markers
106 ## post push state
107 # obstore: main
108 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
109 f5bc6836db60e308a17ba08bf050154ba9c4fad7 35b1839966785d5703a01607229eea932db42f87 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
110 f5bc6836db60e308a17ba08bf050154ba9c4fad7 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
111 # obstore: pushdest
112 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
113 f5bc6836db60e308a17ba08bf050154ba9c4fad7 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
114 # obstore: pulldest
115 ## pulling "a9bdc8b26820" from main into pulldest
116 pulling from main
117 no changes found
118 2 new obsolescence markers
119 ## post pull state
120 # obstore: main
121 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
122 f5bc6836db60e308a17ba08bf050154ba9c4fad7 35b1839966785d5703a01607229eea932db42f87 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
123 f5bc6836db60e308a17ba08bf050154ba9c4fad7 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
124 # obstore: pushdest
125 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
126 f5bc6836db60e308a17ba08bf050154ba9c4fad7 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
127 # obstore: pulldest
128 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
129 f5bc6836db60e308a17ba08bf050154ba9c4fad7 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}