subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1771118 - in /subversion/trunk/subversion/tests/cmdline: import_tests.py import_tests_data/
Date Thu, 24 Nov 2016 11:46:13 GMT
Author: julianfoad
Date: Thu Nov 24 11:46:13 2016
New Revision: 1771118

URL: http://svn.apache.org/viewvc?rev=1771118&view=rev
Log:
Make the test suite work when checked out of a git repository, by not
requiring empty directories.

Subversion's import tests test behavior when importing empty
directories. These empty directories are checked in as part of
our test data. This however breaks our import tests when using
Subversion's Git mirror at git.apache.org, as Git is unable to
version empty directories.

As our tests rely on the fact that these directories are indeed
empty it is not possible to work around the issue by creating a
`.gitkeep` file inside these directories, as is commonly done
with git. Instead, the issue is fixed inside the tests itself by
creating the test data at run time.

* subversion/tests/cmdline/import_tests.py:
  (import_inherited_ignores): Create the tree to be imported at run time.
* subversion/tests/cmdline/import_tests_data
  Delete.

Suggested by: Patrick Steinhardt

Removed:
    subversion/trunk/subversion/tests/cmdline/import_tests_data/
Modified:
    subversion/trunk/subversion/tests/cmdline/import_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/import_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/import_tests.py?rev=1771118&r1=1771117&r2=1771118&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/import_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/import_tests.py Thu Nov 24 11:46:13 2016
@@ -446,8 +446,7 @@ def import_inherited_ignores(sbox):
   #   DIR7
   #     file7.foo
   #     DIR8.noo
-  import_tree_dir = os.path.join(os.path.dirname(sys.argv[0]),
-                                 'import_tests_data', 'import_tree')
+  import_tree_dir = os.path.join(tmp_dir, 'import_tree_' + sbox.name)
 
   # Relative WC paths of the imported tree.
   dir1_path  = os.path.join('DIR1.noo')
@@ -466,6 +465,33 @@ def import_inherited_ignores(sbox):
   file7_path = os.path.join('DIR6', 'DIR7', 'file7.foo')
   dir8_path  = os.path.join('DIR6', 'DIR7', 'DIR8.noo')
 
+  import_dirs = [
+    dir1_path,
+    dir2_path,
+    dir3_path,
+    dir4_path,
+    dir5_path,
+    dir6_path,
+    dir7_path,
+    dir8_path,
+    ]
+  import_files = [
+    file1_path,
+    file2_path,
+    file3_path,
+    file4_path,
+    file5_path,
+    file6_path,
+    file7_path,
+    ]
+
+  # Create the (unversioned) tree to be imported.
+  os.mkdir(import_tree_dir)
+  for p in import_dirs:
+    os.mkdir(os.path.join(import_tree_dir, p))
+  for p in import_files:
+    svntest.main.file_write(os.path.join(import_tree_dir, p), 'A file')
+
   # Import the tree to ^/A/B/E.
   # We should not see any *.noo paths because those are blocked at the
   # root of the repository by the svn:global-ignores property.  Likewise



Mime
View raw message