[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Don't use XFAIL for unwritten tests; also rm redundant test runs

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2006-03-26 22:01:09 CEST

"XFail" is intended to mean that a test is failing because of a known bug or
deficiency in Subversion. I noticed that some tests were using it as a way of
inserting a place-holder for a test which might one day be written. This patch
removes those place-holders.

There's one possible ill effect: the test index numbers of some existing tests
are changed by this patch. I think that's acceptable; certainly we have at
times inserted new tests into the sequence, and tests/cmdline/README doesn't
say we should avoid changing test numbers. If anyone thinks this is a problem
then we'd better invent an "unused test" marker; I considered using "Skip" but
that's not right.

This patch also removes the redundant running of six tests in schedule_tests.py
that are also called within later tests in that same file. Although it can be
handy to have a different test number for each possible type of failure, having
the test suite run in a reasonably short time is important and outweighs the
benefit in this case.

- Julian

Remove "XFail" where it was used inappropriately for tests that have not been
written, and remove some redundant re-testing.

* subversion/tests/cmdline/schedule_tests.py
  Rewrite the comment describing the first set of tests, to reflect this
    reorganisation.
  (commit_add_files, commit_add_directories, commit_nested_adds,
   commit_add_executable, commit_delete_files, commit_delete_dirs):
    Delete these unwritten test stubs.
  (test_list): Remove the six Stage I tests because they are duplicated in
    Stage II, and the six unwritten Stage III tests (which were marked XFail).

* subversion/tests/cmdline/trans_tests.py
  (enable_translation, checkout_translation, disable_translation): Comment out
    these unwritten test stubs.
  (test_list): Comment out those three tests (which were marked XFail).

Index: subversion/tests/cmdline/schedule_tests.py
===================================================================
--- subversion/tests/cmdline/schedule_tests.py (revision 19040)
+++ subversion/tests/cmdline/schedule_tests.py (working copy)
@@ -35,19 +35,17 @@
 #
 # Each test must return on success or raise on failure.
 #
-# NOTE: Tests in this section should be written in triplets. First
-# compose a test which make schedule changes and local mods, and
-# verifies that status output is as expected. Secondly, compose a
-# test which calls the first test (to do all the dirty work), then
-# test reversion of those changes. Finally, compose a third test
-# which, again, calls the first test to "set the stage", and then
-# commit those changes.
-#
-#----------------------------------------------------------------------
 
 #######################################################################
 # Stage I - Schedules and modifications, verified with `svn status'
 #
+# These tests make schedule changes and local mods, and verify that status
+# output is as expected. In a second stage, reversion of these changes is
+# tested. Potentially, a third stage could test committing these same
+# changes.
+#
+# NOTE: these tests are run within the Stage II tests, not on their own.
+#
 
 def add_files(sbox):
   "schedule: add some files"
@@ -249,6 +247,9 @@
 #######################################################################
 # Stage II - Reversion of changes made in Stage I
 #
+# Each test in Stage II calls the corresponding Stage I test
+# and then also tests reversion of those changes.
+#
 
 def check_reversion(files, output):
   expected_output = []
@@ -383,63 +384,11 @@
                                                    '--recursive', wc_dir)
   check_reversion(files, output)
 
+
 #######################################################################
-# Stage III - Commit of modifications made in Stage 1
+# Regression tests
 #
 
-def commit_add_files(sbox):
- "commit: add some files"
-
- add_files(sbox)
-
- raise svntest.Failure
-
-#----------------------------------------------------------------------
-
-def commit_add_directories(sbox):
- "commit: add some directories"
-
- add_directories(sbox)
-
- raise svntest.Failure
-
-#----------------------------------------------------------------------
-
-def commit_nested_adds(sbox):
- "commit: add some nested files and directories"
-
- nested_adds(sbox)
-
- raise svntest.Failure
-
-#----------------------------------------------------------------------
-
-def commit_add_executable(sbox):
- "commit: add some executable files"
-
- add_executable(sbox)
-
- raise svntest.Failure
-
-
-#----------------------------------------------------------------------
-
-def commit_delete_files(sbox):
- "commit: delete some files"
-
- delete_files(sbox)
-
- raise svntest.Failure
-
-#----------------------------------------------------------------------
-
-def commit_delete_dirs(sbox):
- "commit: delete some directories"
-
- delete_dirs(sbox)
-
- raise svntest.Failure
-
 #----------------------------------------------------------------------
 # Regression test for issue #863:
 #
@@ -685,24 +634,12 @@
 
 # list all tests here, starting with None:
 test_list = [ None,
- add_files,
- add_directories,
- nested_adds,
- Skip(add_executable, (os.name != 'posix')),
- delete_files,
- delete_dirs,
               revert_add_files,
               revert_add_directories,
               revert_nested_adds,
               Skip(revert_add_executable, (os.name != 'posix')),
               revert_delete_files,
               revert_delete_dirs,
- XFail(commit_add_files),
- XFail(commit_add_directories),
- XFail(commit_nested_adds),
- Skip(XFail(commit_add_executable), (os.name != 'posix')),
- XFail(commit_delete_files),
- XFail(commit_delete_dirs),
               unschedule_missing_added,
               delete_missing,
               revert_inside_newly_added_dir,
Index: subversion/tests/cmdline/trans_tests.py
===================================================================
--- subversion/tests/cmdline/trans_tests.py (revision 19040)
+++ subversion/tests/cmdline/trans_tests.py (working copy)
@@ -349,33 +349,31 @@
     print "Id expansion failed for", id_with_space_path
     raise svntest.Failure
   fp.close()
-
-def enable_translation(sbox):
- "enable translation, check status, commit"
 
- raise svntest.Failure
+#----------------------------------------------------------------------
+
+#def enable_translation(sbox):
+# "enable translation, check status, commit"
+
   # TODO: Turn on newline conversion and/or keyword substitution for all
   # sorts of files, with and without local mods, and verify that
   # status shows the right stuff. The, commit those mods.
 
 #----------------------------------------------------------------------
 
-def checkout_translated():
- "checkout files that have translation enabled"
+#def checkout_translated():
+# "checkout files that have translation enabled"
 
- raise svntest.Failure
   # TODO: Checkout a tree which contains files with translation
   # enabled.
 
 #----------------------------------------------------------------------
 
-def disable_translation():
- "disable translation, check status, commit"
+#def disable_translation():
+# "disable translation, check status, commit"
 
- raise svntest.Failure
   # TODO: Disable translation on files which have had it enabled,
   # with and without local mods, check status, and commit.
-
 
 #----------------------------------------------------------------------
 
@@ -757,9 +755,9 @@
 # list all tests here, starting with None:
 test_list = [ None,
               keywords_from_birth,
- XFail(enable_translation),
- XFail(checkout_translated),
- XFail(disable_translation),
+ # enable_translation,
+ # checkout_translated,
+ # disable_translation,
               update_modified_with_translation,
               eol_change_is_text_mod,
               keyword_expanded_on_checkout,

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Mar 26 22:01:31 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.