You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Neels Janosch Hofmeyr <ne...@elego.de> on 2008/08/17 12:36:48 UTC

tree-conflicts: patch for improved cmdline tests

Hi!

The current cmdline tests for tree-conflicts (in update_tests.py,
switch_tests.py and merge_tests.py) only test for file victims.

The new tests in this patch still do exactly what the old tests did (file
victims), but they also test for directory victims and (more) file victims
in a large set of tree-conflict cases in varying depths of directory trees.

AFAIK, this new set is complete in that it covers every imaginable case of
tree conflicts, for all of update, switch and merge.

I started off with sbutler's new (unfinished) test scheme which is already
committed on the tree-conflicts branch, and took it to a workable state. I
removed the old file-based tests, after checking for identical results.

Currently, most of these new tests still yield undesirable results. The
course that I aim for is this:

 1) Commit the new tree-conflicts tests, so that they PASS the current
    tree-conflicts branch, even though many test results are still
    undesirable. (This patch)

 2) One by one, look at the undesirable results and fix them in subsequent
    patches. Patches should both fix the situation and make the tests
    pass the fixed situation.

So, as mentioned, this patch passes the current situation on the
tree-conflicts branch. But, one test case cannot be passed, because it fails
in a segmentation fault!

I have investigated this and posted a preliminary patch in another mail:
http://subversion.tigris.org/servlets/ReadMsg?listName=dev&msgNo=141887

I would like this patch to be committed on the tree-conflicts branch, so
that continuing work on fixing tree-conflicts situations can be comprehensive.

Thanks!

[[[
Replacing file-based tree-conflicts cmdline tests. The new tests are
concerned with directory *and* file victims, in different tree depths.
Contains new tests for update, switch and merge operations.

* subversion/tests/cmdline/svntest/actions.py
  (set_up_tree_conflicts): Remove old helper for update, switch.
  (set_up_tree_conflicts_for_merge): Remove old helper for merge.
  (make_tc_test_trees): Rename and split new helper into make_deep_trees()
    and add_deep_trees().
  (tc_leaf_del): Rename new helper to deep_trees_leaf_del().
  (tc_tree_del): Rename new helper to deep_trees_tree_del().
  (tc_tree_del): Rename new helper to deep_trees_tree_del().
  (tc_text_append): Rename new helper to deep_trees_leaf_edit().
  (set_up_deep_tree_conflicts_up): Remove function, its purpose replaced by
    deep_trees_run_tests_scheme_for_update().
  (set_up_deep_tree_conflicts_sw): Remove function, its purpose replaced by
    deep_trees_run_tests_scheme_for_switch().
  (add_deep_trees): New function, replacing make_tc_test_trees().
  (make_deep_trees): New function, used by add_deep_trees().
  (deep_trees_virginal_state): New wc.State structure.
  (deep_trees_leaf_edit): New function.
  (deep_trees_after_leaf_edit): New wc.State structure.
  (deep_trees_leaf_del): New function.
  (deep_trees_after_leaf_del): New wc.State structure.
  (deep_trees_tree_del): New function.
  (deep_trees_after_tree_del): New wc.State structure.
  (DeepTreesTestCase): New class.
  (deep_trees_run_tests_scheme_for_update): New function.
  (deep_trees_run_tests_scheme_for_switch): New function.
  (deep_trees_run_tests_scheme_for_merge): New function.

* subversion/tests/cmdline/update_tests.py
  (tree_conflicts_in_updated_files): Remove old test, replaced by
    tree_conflicts_on_update().
  (tree_conflicts_on_update): New test, replacing
    tree_conflicts_in_updated_files(). Adds directory victims, and
    conflicts in different tree depths.

* subversion/tests/cmdline/switch_tests.py
  (tree_conflicts_in_switched_files): Remove old test, replaced by
    tree_conflicts_on_switch().
  (tree_conflicts_on_switch): New test, replacing
    tree_conflicts_in_switched_files(). Adds directory victims, and
    conflicts in different tree depths.

* subversion/tests/cmdline/merge_tests.py
  (tree_conflicts_in_merged_files): Remove old test, replaced by
    tree_conflicts_on_merge().
  (tree_conflicts_on_merge): New test, replacing
    tree_conflicts_in_merged_files(). Adds directory victims, and conflicts
    in different tree depths. Adds another case to the old merge test,
    namely omitting a local commit.
]]]


-- 
Neels Hofmeyr -- elego Software Solutions GmbH
Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
phone: +49 30 23458696  mobile: +49 177 2345869  fax: +49 30 23458695
http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
Handelsreg: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194

Re: tree-conflicts: patch for improved cmdline tests

Posted by Neels Janosch Hofmeyr <ne...@elego.de>.
The tree-conflicts branch has changed. Merged, reposting the diff.

(same commit message)
[[[
Replacing file-based tree-conflicts cmdline tests. The new tests are
concerned with directory *and* file victims, in different tree depths.
Contains new tests for update, switch and merge operations.

* subversion/tests/cmdline/svntest/actions.py
  (set_up_tree_conflicts): Remove old helper for update, switch.
  (set_up_tree_conflicts_for_merge): Remove old helper for merge.
  (make_tc_test_trees): Rename and split new helper into make_deep_trees()
    and add_deep_trees().
  (tc_leaf_del): Rename new helper to deep_trees_leaf_del().
  (tc_tree_del): Rename new helper to deep_trees_tree_del().
  (tc_tree_del): Rename new helper to deep_trees_tree_del().
  (tc_text_append): Rename new helper to deep_trees_leaf_edit().
  (set_up_deep_tree_conflicts_up): Remove function, its purpose replaced by
    deep_trees_run_tests_scheme_for_update().
  (set_up_deep_tree_conflicts_sw): Remove function, its purpose replaced by
    deep_trees_run_tests_scheme_for_switch().
  (add_deep_trees): New function, replacing make_tc_test_trees().
  (make_deep_trees): New function, used by add_deep_trees().
  (deep_trees_virginal_state): New wc.State structure.
  (deep_trees_leaf_edit): New function.
  (deep_trees_after_leaf_edit): New wc.State structure.
  (deep_trees_leaf_del): New function.
  (deep_trees_after_leaf_del): New wc.State structure.
  (deep_trees_tree_del): New function.
  (deep_trees_after_tree_del): New wc.State structure.
  (DeepTreesTestCase): New class.
  (deep_trees_run_tests_scheme_for_update): New function.
  (deep_trees_run_tests_scheme_for_switch): New function.
  (deep_trees_run_tests_scheme_for_merge): New function.

* subversion/tests/cmdline/update_tests.py
  (tree_conflicts_in_updated_files): Remove old test, replaced by
    tree_conflicts_on_update().
  (tree_conflicts_on_update): New test, replacing
    tree_conflicts_in_updated_files(). Adds directory victims, and
    conflicts in different tree depths.

* subversion/tests/cmdline/switch_tests.py
  (tree_conflicts_in_switched_files): Remove old test, replaced by
    tree_conflicts_on_switch().
  (tree_conflicts_on_switch): New test, replacing
    tree_conflicts_in_switched_files(). Adds directory victims, and
    conflicts in different tree depths.

* subversion/tests/cmdline/merge_tests.py
  (tree_conflicts_in_merged_files): Remove old test, replaced by
    tree_conflicts_on_merge().
  (tree_conflicts_on_merge): New test, replacing
    tree_conflicts_in_merged_files(). Adds directory victims, and conflicts
    in different tree depths. Adds another case to the old merge test,
    namely omitting a local commit.
]]]

