Mercurial > hg
comparison tests/test-exchange-obsmarkers-case-A4.t @ 31909:df0f18546e1e
obsolescence: add test case A-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 A-4: Push in the middle of the obsolescence chain
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:43:26 +0200 |
parents | |
children | b11e8c67fb0f |
comparison
equal
deleted
inserted
replaced
31908:db931f75c374 | 31909:df0f18546e1e |
---|---|
1 ============================================ | |
2 Testing obsolescence markers push: Cases A.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 A: simple cases | |
13 Testcase 4: Push in the middle of the obsolescence chain | |
14 | |
15 A.4 Push in the middle of the obsolescence chain | |
16 ================================================ | |
17 | |
18 .. (Where we show that we should not push the marker without the successors) | |
19 .. | |
20 .. {{{ | |
21 .. B ◔ | |
22 .. | | |
23 .. A⇠ø⇠○ A' | |
24 .. |/ | |
25 .. ● O | |
26 .. }}} | |
27 .. | |
28 .. Markers exist from: | |
29 .. | |
30 .. * `A ø⇠○ A'` | |
31 .. * chain from A | |
32 .. | |
33 .. Command runs: | |
34 .. | |
35 .. * hg push -r B | |
36 .. | |
37 .. Expected exchange: | |
38 .. | |
39 .. * Chain from A | |
40 .. | |
41 .. Expected Exclude: | |
42 .. | |
43 .. * `Ai ø⇠○ A'` | |
44 | |
45 Setup | |
46 ----- | |
47 | |
48 $ . $TESTDIR/testlib/exchange-obsmarker-util.sh | |
49 | |
50 initial | |
51 | |
52 $ setuprepos A.4 | |
53 creating test repo for test case A.4 | |
54 - pulldest | |
55 - main | |
56 - pushdest | |
57 cd into `main` and proceed with env setup | |
58 $ cd main | |
59 $ mkcommit A0 | |
60 $ mkcommit B | |
61 $ hg update 0 | |
62 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
63 $ mkcommit A1 | |
64 created new head | |
65 $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa `getid 'desc(A0)'` | |
66 $ hg debugobsolete `getid 'desc(A0)'` `getid 'desc(A1)'` | |
67 $ hg log -G --hidden | |
68 @ e5ea8f9c7314 (draft): A1 | |
69 | | |
70 | o 06055a7959d4 (draft): B | |
71 | | | |
72 | x 28b51eb45704 (draft): A0 | |
73 |/ | |
74 o a9bdc8b26820 (public): O | |
75 | |
76 $ inspect_obsmarkers | |
77 obsstore content | |
78 ================ | |
79 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
80 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
81 $ cd .. | |
82 $ cd .. | |
83 | |
84 Actual Test for first version | |
85 ----------------------------- | |
86 | |
87 $ dotest A.4 B -f | |
88 ## Running testcase A.4 | |
89 # testing echange of "B" (06055a7959d4) | |
90 ## initial state | |
91 # obstore: main | |
92 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
93 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
94 # obstore: pushdest | |
95 # obstore: pulldest | |
96 ## pushing "B" from main to pushdest | |
97 pushing to pushdest | |
98 searching for changes | |
99 remote: adding changesets | |
100 remote: adding manifests | |
101 remote: adding file changes | |
102 remote: added 2 changesets with 2 changes to 2 files | |
103 remote: 1 new obsolescence markers | |
104 ## post push state | |
105 # obstore: main | |
106 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
107 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
108 # obstore: pushdest | |
109 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
110 # obstore: pulldest | |
111 ## pulling "06055a7959d4" from main into pulldest | |
112 pulling from main | |
113 searching for changes | |
114 adding changesets | |
115 adding manifests | |
116 adding file changes | |
117 added 2 changesets with 2 changes to 2 files | |
118 1 new obsolescence markers | |
119 (run 'hg update' to get a working copy) | |
120 ## post pull state | |
121 # obstore: main | |
122 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
123 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
124 # obstore: pushdest | |
125 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
126 # obstore: pulldest | |
127 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |