comparison tests/test-exchange-obsmarkers-case-C2.t @ 31966:8b98acaefc55

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