tests/test-exchange-obsmarkers-case-B7.t
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Mon, 10 Apr 2017 16:50:23 +0200
changeset 31919 2bf73e351eb1
permissions -rw-r--r--
obsolescence: add test case B-7 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 B-7: Prune above non-targeted common changeset 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31919
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     1
============================================
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     2
Testing obsolescence markers push: Cases B.7
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     3
============================================
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     4
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     5
Mercurial pushes obsolescences markers relevant to the "pushed-set", the set of
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     6
all changesets that requested to be "in sync" after the push (even if they are
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     7
already on both side).
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     8
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     9
This test belongs to a series of tests checking such set is properly computed
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    10
and applied. This does not tests "obsmarkers" discovery capabilities.
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    11
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    12
Category B: pruning case
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    13
TestCase 7: Prune on non-targeted common changeset
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    14
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    15
B.7 Prune above non-targeted common changeset
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    16
=============================================
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    17
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    18
.. (very similar to B1, but the prune changeset is unknown on remote)
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    19
..
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    20
.. {{{
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    21
..     ⊗ B
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    22
..     |
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    23
..     ◕ A
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    24
..     |
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    25
..     ● O
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    26
.. }}}
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    27
..
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    28
.. Marker exist from:
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    29
..
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    30
..  * B (prune)
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    31
..
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    32
.. Command runs:
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    33
..
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    34
..  * hg push -r O
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    35
..
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    36
.. Expected exclude:
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    37
..
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    38
..  * B (prune)
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    39
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    40
Setup
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    41
-----
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    42
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    43
  $ . $TESTDIR/testlib/exchange-obsmarker-util.sh
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    44
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    45
Initial
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    46
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    47
  $ setuprepos B.7
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    48
  creating test repo for test case B.7
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    49
  - pulldest
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    50
  - main
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    51
  - pushdest
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    52
  cd into `main` and proceed with env setup
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    53
  $ cd main
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    54
  $ mkcommit A
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    55
  $ hg push -q ../pushdest
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    56
  $ hg push -q ../pulldest
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    57
  $ mkcommit B
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    58
  $ hg prune -qd '0 0' .
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    59
  $ hg log -G --hidden
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    60
  x  f6fbb35d8ac9 (draft): B
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    61
  |
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    62
  @  f5bc6836db60 (draft): A
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    63
  |
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    64
  o  a9bdc8b26820 (public): O
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    65
  
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    66
  $ inspect_obsmarkers
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    67
  obsstore content
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    68
  ================
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    69
  f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    70
  $ cd ..
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    71
  $ cd ..
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    72
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    73
Actual Test
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    74
-------------------------------------
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    75
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    76
  $ dotest B.7 O
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    77
  ## Running testcase B.7
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    78
  # testing echange of "O" (a9bdc8b26820)
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    79
  ## initial state
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    80
  # obstore: main
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    81
  f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    82
  # obstore: pushdest
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    83
  # obstore: pulldest
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    84
  ## pushing "O" from main to pushdest
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    85
  pushing to pushdest
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    86
  searching for changes
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    87
  no changes found
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    88
  ## post push state
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    89
  # obstore: main
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    90
  f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    91
  # obstore: pushdest
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    92
  # obstore: pulldest
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    93
  ## pulling "a9bdc8b26820" from main into pulldest
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    94
  pulling from main
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    95
  no changes found
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    96
  ## post pull state
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    97
  # obstore: main
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    98
  f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    99
  # obstore: pushdest
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
   100
  # obstore: pulldest