Neels Janosch Hofmeyr wrote:
> Sorry, a debugging line had crept into that patch!
> Reposting.
> 
> (The line was "return None" in actions.py to investigate a segfault)
> 
> (same commit message)
> [[[
> Replacing file-based tree-conflicts cmdline tests. The new tests are
> concerned with directory *and* file victims, in different tree depths.
> Contains new tests for update, switch and merge operations.
> 
> * subversion/tests/cmdline/svntest/actions.py
>   (set_up_tree_conflicts): Remove old helper for update, switch.
>   (set_up_tree_conflicts_for_merge): Remove old helper for merge.
>   (make_tc_test_trees): Rename and split new helper into make_deep_trees()
>     and add_deep_trees().
>   (tc_leaf_del): Rename new helper to deep_trees_leaf_del().
>   (tc_tree_del): Rename new helper to deep_trees_tree_del().
>   (tc_tree_del): Rename new helper to deep_trees_tree_del().
>   (tc_text_append): Rename new helper to deep_trees_leaf_edit().
>   (set_up_deep_tree_conflicts_up): Remove function, its purpose replaced by
>     deep_trees_run_tests_scheme_for_update().
>   (set_up_deep_tree_conflicts_sw): Remove function, its purpose replaced by
>     deep_trees_run_tests_scheme_for_switch().
>   (add_deep_trees): New function, replacing make_tc_test_trees().
>   (make_deep_trees): New function, used by add_deep_trees().
>   (deep_trees_virginal_state): New wc.State structure.
>   (deep_trees_leaf_edit): New function.
>   (deep_trees_after_leaf_edit): New wc.State structure.
>   (deep_trees_leaf_del): New function.
>   (deep_trees_after_leaf_del): New wc.State structure.
>   (deep_trees_tree_del): New function.
>   (deep_trees_after_tree_del): New wc.State structure.
>   (DeepTreesTestCase): New class.
>   (deep_trees_run_tests_scheme_for_update): New function.
>   (deep_trees_run_tests_scheme_for_switch): New function.
>   (deep_trees_run_tests_scheme_for_merge): New function.
> 
> * subversion/tests/cmdline/update_tests.py
>   (tree_conflicts_in_updated_files): Remove old test, replaced by
>     tree_conflicts_on_update().
>   (tree_conflicts_on_update): New test, replacing
>     tree_conflicts_in_updated_files(). Adds directory victims, and
>     conflicts in different tree depths.
> 
> * subversion/tests/cmdline/switch_tests.py
>   (tree_conflicts_in_switched_files): Remove old test, replaced by
>     tree_conflicts_on_switch().
>   (tree_conflicts_on_switch): New test, replacing
>     tree_conflicts_in_switched_files(). Adds directory victims, and
>     conflicts in different tree depths.
> 
> * subversion/tests/cmdline/merge_tests.py
>   (tree_conflicts_in_merged_files): Remove old test, replaced by
>     tree_conflicts_on_merge().
>   (tree_conflicts_on_merge): New test, replacing
>     tree_conflicts_in_merged_files(). Adds directory victims, and conflicts
>     in different tree depths. Adds another case to the old merge test,
>     namely omitting a local commit.
> ]]]
> 
> Neels Janosch Hofmeyr wrote:
>> Hi!
>>
>> The current cmdline tests for tree-conflicts (in update_tests.py,
>> switch_tests.py and merge_tests.py) only test for file victims.
>>
>> The new tests in this patch still do exactly what the old tests did (file
>> victims), but they also test for directory victims and (more) file victims
>> in a large set of tree-conflict cases in varying depths of directory trees.
>>
>> AFAIK, this new set is complete in that it covers every imaginable case of
>> tree conflicts, for all of update, switch and merge.
>>
>> I started off with sbutler's new (unfinished) test scheme which is already
>> committed on the tree-conflicts branch, and took it to a workable state. I
>> removed the old file-based tests, after checking for identical results.
>>
>> Currently, most of these new tests still yield undesirable results. The
>> course that I aim for is this:
>>
>>  1) Commit the new tree-conflicts tests, so that they PASS the current
>>     tree-conflicts branch, even though many test results are still
>>     undesirable. (This patch)
>>
>>  2) One by one, look at the undesirable results and fix them in subsequent
>>     patches. Patches should both fix the situation and make the tests
>>     pass the fixed situation.
>>
>> So, as mentioned, this patch passes the current situation on the
>> tree-conflicts branch. But, one test case cannot be passed, because it fails
>> in a segmentation fault!
>>
>> I have investigated this and posted a preliminary patch in another mail:
>> http://subversion.tigris.org/servlets/ReadMsg?listName=dev&msgNo=141887
>>
>> I would like this patch to be committed on the tree-conflicts branch, so
>> that continuing work on fixing tree-conflicts situations can be comprehensive.
>>
>> Thanks!
>>
>> [[[
>> Replacing file-based tree-conflicts cmdline tests. The new tests are
>> concerned with directory *and* file victims, in different tree depths.
>> Contains new tests for update, switch and merge operations.
>>
>> * subversion/tests/cmdline/svntest/actions.py
>>   (set_up_tree_conflicts): Remove old helper for update, switch.
>>   (set_up_tree_conflicts_for_merge): Remove old helper for merge.
>>   (make_tc_test_trees): Rename and split new helper into make_deep_trees()
>>     and add_deep_trees().
>>   (tc_leaf_del): Rename new helper to deep_trees_leaf_del().
>>   (tc_tree_del): Rename new helper to deep_trees_tree_del().
>>   (tc_tree_del): Rename new helper to deep_trees_tree_del().
>>   (tc_text_append): Rename new helper to deep_trees_leaf_edit().
>>   (set_up_deep_tree_conflicts_up): Remove function, its purpose replaced by
>>     deep_trees_run_tests_scheme_for_update().
>>   (set_up_deep_tree_conflicts_sw): Remove function, its purpose replaced by
>>     deep_trees_run_tests_scheme_for_switch().
>>   (add_deep_trees): New function, replacing make_tc_test_trees().
>>   (make_deep_trees): New function, used by add_deep_trees().
>>   (deep_trees_virginal_state): New wc.State structure.
>>   (deep_trees_leaf_edit): New function.
>>   (deep_trees_after_leaf_edit): New wc.State structure.
>>   (deep_trees_leaf_del): New function.
>>   (deep_trees_after_leaf_del): New wc.State structure.
>>   (deep_trees_tree_del): New function.
>>   (deep_trees_after_tree_del): New wc.State structure.
>>   (DeepTreesTestCase): New class.
>>   (deep_trees_run_tests_scheme_for_update): New function.
>>   (deep_trees_run_tests_scheme_for_switch): New function.
>>   (deep_trees_run_tests_scheme_for_merge): New function.
>>
>> * subversion/tests/cmdline/update_tests.py
>>   (tree_conflicts_in_updated_files): Remove old test, replaced by
>>     tree_conflicts_on_update().
>>   (tree_conflicts_on_update): New test, replacing
>>     tree_conflicts_in_updated_files(). Adds directory victims, and
>>     conflicts in different tree depths.
>>
>> * subversion/tests/cmdline/switch_tests.py
>>   (tree_conflicts_in_switched_files): Remove old test, replaced by
>>     tree_conflicts_on_switch().
>>   (tree_conflicts_on_switch): New test, replacing
>>     tree_conflicts_in_switched_files(). Adds directory victims, and
>>     conflicts in different tree depths.
>>
>> * subversion/tests/cmdline/merge_tests.py
>>   (tree_conflicts_in_merged_files): Remove old test, replaced by
>>     tree_conflicts_on_merge().
>>   (tree_conflicts_on_merge): New test, replacing
>>     tree_conflicts_in_merged_files(). Adds directory victims, and conflicts
>>     in different tree depths. Adds another case to the old merge test,
>>     namely omitting a local commit.
>> ]]]
>>
>>
>>
> 

-- 
Neels Hofmeyr -- elego Software Solutions GmbH
Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
phone: +49 30 23458696  mobile: +49 177 2345869  fax: +49 30 23458695
http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
Handelsreg: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194

