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