comparison tests/test-exchange-obsmarkers-case-B4.t @ 31916:4a4fa665e1b4

obsolescence: add test case B-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 case B4: Pruned changeset on common part of history 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:47:16 +0200
parents
children
comparison
equal deleted inserted replaced
31915:ba7e226291f2 31916:4a4fa665e1b4
1 ============================================
2 Testing obsolescence markers push: Cases B.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 B: pruning case
13 TestCase 4: Pruned changeset on common part of the history
14 Variants:
15 # a: explicite push
16 # b: bare push
17
18 B.4 Pruned changeset on common part of history
19 =============================================
20
21 .. {{{
22 .. ⊗ C
23 .. | ● B
24 .. | |
25 .. | ● A
26 .. |/
27 .. ● O
28 .. }}}
29 ..
30 .. Marker exist from:
31 ..
32 .. * C (prune)
33 ..
34 .. Command run:
35 ..
36 .. * hg push -r B
37 .. * hg push
38 ..
39 .. Expected exchange:
40 ..
41 .. * prune for C
42
43 Setup
44 -----
45
46 $ . $TESTDIR/testlib/exchange-obsmarker-util.sh
47
48 initial
49
50 $ setuprepos B.4
51 creating test repo for test case B.4
52 - pulldest
53 - main
54 - pushdest
55 cd into `main` and proceed with env setup
56 $ cd main
57 $ mkcommit A
58 $ mkcommit B
59 $ hg phase --public .
60 $ hg push ../pushdest
61 pushing to ../pushdest
62 searching for changes
63 remote: adding changesets
64 remote: adding manifests
65 remote: adding file changes
66 remote: added 2 changesets with 2 changes to 2 files
67 $ hg push ../pulldest
68 pushing to ../pulldest
69 searching for changes
70 remote: adding changesets
71 remote: adding manifests
72 remote: adding file changes
73 remote: added 2 changesets with 2 changes to 2 files
74 $ hg update -q 0
75 $ mkcommit C
76 created new head
77 $ hg prune -qd '0 0' .
78 $ hg log -G --hidden
79 x 7f7f229b13a6 (draft): C
80 |
81 | o f6fbb35d8ac9 (public): B
82 | |
83 | o f5bc6836db60 (public): A
84 |/
85 @ a9bdc8b26820 (public): O
86
87 $ inspect_obsmarkers
88 obsstore content
89 ================
90 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
91 $ cd ..
92 $ cd ..
93
94 $ cp -R B.4 B.4.a
95 $ cp -R B.4 B.4.b
96
97 Actual Test (explicit push version)
98 -----------------------------------
99
100 $ dotest B.4.a O
101 ## Running testcase B.4.a
102 # testing echange of "O" (a9bdc8b26820)
103 ## initial state
104 # obstore: main
105 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
106 # obstore: pushdest
107 # obstore: pulldest
108 ## pushing "O" from main to pushdest
109 pushing to pushdest
110 searching for changes
111 no changes found
112 remote: 1 new obsolescence markers
113 ## post push state
114 # obstore: main
115 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
116 # obstore: pushdest
117 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
118 # obstore: pulldest
119 ## pulling "a9bdc8b26820" from main into pulldest
120 pulling from main
121 no changes found
122 1 new obsolescence markers
123 ## post pull state
124 # obstore: main
125 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
126 # obstore: pushdest
127 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
128 # obstore: pulldest
129 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
130
131 Actual Test (bare push version)
132 -----------------------------------
133
134 $ dotest B.4.b
135 ## Running testcase B.4.b
136 ## initial state
137 # obstore: main
138 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
139 # obstore: pushdest
140 # obstore: pulldest
141 ## pushing from main to pushdest
142 pushing to pushdest
143 searching for changes
144 no changes found
145 remote: 1 new obsolescence markers
146 ## post push state
147 # obstore: main
148 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
149 # obstore: pushdest
150 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
151 # obstore: pulldest
152 ## pulling from main into pulldest
153 pulling from main
154 searching for changes
155 no changes found
156 1 new obsolescence markers
157 ## post pull state
158 # obstore: main
159 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
160 # obstore: pushdest
161 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
162 # obstore: pulldest
163 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}