Re: [PATCH] tree-conflicts: fix some tests, was Re: tree-conflicts: patch for improved cmdline tests

Posted by Julian Foad <ju...@btopenworld.com>.
Neels Hofmeyr wrote:
> :O
> I was so sure I had grep'd for every function I removed.
> 
> I investigated and found that all remaining calls of set_up_tree_conflicts()
> are less advanced. They just need some tree-conflict markings in a working copy.
> 
> So, I simplified it to deliver that, also removing code repetition from the
> callers.

Thanks, Neels.

I tweaked the log message a bit, and tweaked the function
build_greek_tree_conflicts() just to replace long-hand lists of expected
status with calls to get_virginal_state().


> I renamed it to build_greek_tree_conflicts(), because:
> 
> - The new function builds a working copy with tree-conflicts, instead of
> only preparing for them. Hence the "build" annotation.
> 
> - I found the name too absolute, since there are other tree-conflicts test
> setups around. Hence the "greek" annotation.

That's great.

Committed in r32806.

- Julian



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

[PATCH] tree-conflicts: fix some tests, was Re: tree-conflicts: patch for improved cmdline tests

Posted by Neels Hofmeyr <ne...@elego.de>.

Julian Foad wrote:
> On Thu, 2008-08-28 at 08:02 +0300, Daniel Shahaf wrote:
>> For the archives: This patch was committed in r32605.
> 
> Neels,
> 
> I committed the patch to the tree-conflicts branch in r32605.
> 
> I noticed today that it causes a few more tests are failing because they
> are still trying to use "set_up_tree_conflicts()", which does not exist
> any more.
> 
> Could you investigate, please?
> 
>> $ grep set_up_tree_conflicts subversion/tests/cmdline/*.py
>> subversion/tests/cmdline/commit_tests.py:  wc_dir_2 = svntest.actions.set_up_tree_conflicts(sbox)
>> subversion/tests/cmdline/commit_tests.py:  wc_dir_2 = svntest.actions.set_up_tree_conflicts(sbox)
>> subversion/tests/cmdline/info_tests.py:  wc_dir_2 = svntest.actions.set_up_tree_conflicts(sbox)
>> subversion/tests/cmdline/revert_tests.py:  wc_dir_2 = svntest.actions.set_up_tree_conflicts(sbox)
>> subversion/tests/cmdline/stat_tests.py:  wc_dir_2 = svntest.actions.set_up_tree_conflicts(sbox)
>> subversion/tests/cmdline/tree_conflict_tests.py:# (See also the somewhat related svntest.actions.set_up_tree_conflicts().)
> 
> Thanks,
> - Julian

:O
I was so sure I had grep'd for every function I removed.

I investigated and found that all remaining calls of set_up_tree_conflicts()
are less advanced. They just need some tree-conflict markings in a working copy.

So, I simplified it to deliver that, also removing code repetition from the
callers.

I renamed it to build_greek_tree_conflicts(), because:

- The new function builds a working copy with tree-conflicts, instead of
only preparing for them. Hence the "build" annotation.

- I found the name too absolute, since there are other tree-conflicts test
setups around. Hence the "greek" annotation.


Hm, it would be nice to also have directory victims in there. But I'm first
sending this patch to restore the previous state.

~Neels


[[[
PASS:  commit_tests.py 59: tree conflicts block commit
PASS:  commit_tests.py 60: tree conflicts resolved
PASS:  info_tests.py 1: info with tree conflicts
PASS:  revert_tests.py 19: revert tree conflicts in updated files
PASS:  stat_tests.py 31: status with tree conflicts
]]]



[[[
Fix some tree-conflicts tests by resurrecting set_up_tree_conflicts()
and streamlining it. `info_tests.py' additionally has minor unrelated fixes.

* subversion/tests/cmdline/svntest/actions.py
   (set_up_tree_conflicts): Bring back this function removed earlier, but
    rename it to build_greek_tree_conflicts(). Still needed by some tests,
    was erratically removed.
   (build_greek_tree_conflicts): New function, renamed from
    set_up_tree_conflicts(). Simplify, sufficiently serving all current
    callers. Now creates a working copy with conflicts already in it,
    as opposed to just preparing for conflicts. Remove obsolete parameter
    DO_COPY. Use only one working copy and "time-warp". Tweak run_svn()
    calls to run_and_verify_*() calls. Change to not return anything.

* subversion/tests/cmdline/tree_conflict_tests.py (set_up_repos): Fix
    comment according to above rename, also mention deep_trees tests.

* subversion/tests/cmdline/revert_tests.py
   (revert_tree_conflicts_in_updated_files):
    Use new function build_greek_tree_conflicts(). Fixes this test.

* subversion/tests/cmdline/stat_tests.py (status_with_tree_conflicts):
    Use new function build_greek_tree_conflicts(). Fixes this test.

* subversion/tests/cmdline/commit_tests.py
   (tree_conflicts_block_commit, tree_conflicts_resolved):
    Use new function build_greek_tree_conflicts(). Fixes these tests.

* subversion/tests/cmdline/info_tests.py (info_with_tree_conflicts):
    Use new function build_greek_tree_conflicts(). Add EXIT_CODE as now
    returned by run_and_verify_svn(), modify output lines as now printed
    in tree-conflicts info. Fixes this test.

Found by: julianf
Patch by: neels
]]]





(((
btw, could I write that like so? :

* subversion/tests/cmdline/revert_tests.py
   (revert_tree_conflicts_in_updated_files),
* subversion/tests/cmdline/stat_tests.py (status_with_tree_conflicts),
* subversion/tests/cmdline/commit_tests.py
   (tree_conflicts_block_commit, tree_conflicts_resolved):
    Use new function build_greek_tree_conflicts(). Fixes these tests.

Looks kind of messy. How else to remove the repetition?
)))

-- 
Neels Hofmeyr -- elego Software Solutions GmbH
Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
phone: +49 30 23458696  mobile: +49 177 2345869  fax: +49 30 23458695
http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
Handelsreg: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194

Re: tree-conflicts: patch for improved cmdline tests

Posted by Julian Foad <ju...@btopenworld.com>.
On Thu, 2008-08-28 at 08:02 +0300, Daniel Shahaf wrote:
> For the archives: This patch was committed in r32605.

Neels,

I committed the patch to the tree-conflicts branch in r32605.

I noticed today that it causes a few more tests are failing because they
are still trying to use "set_up_tree_conflicts()", which does not exist
any more.

Could you investigate, please?

> $ grep set_up_tree_conflicts subversion/tests/cmdline/*.py
> subversion/tests/cmdline/commit_tests.py:  wc_dir_2 = svntest.actions.set_up_tree_conflicts(sbox)
> subversion/tests/cmdline/commit_tests.py:  wc_dir_2 = svntest.actions.set_up_tree_conflicts(sbox)
> subversion/tests/cmdline/info_tests.py:  wc_dir_2 = svntest.actions.set_up_tree_conflicts(sbox)
> subversion/tests/cmdline/revert_tests.py:  wc_dir_2 = svntest.actions.set_up_tree_conflicts(sbox)
> subversion/tests/cmdline/stat_tests.py:  wc_dir_2 = svntest.actions.set_up_tree_conflicts(sbox)
> subversion/tests/cmdline/tree_conflict_tests.py:# (See also the somewhat related svntest.actions.set_up_tree_conflicts().)

Thanks,
- Julian


> Neels Janosch Hofmeyr wrote on Tue, 19 Aug 2008 at 01:34 +0200:
> > [[[
> > Replacing file-based tree-conflicts cmdline tests. The new tests are
> > concerned with directory *and* file victims, in different tree depths.
> > Contains new tests for update, switch and merge operations.
> > 
> > * subversion/tests/cmdline/svntest/actions.py
> >   (set_up_tree_conflicts): Remove old helper for update, switch.
> >   (set_up_tree_conflicts_for_merge): Remove old helper for merge.
[..]



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: tree-conflicts: patch for improved cmdline tests

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
For the archives: This patch was committed in r32605.

Daniel

Neels Janosch Hofmeyr wrote on Tue, 19 Aug 2008 at 01:34 +0200:
> Sorry, a debugging line had crept into that patch!
> Reposting.
> 
> (The line was "return None" in actions.py to investigate a segfault)
> 
> (same commit message)
> [[[
> Replacing file-based tree-conflicts cmdline tests. The new tests are
> concerned with directory *and* file victims, in different tree depths.
> Contains new tests for update, switch and merge operations.
> 
> * subversion/tests/cmdline/svntest/actions.py
>   (set_up_tree_conflicts): Remove old helper for update, switch.
>   (set_up_tree_conflicts_for_merge): Remove old helper for merge.
>   (make_tc_test_trees): Rename and split new helper into make_deep_trees()
>     and add_deep_trees().
>   (tc_leaf_del): Rename new helper to deep_trees_leaf_del().
>   (tc_tree_del): Rename new helper to deep_trees_tree_del().
>   (tc_tree_del): Rename new helper to deep_trees_tree_del().
>   (tc_text_append): Rename new helper to deep_trees_leaf_edit().
>   (set_up_deep_tree_conflicts_up): Remove function, its purpose replaced by
>     deep_trees_run_tests_scheme_for_update().
>   (set_up_deep_tree_conflicts_sw): Remove function, its purpose replaced by
>     deep_trees_run_tests_scheme_for_switch().
>   (add_deep_trees): New function, replacing make_tc_test_trees().
>   (make_deep_trees): New function, used by add_deep_trees().
>   (deep_trees_virginal_state): New wc.State structure.
>   (deep_trees_leaf_edit): New function.
>   (deep_trees_after_leaf_edit): New wc.State structure.
>   (deep_trees_leaf_del): New function.
>   (deep_trees_after_leaf_del): New wc.State structure.
>   (deep_trees_tree_del): New function.
>   (deep_trees_after_tree_del): New wc.State structure.
>   (DeepTreesTestCase): New class.
>   (deep_trees_run_tests_scheme_for_update): New function.
>   (deep_trees_run_tests_scheme_for_switch): New function.
>   (deep_trees_run_tests_scheme_for_merge): New function.
> 
> * subversion/tests/cmdline/update_tests.py
>   (tree_conflicts_in_updated_files): Remove old test, replaced by
>     tree_conflicts_on_update().
>   (tree_conflicts_on_update): New test, replacing
>     tree_conflicts_in_updated_files(). Adds directory victims, and
>     conflicts in different tree depths.
> 
> * subversion/tests/cmdline/switch_tests.py
>   (tree_conflicts_in_switched_files): Remove old test, replaced by
>     tree_conflicts_on_switch().
>   (tree_conflicts_on_switch): New test, replacing
>     tree_conflicts_in_switched_files(). Adds directory victims, and
>     conflicts in different tree depths.
> 
> * subversion/tests/cmdline/merge_tests.py
>   (tree_conflicts_in_merged_files): Remove old test, replaced by
>     tree_conflicts_on_merge().
>   (tree_conflicts_on_merge): New test, replacing
>     tree_conflicts_in_merged_files(). Adds directory victims, and conflicts
>     in different tree depths. Adds another case to the old merge test,
>     namely omitting a local commit.
> ]]]
> 
> Neels Janosch Hofmeyr wrote:
> > Hi!
> > 
> > The current cmdline tests for tree-conflicts (in update_tests.py,
> > switch_tests.py and merge_tests.py) only test for file victims.
> > 
> > The new tests in this patch still do exactly what the old tests did (file
> > victims), but they also test for directory victims and (more) file victims
> > in a large set of tree-conflict cases in varying depths of directory trees.
> > 
> > AFAIK, this new set is complete in that it covers every imaginable case of
> > tree conflicts, for all of update, switch and merge.
> > 
> > I started off with sbutler's new (unfinished) test scheme which is already
> > committed on the tree-conflicts branch, and took it to a workable state. I
> > removed the old file-based tests, after checking for identical results.
> > 
> > Currently, most of these new tests still yield undesirable results. The
> > course that I aim for is this:
> > 
> >  1) Commit the new tree-conflicts tests, so that they PASS the current
> >     tree-conflicts branch, even though many test results are still
> >     undesirable. (This patch)
> > 
> >  2) One by one, look at the undesirable results and fix them in subsequent
> >     patches. Patches should both fix the situation and make the tests
> >     pass the fixed situation.
> > 
> > So, as mentioned, this patch passes the current situation on the
> > tree-conflicts branch. But, one test case cannot be passed, because it fails
> > in a segmentation fault!
> > 
> > I have investigated this and posted a preliminary patch in another mail:
> > http://subversion.tigris.org/servlets/ReadMsg?listName=dev&msgNo=141887
> > 
> > I would like this patch to be committed on the tree-conflicts branch, so
> > that continuing work on fixing tree-conflicts situations can be comprehensive.
> > 
> > Thanks!
> > 
> > [[[
> > Replacing file-based tree-conflicts cmdline tests. The new tests are
> > concerned with directory *and* file victims, in different tree depths.
> > Contains new tests for update, switch and merge operations.
> > 
> > * subversion/tests/cmdline/svntest/actions.py
> >   (set_up_tree_conflicts): Remove old helper for update, switch.
> >   (set_up_tree_conflicts_for_merge): Remove old helper for merge.
> >   (make_tc_test_trees): Rename and split new helper into make_deep_trees()
> >     and add_deep_trees().
> >   (tc_leaf_del): Rename new helper to deep_trees_leaf_del().
> >   (tc_tree_del): Rename new helper to deep_trees_tree_del().
> >   (tc_tree_del): Rename new helper to deep_trees_tree_del().
> >   (tc_text_append): Rename new helper to deep_trees_leaf_edit().
> >   (set_up_deep_tree_conflicts_up): Remove function, its purpose replaced by
> >     deep_trees_run_tests_scheme_for_update().
> >   (set_up_deep_tree_conflicts_sw): Remove function, its purpose replaced by
> >     deep_trees_run_tests_scheme_for_switch().
> >   (add_deep_trees): New function, replacing make_tc_test_trees().
> >   (make_deep_trees): New function, used by add_deep_trees().
> >   (deep_trees_virginal_state): New wc.State structure.
> >   (deep_trees_leaf_edit): New function.
> >   (deep_trees_after_leaf_edit): New wc.State structure.
> >   (deep_trees_leaf_del): New function.
> >   (deep_trees_after_leaf_del): New wc.State structure.
> >   (deep_trees_tree_del): New function.
> >   (deep_trees_after_tree_del): New wc.State structure.
> >   (DeepTreesTestCase): New class.
> >   (deep_trees_run_tests_scheme_for_update): New function.
> >   (deep_trees_run_tests_scheme_for_switch): New function.
> >   (deep_trees_run_tests_scheme_for_merge): New function.
> > 
> > * subversion/tests/cmdline/update_tests.py
> >   (tree_conflicts_in_updated_files): Remove old test, replaced by
> >     tree_conflicts_on_update().
> >   (tree_conflicts_on_update): New test, replacing
> >     tree_conflicts_in_updated_files(). Adds directory victims, and
> >     conflicts in different tree depths.
> > 
> > * subversion/tests/cmdline/switch_tests.py
> >   (tree_conflicts_in_switched_files): Remove old test, replaced by
> >     tree_conflicts_on_switch().
> >   (tree_conflicts_on_switch): New test, replacing
> >     tree_conflicts_in_switched_files(). Adds directory victims, and
> >     conflicts in different tree depths.
> > 
> > * subversion/tests/cmdline/merge_tests.py
> >   (tree_conflicts_in_merged_files): Remove old test, replaced by
> >     tree_conflicts_on_merge().
> >   (tree_conflicts_on_merge): New test, replacing
> >     tree_conflicts_in_merged_files(). Adds directory victims, and conflicts
> >     in different tree depths. Adds another case to the old merge test,
> >     namely omitting a local commit.
> > ]]]
> > 
> > 
> > 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: tree-conflicts: patch for improved cmdline tests

Posted by Julian Foad <ju...@btopenworld.com>.
On Tue, 2008-08-19 at 01:34 +0200, Neels Janosch Hofmeyr wrote:
> Sorry, a debugging line had crept into that patch!
> Reposting.

Hi Neels. This looks like a good move in general.

Do you think this framework can replace my "tree_conflict_tests.py"? It
would be good to do so, because I invented a new framework which was
useful to me but not compatible with the rest of the test files and a
bit difficult for other people to extend.

I am having difficulty reviewing the tests. There seems to be a lot of
"magic numbers" in a sense. Not numbers, but the expected results. For
example:

[[[
> +  leaf_edit = svntest.actions.deep_trees_leaf_edit
> +  tree_del = svntest.actions.deep_trees_tree_del
[...]
> +  expected_status = svntest.wc.State('', {
> +    ''                  : Item(status=' M', wc_rev='7'),
> +    'D'                 : Item(status='  ', wc_rev='7'),
> +    'D/D1'              : Item(status='D ', wc_rev='7'),
> +    'D/D1/delta'        : Item(status='D ', wc_rev='8'),
> +    'F'                 : Item(status='C ', wc_rev='7'),
> +    'F/alpha'           : Item(status='D ', wc_rev='8'),
> +    'DD'                : Item(status='  ', wc_rev='7'),
> +    'DD/D1'             : Item(status='D ', wc_rev='7'),
> +    'DD/D1/D2'          : Item(status='D ', wc_rev='7'),
> +    'DD/D1/D2/epsilon'  : Item(status='D ', wc_rev='8'),
> +    'DF'                : Item(status='  ', wc_rev='7'),
> +    'DF/D1'             : Item(status='D ', wc_rev='7'),
> +    'DF/D1/beta'        : Item(status='D ', wc_rev='8'),
> +    'DDD'               : Item(status='  ', wc_rev='7'),
> +    'DDD/D1'            : Item(status='D ', wc_rev='7'),
> +    'DDD/D1/D2'         : Item(status='D ', wc_rev='7'),
> +    'DDD/D1/D2/D3'      : Item(status='D ', wc_rev='7'),
> +    'DDD/D1/D2/D3/zeta' : Item(status='D ', wc_rev='8'),
> +    'DDF'               : Item(status='  ', wc_rev='7'),
> +    'DDF/D1'            : Item(status='D ', wc_rev='7'),
> +    'DDF/D1/D2'         : Item(status='D ', wc_rev='7'),
> +    'DDF/D1/D2/gamma'   : Item(status='D ', wc_rev='8'),
> +    })
> +
> +  expected_skip = svntest.wc.State('', {})
> +
> +  greater_scheme +=
> [ DeepTreesTestCase("local_leaf_edit_incoming_tree_del",
> +                                        leaf_edit,
> +                                        tree_del,
> +                                        expected_output,
> +                                        expected_disk,
> +                                        expected_status,
> +                                        expected_skip) ]
]]]

This is like a regression test: it says "This is the output from a
previous run, and let me know if anything changes." But when developing
a new feature, it can be more useful to have tests that each check one
specific aspect of the behaviour. For example, 1: in these scenarios,
test that a tree conflict indicator is printed by the "merge" command.
2: Where there is an unresolved tree conflict, test that a commit fails.
3: Test that the "resolve" command works. etc.

When I write a test like that, or when I review one that you have
written, it's quite tedious to work out what all the item paths will be,
or what the status and revision number should be for each path.

(Your other patch to make the test suite print out the status tree in
this format is one way to get the data that results from the current
implementation, but it doesn't help me to decide whether the data are
correct.)

I would like the test to say something like this (pseudo-Python):

[[[
> +  leaf_edit = svntest.actions.deep_trees_leaf_edit
> +  tree_del = svntest.actions.deep_trees_tree_del
[...]
> +  # Set the default expected status of each item
> +  expected_status = svntest.actions.deep_trees_items
> +  for item in tree_del:
> +    expected_status[item] = Item(status='D ', wc_rev='8')
> +
> +  # But each item that conflicts should get a 'C' on its parent
> +  # and not increment its revision number.
> +  for item in leaf_edit:
> +    if item is in tree_del:
> +      parent = item.get_parent()
> +      expected_status[parent] = Item(status='C ', wc_rev='7')
> +
> +  greater_scheme +=
> [ DeepTreesTestCase("local_leaf_edit_incoming_tree_del",
> +                                        leaf_edit,
> +                                        tree_del,
> +                                        expected_output,
> +                                        expected_disk,
> +                                        expected_status,
> +                                        expected_skip) ]
]]]

Do you think that would be a better way to write the tests so that they
are understandable?

If you do, I could commit your current patch soon and we could make that
a later improvement.

- Julian


> [[[
> Replacing file-based tree-conflicts cmdline tests. The new tests are
> concerned with directory *and* file victims, in different tree depths.
> Contains new tests for update, switch and merge operations.
> 
> * subversion/tests/cmdline/svntest/actions.py
>   (set_up_tree_conflicts): Remove old helper for update, switch.
>   (set_up_tree_conflicts_for_merge): Remove old helper for merge.
>   (make_tc_test_trees): Rename and split new helper into make_deep_trees()
>     and add_deep_trees().
>   (tc_leaf_del): Rename new helper to deep_trees_leaf_del().
>   (tc_tree_del): Rename new helper to deep_trees_tree_del().
>   (tc_tree_del): Rename new helper to deep_trees_tree_del().
>   (tc_text_append): Rename new helper to deep_trees_leaf_edit().
>   (set_up_deep_tree_conflicts_up): Remove function, its purpose replaced by
>     deep_trees_run_tests_scheme_for_update().
>   (set_up_deep_tree_conflicts_sw): Remove function, its purpose replaced by
>     deep_trees_run_tests_scheme_for_switch().
>   (add_deep_trees): New function, replacing make_tc_test_trees().
>   (make_deep_trees): New function, used by add_deep_trees().
>   (deep_trees_virginal_state): New wc.State structure.
>   (deep_trees_leaf_edit): New function.
>   (deep_trees_after_leaf_edit): New wc.State structure.
>   (deep_trees_leaf_del): New function.
>   (deep_trees_after_leaf_del): New wc.State structure.
>   (deep_trees_tree_del): New function.
>   (deep_trees_after_tree_del): New wc.State structure.
>   (DeepTreesTestCase): New class.
>   (deep_trees_run_tests_scheme_for_update): New function.
>   (deep_trees_run_tests_scheme_for_switch): New function.
>   (deep_trees_run_tests_scheme_for_merge): New function.
> 
> * subversion/tests/cmdline/update_tests.py
>   (tree_conflicts_in_updated_files): Remove old test, replaced by
>     tree_conflicts_on_update().
>   (tree_conflicts_on_update): New test, replacing
>     tree_conflicts_in_updated_files(). Adds directory victims, and
>     conflicts in different tree depths.
> 
> * subversion/tests/cmdline/switch_tests.py
>   (tree_conflicts_in_switched_files): Remove old test, replaced by
>     tree_conflicts_on_switch().
>   (tree_conflicts_on_switch): New test, replacing
>     tree_conflicts_in_switched_files(). Adds directory victims, and
>     conflicts in different tree depths.
> 
> * subversion/tests/cmdline/merge_tests.py
>   (tree_conflicts_in_merged_files): Remove old test, replaced by
>     tree_conflicts_on_merge().
>   (tree_conflicts_on_merge): New test, replacing
>     tree_conflicts_in_merged_files(). Adds directory victims, and conflicts
>     in different tree depths. Adds another case to the old merge test,
>     namely omitting a local commit.
> ]]]
> 
> Neels Janosch Hofmeyr wrote:
> > Hi!
> > 
> > The current cmdline tests for tree-conflicts (in update_tests.py,
> > switch_tests.py and merge_tests.py) only test for file victims.
> > 
> > The new tests in this patch still do exactly what the old tests did (file
> > victims), but they also test for directory victims and (more) file victims
> > in a large set of tree-conflict cases in varying depths of directory trees.
> > 
> > AFAIK, this new set is complete in that it covers every imaginable case of
> > tree conflicts, for all of update, switch and merge.
> > 
> > I started off with sbutler's new (unfinished) test scheme which is already
> > committed on the tree-conflicts branch, and took it to a workable state. I
> > removed the old file-based tests, after checking for identical results.
> > 
> > Currently, most of these new tests still yield undesirable results. The
> > course that I aim for is this:
> > 
> >  1) Commit the new tree-conflicts tests, so that they PASS the current
> >     tree-conflicts branch, even though many test results are still
> >     undesirable. (This patch)
> > 
> >  2) One by one, look at the undesirable results and fix them in subsequent
> >     patches. Patches should both fix the situation and make the tests
> >     pass the fixed situation.
> > 
> > So, as mentioned, this patch passes the current situation on the
> > tree-conflicts branch. But, one test case cannot be passed, because it fails
> > in a segmentation fault!
> > 
> > I have investigated this and posted a preliminary patch in another mail:
> > http://subversion.tigris.org/servlets/ReadMsg?listName=dev&msgNo=141887
> > 
> > I would like this patch to be committed on the tree-conflicts branch, so
> > that continuing work on fixing tree-conflicts situations can be comprehensive.
> > 
> > Thanks!




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: tree-conflicts: patch for improved cmdline tests

Posted by Neels Janosch Hofmeyr <ne...@elego.de>.
Sorry, a debugging line had crept into that patch!
Reposting.

(The line was "return None" in actions.py to investigate a segfault)

(same commit message)
[[[
Replacing file-based tree-conflicts cmdline tests. The new tests are
concerned with directory *and* file victims, in different tree depths.
Contains new tests for update, switch and merge operations.

* subversion/tests/cmdline/svntest/actions.py
  (set_up_tree_conflicts): Remove old helper for update, switch.
  (set_up_tree_conflicts_for_merge): Remove old helper for merge.
  (make_tc_test_trees): Rename and split new helper into make_deep_trees()
    and add_deep_trees().
  (tc_leaf_del): Rename new helper to deep_trees_leaf_del().
  (tc_tree_del): Rename new helper to deep_trees_tree_del().
  (tc_tree_del): Rename new helper to deep_trees_tree_del().
  (tc_text_append): Rename new helper to deep_trees_leaf_edit().
  (set_up_deep_tree_conflicts_up): Remove function, its purpose replaced by
    deep_trees_run_tests_scheme_for_update().
  (set_up_deep_tree_conflicts_sw): Remove function, its purpose replaced by
    deep_trees_run_tests_scheme_for_switch().
  (add_deep_trees): New function, replacing make_tc_test_trees().
  (make_deep_trees): New function, used by add_deep_trees().
  (deep_trees_virginal_state): New wc.State structure.
  (deep_trees_leaf_edit): New function.
  (deep_trees_after_leaf_edit): New wc.State structure.
  (deep_trees_leaf_del): New function.
  (deep_trees_after_leaf_del): New wc.State structure.
  (deep_trees_tree_del): New function.
  (deep_trees_after_tree_del): New wc.State structure.
  (DeepTreesTestCase): New class.
  (deep_trees_run_tests_scheme_for_update): New function.
  (deep_trees_run_tests_scheme_for_switch): New function.
  (deep_trees_run_tests_scheme_for_merge): New function.

* subversion/tests/cmdline/update_tests.py
  (tree_conflicts_in_updated_files): Remove old test, replaced by
    tree_conflicts_on_update().
  (tree_conflicts_on_update): New test, replacing
    tree_conflicts_in_updated_files(). Adds directory victims, and
    conflicts in different tree depths.

* subversion/tests/cmdline/switch_tests.py
  (tree_conflicts_in_switched_files): Remove old test, replaced by
    tree_conflicts_on_switch().
  (tree_conflicts_on_switch): New test, replacing
    tree_conflicts_in_switched_files(). Adds directory victims, and
    conflicts in different tree depths.

* subversion/tests/cmdline/merge_tests.py
  (tree_conflicts_in_merged_files): Remove old test, replaced by
    tree_conflicts_on_merge().
  (tree_conflicts_on_merge): New test, replacing
    tree_conflicts_in_merged_files(). Adds directory victims, and conflicts
    in different tree depths. Adds another case to the old merge test,
    namely omitting a local commit.
]]]

Neels Janosch Hofmeyr wrote:
> Hi!
> 
> The current cmdline tests for tree-conflicts (in update_tests.py,
> switch_tests.py and merge_tests.py) only test for file victims.
> 
> The new tests in this patch still do exactly what the old tests did (file
> victims), but they also test for directory victims and (more) file victims
> in a large set of tree-conflict cases in varying depths of directory trees.
> 
> AFAIK, this new set is complete in that it covers every imaginable case of
> tree conflicts, for all of update, switch and merge.
> 
> I started off with sbutler's new (unfinished) test scheme which is already
> committed on the tree-conflicts branch, and took it to a workable state. I
> removed the old file-based tests, after checking for identical results.
> 
> Currently, most of these new tests still yield undesirable results. The
> course that I aim for is this:
> 
>  1) Commit the new tree-conflicts tests, so that they PASS the current
>     tree-conflicts branch, even though many test results are still
>     undesirable. (This patch)
> 
>  2) One by one, look at the undesirable results and fix them in subsequent
>     patches. Patches should both fix the situation and make the tests
>     pass the fixed situation.
> 
> So, as mentioned, this patch passes the current situation on the
> tree-conflicts branch. But, one test case cannot be passed, because it fails
> in a segmentation fault!
> 
> I have investigated this and posted a preliminary patch in another mail:
> http://subversion.tigris.org/servlets/ReadMsg?listName=dev&msgNo=141887
> 
> I would like this patch to be committed on the tree-conflicts branch, so
> that continuing work on fixing tree-conflicts situations can be comprehensive.
> 
> Thanks!
> 
> [[[
> Replacing file-based tree-conflicts cmdline tests. The new tests are
> concerned with directory *and* file victims, in different tree depths.
> Contains new tests for update, switch and merge operations.
> 
> * subversion/tests/cmdline/svntest/actions.py
>   (set_up_tree_conflicts): Remove old helper for update, switch.
>   (set_up_tree_conflicts_for_merge): Remove old helper for merge.
>   (make_tc_test_trees): Rename and split new helper into make_deep_trees()
>     and add_deep_trees().
>   (tc_leaf_del): Rename new helper to deep_trees_leaf_del().
>   (tc_tree_del): Rename new helper to deep_trees_tree_del().
>   (tc_tree_del): Rename new helper to deep_trees_tree_del().
>   (tc_text_append): Rename new helper to deep_trees_leaf_edit().
>   (set_up_deep_tree_conflicts_up): Remove function, its purpose replaced by
>     deep_trees_run_tests_scheme_for_update().
>   (set_up_deep_tree_conflicts_sw): Remove function, its purpose replaced by
>     deep_trees_run_tests_scheme_for_switch().
>   (add_deep_trees): New function, replacing make_tc_test_trees().
>   (make_deep_trees): New function, used by add_deep_trees().
>   (deep_trees_virginal_state): New wc.State structure.
>   (deep_trees_leaf_edit): New function.
>   (deep_trees_after_leaf_edit): New wc.State structure.
>   (deep_trees_leaf_del): New function.
>   (deep_trees_after_leaf_del): New wc.State structure.
>   (deep_trees_tree_del): New function.
>   (deep_trees_after_tree_del): New wc.State structure.
>   (DeepTreesTestCase): New class.
>   (deep_trees_run_tests_scheme_for_update): New function.
>   (deep_trees_run_tests_scheme_for_switch): New function.
>   (deep_trees_run_tests_scheme_for_merge): New function.
> 
> * subversion/tests/cmdline/update_tests.py
>   (tree_conflicts_in_updated_files): Remove old test, replaced by
>     tree_conflicts_on_update().
>   (tree_conflicts_on_update): New test, replacing
>     tree_conflicts_in_updated_files(). Adds directory victims, and
>     conflicts in different tree depths.
> 
> * subversion/tests/cmdline/switch_tests.py
>   (tree_conflicts_in_switched_files): Remove old test, replaced by
>     tree_conflicts_on_switch().
>   (tree_conflicts_on_switch): New test, replacing
>     tree_conflicts_in_switched_files(). Adds directory victims, and
>     conflicts in different tree depths.
> 
> * subversion/tests/cmdline/merge_tests.py
>   (tree_conflicts_in_merged_files): Remove old test, replaced by
>     tree_conflicts_on_merge().
>   (tree_conflicts_on_merge): New test, replacing
>     tree_conflicts_in_merged_files(). Adds directory victims, and conflicts
>     in different tree depths. Adds another case to the old merge test,
>     namely omitting a local commit.
> ]]]
> 
> 
> 

-- 
Neels Hofmeyr -- elego Software Solutions GmbH
Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
phone: +49 30 23458696  mobile: +49 177 2345869  fax: +49 30 23458695
http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
Handelsreg: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194

Re: tree-conflicts: patch for improved cmdline tests

Posted by Julian Foad <ju...@btopenworld.com>.
On Tue, 2008-08-19 at 10:47 -0400, Mark Phippard wrote:
> On Tue, Aug 19, 2008 at 10:29 AM, Karl Fogel <kf...@red-bean.com> wrote:
> > "Greg Stein" <gs...@gmail.com> writes:
> >> Yeah. XFail seems the right way to go.
> >>
> >> I'd prefer to see these tests added to trunk rather than the branch.
> >> More testing on the trunk never seems bad :-)  And it isn't like
> >> they'll interfere with any other trunk development or break something
> >> in trunk. But they *can* help with other dev that might be happening
> >> there.
> >>
> >> Thoughts?
> >>
> >> (my one possible "con": working on both trunk and a branch, but that
> >> might be an okay thing)
> >
> > I'd always thought our principle was that every change should go to
> > trunk unless there's a specific reason why it must go on a branch.
> >
> > For example, that means that if you're working on a feature branch and
> > you encounter some buglet that interferes with the feature work, you
> > still fix the buglet on trunk and port the change over to the branch
> > (because the buglet is not "about" the branch work, it just interferes
> > with the branch work).
> >
> > So unless there's a reason why these tests would cause trouble on trunk,
> > let's put 'em on trunk, the natural home of all changes :-).
> 
> It does not make sense to me that if you are developing a new feature
> on a branch, you would write the tests for this feature on trunk.
> Isn't that kind of burdensome and unnatural for the developer?

It kind of depends on whether the test is for some behaviour that the
trunk almost provides, but gets wrong, in which case you can reasonably
write an XFail test for it; or whether the test is for some new feature
that you can't even issue commands for because the feature isn't
available on trunk.

In this particular case, Mark, I think you're right that they make more
sense on the branch because although we *can* issue the commands to test
a tree-conflict scenario on trunk, the "right" behaviour is not fully
defined yet so the tests are necessarily still under development along
with the feature implementation.

- Julian



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: tree-conflicts: patch for improved cmdline tests

Posted by Karl Fogel <kf...@red-bean.com>.
"Mark Phippard" <ma...@gmail.com> writes:
> It does not make sense to me that if you are developing a new feature
> on a branch, you would write the tests for this feature on trunk.
> Isn't that kind of burdensome and unnatural for the developer?

Depends on the test.  If it tests only something new on that branch,
then yeah.  But if it's a test about something that also exists on
trunk, then it should start life on trunk.

I guess I'm mixing up two unrelated issues.  One, it worries me that the
tree-conflicts branch has spent so much time off trunk (this is
something that worries stsp, julian, et al, too I think).  Two, on a lot
of branches I see changes (sometimes including tests) that could be made
on trunk get made on the branch instead.

So sure, if the test is completely branch-specific, then commit it to
the branch.  But let's also try to get that branch into trunk sooner
rather than later!  It doesn't have to be perfect to be merged.

-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: tree-conflicts: patch for improved cmdline tests

Posted by Mark Phippard <ma...@gmail.com>.
On Tue, Aug 19, 2008 at 10:29 AM, Karl Fogel <kf...@red-bean.com> wrote:
> "Greg Stein" <gs...@gmail.com> writes:
>> Yeah. XFail seems the right way to go.
>>
>> I'd prefer to see these tests added to trunk rather than the branch.
>> More testing on the trunk never seems bad :-)  And it isn't like
>> they'll interfere with any other trunk development or break something
>> in trunk. But they *can* help with other dev that might be happening
>> there.
>>
>> Thoughts?
>>
>> (my one possible "con": working on both trunk and a branch, but that
>> might be an okay thing)
>
> I'd always thought our principle was that every change should go to
> trunk unless there's a specific reason why it must go on a branch.
>
> For example, that means that if you're working on a feature branch and
> you encounter some buglet that interferes with the feature work, you
> still fix the buglet on trunk and port the change over to the branch
> (because the buglet is not "about" the branch work, it just interferes
> with the branch work).
>
> So unless there's a reason why these tests would cause trouble on trunk,
> let's put 'em on trunk, the natural home of all changes :-).

It does not make sense to me that if you are developing a new feature
on a branch, you would write the tests for this feature on trunk.
Isn't that kind of burdensome and unnatural for the developer?

-- 
Thanks

Mark Phippard
http://markphip.blogspot.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: tree-conflicts: patch for improved cmdline tests

Posted by Karl Fogel <kf...@red-bean.com>.
"Greg Stein" <gs...@gmail.com> writes:
> Yeah. XFail seems the right way to go.
>
> I'd prefer to see these tests added to trunk rather than the branch.
> More testing on the trunk never seems bad :-)  And it isn't like
> they'll interfere with any other trunk development or break something
> in trunk. But they *can* help with other dev that might be happening
> there.
>
> Thoughts?
>
> (my one possible "con": working on both trunk and a branch, but that
> might be an okay thing)

I'd always thought our principle was that every change should go to
trunk unless there's a specific reason why it must go on a branch.

For example, that means that if you're working on a feature branch and
you encounter some buglet that interferes with the feature work, you
still fix the buglet on trunk and port the change over to the branch
(because the buglet is not "about" the branch work, it just interferes
with the branch work).

So unless there's a reason why these tests would cause trouble on trunk,
let's put 'em on trunk, the natural home of all changes :-).

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: tree-conflicts: patch for improved cmdline tests

Posted by Greg Stein <gs...@gmail.com>.
On Sun, Aug 17, 2008 at 6:22 AM, Stefan Sperling <st...@elego.de> wrote:
>...
> note that there's also XFail(), which can be used to mark
> tests which are expected to fail.
>
> In this case, almost every test would need to be flagged XFail.
> However, migrating tests from XFail to PASS by changing Subversion's
> code only might be less confusing than migrating tests from PASS
> to PASS by changing both Subversion's code and the test in the same go.

Yeah. XFail seems the right way to go.

I'd prefer to see these tests added to trunk rather than the branch.
More testing on the trunk never seems bad :-)  And it isn't like
they'll interfere with any other trunk development or break something
in trunk. But they *can* help with other dev that might be happening
there.

Thoughts?

(my one possible "con": working on both trunk and a branch, but that
might be an okay thing)

Cheers,
-g

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: tree-conflicts: patch for improved cmdline tests

Posted by Julian Foad <ju...@btopenworld.com>.
On Sun, 2008-08-17 at 22:20 +0200, Neels Janosch Hofmeyr wrote:
> Stefan Sperling wrote:
> > On Sun, Aug 17, 2008 at 02:36:48PM +0200, Neels Janosch Hofmeyr wrote:
> >> Currently, most of these new tests still yield undesirable results. The
> >> course that I aim for is this:
> >>
> >>  1) Commit the new tree-conflicts tests, so that they PASS the current
> >>     tree-conflicts branch, even though many test results are still
> >>     undesirable. (This patch)
> > 
> > Hey Neels,
> > 
> > note that there's also XFail(), which can be used to mark
> > tests which are expected to fail.
> > 
> > In this case, almost every test would need to be flagged XFail.
> > However, migrating tests from XFail to PASS by changing Subversion's
> > code only might be less confusing than migrating tests from PASS
> > to PASS by changing both Subversion's code and the test in the same go.
> > 
> > The net result is the same.
> > 
> > But I assume that we don't really know yet what the desired
> > result actually is for many cases, right? :)
> > 
> >>  2) One by one, look at the undesirable results and fix them in subsequent
> >>     patches. Patches should both fix the situation and make the tests
> >>     pass the fixed situation.
> > 
> > Maybe make that 3 steps?
> > 
> > 1) Have tons of tests that PASS the current state of things (this patch)
> > 
> > for test in tests:
> >   2) Figure out what the desired result for $test should be,
> >      make $test check for that and mark it XFail.
> >   3) Implement desired behaviour in Subversion's code, making
> >      $test PASS, and remove its XFail status.
> 
> I would prefer taking the results one by one, adjusting the tests one by
> one, because that clarifies the current development:
> 
> - As soon as you have fixed the one issue you were addressing, the tests
> PASS again.
> 
> - It is easier to see how one fix affects other situations that hadn't been
> considered. As soon as something "else" is changed, another test fails.
> 
> Given the complexity of tree-conflicts, it's nice to have some clarity...
> 
> For this way of action, XFail is not useful, since I want the tests to pass
> exactly when I have got the fix right. Also, it would be nice to not have
> segmentation faults around. So that's my first fix candidate.

Did you know that a test marked as "XFail" reports a result of "XFAIL"
when it fails, and "XPASS" ("unexpected pass") when it passes? In this
way we can see when we have fixed a bug for which we wrote a test
earlier.

- Julian



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: tree-conflicts: patch for improved cmdline tests

Posted by Neels Janosch Hofmeyr <ne...@elego.de>.
Stefan Sperling wrote:
> On Sun, Aug 17, 2008 at 02:36:48PM +0200, Neels Janosch Hofmeyr wrote:
>> Currently, most of these new tests still yield undesirable results. The
>> course that I aim for is this:
>>
>>  1) Commit the new tree-conflicts tests, so that they PASS the current
>>     tree-conflicts branch, even though many test results are still
>>     undesirable. (This patch)
> 
> Hey Neels,
> 
> note that there's also XFail(), which can be used to mark
> tests which are expected to fail.
> 
> In this case, almost every test would need to be flagged XFail.
> However, migrating tests from XFail to PASS by changing Subversion's
> code only might be less confusing than migrating tests from PASS
> to PASS by changing both Subversion's code and the test in the same go.
> 
> The net result is the same.
> 
> But I assume that we don't really know yet what the desired
> result actually is for many cases, right? :)
> 
>>  2) One by one, look at the undesirable results and fix them in subsequent
>>     patches. Patches should both fix the situation and make the tests
>>     pass the fixed situation.
> 
> Maybe make that 3 steps?
> 
> 1) Have tons of tests that PASS the current state of things (this patch)
> 
> for test in tests:
>   2) Figure out what the desired result for $test should be,
>      make $test check for that and mark it XFail.
>   3) Implement desired behaviour in Subversion's code, making
>      $test PASS, and remove its XFail status.

I would prefer taking the results one by one, adjusting the tests one by
one, because that clarifies the current development:

- As soon as you have fixed the one issue you were addressing, the tests
PASS again.

- It is easier to see how one fix affects other situations that hadn't been
considered. As soon as something "else" is changed, another test fails.

Given the complexity of tree-conflicts, it's nice to have some clarity...

For this way of action, XFail is not useful, since I want the tests to pass
exactly when I have got the fix right. Also, it would be nice to not have
segmentation faults around. So that's my first fix candidate.

> 
>> So, as mentioned, this patch passes the current situation on the
>> tree-conflicts branch. But, one test case cannot be passed, because it fails
>> in a segmentation fault!
> 
> That is bad.
>  
>> I have investigated this and posted a preliminary patch in another mail:
>> http://subversion.tigris.org/servlets/ReadMsg?listName=dev&msgNo=141887
> 
> Steve and Julian, could one of you take a look at this? 
> 
>> I would like this patch to be committed on the tree-conflicts branch, so
>> that continuing work on fixing tree-conflicts situations can be comprehensive.
> 
> I'll leave that to Steve and Julian as well, as I'm bound up
> with other things at the moment.

Did I read a +1 between the lines here? ;)

Thanks!
Neels

-- 
Neels Hofmeyr -- elego Software Solutions GmbH
Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
phone: +49 30 23458696  mobile: +49 177 2345869  fax: +49 30 23458695
http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
Handelsreg: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194


Re: tree-conflicts: patch for improved cmdline tests

Posted by Stefan Sperling <st...@elego.de>.
On Sun, Aug 17, 2008 at 02:36:48PM +0200, Neels Janosch Hofmeyr wrote:
> Currently, most of these new tests still yield undesirable results. The
> course that I aim for is this:
> 
>  1) Commit the new tree-conflicts tests, so that they PASS the current
>     tree-conflicts branch, even though many test results are still
>     undesirable. (This patch)

Hey Neels,

note that there's also XFail(), which can be used to mark
tests which are expected to fail.

In this case, almost every test would need to be flagged XFail.
However, migrating tests from XFail to PASS by changing Subversion's
code only might be less confusing than migrating tests from PASS
to PASS by changing both Subversion's code and the test in the same go.

The net result is the same.

But I assume that we don't really know yet what the desired
result actually is for many cases, right? :)

>  2) One by one, look at the undesirable results and fix them in subsequent
>     patches. Patches should both fix the situation and make the tests
>     pass the fixed situation.

Maybe make that 3 steps?

1) Have tons of tests that PASS the current state of things (this patch)

for test in tests:
  2) Figure out what the desired result for $test should be,
     make $test check for that and mark it XFail.
  3) Implement desired behaviour in Subversion's code, making
     $test PASS, and remove its XFail status.

> So, as mentioned, this patch passes the current situation on the
> tree-conflicts branch. But, one test case cannot be passed, because it fails
> in a segmentation fault!

That is bad.
 
> I have investigated this and posted a preliminary patch in another mail:
> http://subversion.tigris.org/servlets/ReadMsg?listName=dev&msgNo=141887

Steve and Julian, could one of you take a look at this? 

> I would like this patch to be committed on the tree-conflicts branch, so
> that continuing work on fixing tree-conflicts situations can be comprehensive.

I'll leave that to Steve and Julian as well, as I'm bound up
with other things at the moment.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org