comparison tests/test-exchange-obsmarkers-case-A3.t @ 31908:db931f75c374

obsolescence: add test case A-3 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 A3: new branchs created, one pushed 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:42:49 +0200
parents
children 53b3a1968aa6
comparison
equal deleted inserted replaced
31907:fb8c3bc27e87 31908:db931f75c374
1 ============================================
2 Testing obsolescence markers push: Cases A.3
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 A: simple cases
13 TestCase 3: old branch split in two, only one of the new one pushed
14 Variants:
15 # a: changesets are known on remote
16 # b: changesets are known on remote (push needs -f)
17
18 A.3 new branchs created, one pushed.
19 ====================================
20
21 .. {{{
22 .. B' ○⇢ø B
23 .. | |
24 .. \Aø⇠◔ A'
25 .. \|/
26 .. ● O
27 .. }}}
28 ..
29 .. Markers exist from:
30 ..
31 .. * `A ø⇠○ A'`
32 .. * `B ø⇠○ B'`
33 ..
34 .. Command runs:
35 ..
36 .. * hg push -r A
37 ..
38 .. Expected exchange:
39 ..
40 .. * chain from A
41 ..
42 .. Expected exclude:
43 ..
44 .. * chain from B
45 ..
46 .. Extra note:
47 ..
48 .. If A and B are remontly known, we should expect:
49 ..
50 .. * `hg push` will complain about the new head
51 .. * `hg push` should complain about unstable history creation
52
53 Setup
54 -----
55
56 $ . $TESTDIR/testlib/exchange-obsmarker-util.sh
57
58 initial
59
60 $ setuprepos A.3.a
61 creating test repo for test case A.3.a
62 - pulldest
63 - main
64 - pushdest
65 cd into `main` and proceed with env setup
66 $ cd main
67 $ mkcommit A0
68 $ mkcommit B0
69 $ hg update -q 0
70 $ mkcommit A1
71 created new head
72 $ hg update -q 0
73 $ mkcommit B1
74 created new head
75 $ hg debugobsolete `getid 'desc(A0)'` `getid 'desc(A1)'`
76 $ hg debugobsolete `getid 'desc(B0)'` `getid 'desc(B1)'`
77 $ hg log -G --hidden
78 @ f6298a8ac3a4 (draft): B1
79 |
80 | o e5ea8f9c7314 (draft): A1
81 |/
82 | x 6e72f0a95b5e (draft): B0
83 | |
84 | x 28b51eb45704 (draft): A0
85 |/
86 o a9bdc8b26820 (public): O
87
88 $ inspect_obsmarkers
89 obsstore content
90 ================
91 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
92 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
93 $ cd ..
94 $ cd ..
95
96 Actual Test for first version (changeset unknown in remote)
97 -----------------------------------------------------------
98
99 $ dotest A.3.a A1
100 ## Running testcase A.3.a
101 # testing echange of "A1" (e5ea8f9c7314)
102 ## initial state
103 # obstore: main
104 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
105 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
106 # obstore: pushdest
107 # obstore: pulldest
108 ## pushing "A1" from main to pushdest
109 pushing to pushdest
110 searching for changes
111 remote: adding changesets
112 remote: adding manifests
113 remote: adding file changes
114 remote: added 1 changesets with 1 changes to 1 files
115 remote: 1 new obsolescence markers
116 ## post push state
117 # obstore: main
118 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
119 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
120 # obstore: pushdest
121 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
122 # obstore: pulldest
123 ## pulling "e5ea8f9c7314" from main into pulldest
124 pulling from main
125 searching for changes
126 adding changesets
127 adding manifests
128 adding file changes
129 added 1 changesets with 1 changes to 1 files
130 1 new obsolescence markers
131 (run 'hg update' to get a working copy)
132 ## post pull state
133 # obstore: main
134 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
135 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
136 # obstore: pushdest
137 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
138 # obstore: pulldest
139 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
140
141 other variant: changeset known in remote
142 ----------------------------------------
143
144 $ setuprepos A.3.b
145 creating test repo for test case A.3.b
146 - pulldest
147 - main
148 - pushdest
149 cd into `main` and proceed with env setup
150 $ cd main
151 $ mkcommit A0
152 $ mkcommit B0
153 $ hg push -q ../pushdest
154 $ hg push -q ../pulldest
155 $ hg update -q 0
156 $ mkcommit A1
157 created new head
158 $ hg update -q 0
159 $ mkcommit B1
160 created new head
161 $ hg debugobsolete `getid 'desc(A0)'` `getid 'desc(A1)'`
162 $ hg debugobsolete `getid 'desc(B0)'` `getid 'desc(B1)'`
163 $ hg log -G --hidden
164 @ f6298a8ac3a4 (draft): B1
165 |
166 | o e5ea8f9c7314 (draft): A1
167 |/
168 | x 6e72f0a95b5e (draft): B0
169 | |
170 | x 28b51eb45704 (draft): A0
171 |/
172 o a9bdc8b26820 (public): O
173
174 $ inspect_obsmarkers
175 obsstore content
176 ================
177 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
178 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
179 $ cd ..
180 $ cd ..
181
182 Actual Test for first version (changeset known in remote)
183 -----------------------------------------------------------
184
185 check it complains about multiple heads
186
187 $ cd A.3.b
188 $ hg push -R main -r 'desc(A1)' pushdest
189 pushing to pushdest
190 searching for changes
191 abort: push creates new remote head e5ea8f9c7314!
192 (merge or see 'hg help push' for details about pushing new heads)
193 [255]
194 $ cd ..
195
196 test obsmarkers exchange.
197
198 $ dotest A.3.b A1 -f
199 ## Running testcase A.3.b
200 # testing echange of "A1" (e5ea8f9c7314)
201 ## initial state
202 # obstore: main
203 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
204 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
205 # obstore: pushdest
206 # obstore: pulldest
207 ## pushing "A1" from main to pushdest
208 pushing to pushdest
209 searching for changes
210 remote: adding changesets
211 remote: adding manifests
212 remote: adding file changes
213 remote: added 1 changesets with 1 changes to 1 files (+1 heads)
214 remote: 1 new obsolescence markers
215 ## post push state
216 # obstore: main
217 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
218 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
219 # obstore: pushdest
220 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
221 # obstore: pulldest
222 ## pulling "e5ea8f9c7314" from main into pulldest
223 pulling from main
224 searching for changes
225 adding changesets
226 adding manifests
227 adding file changes
228 added 1 changesets with 1 changes to 1 files (+1 heads)
229 1 new obsolescence markers
230 (run 'hg heads' to see heads, 'hg merge' to merge)
231 ## post pull state
232 # obstore: main
233 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
234 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
235 # obstore: pushdest
236 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
237 # obstore: pulldest
238 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}