You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2015/03/18 13:33:04 UTC

svn commit: r1667524 - /subversion/trunk/subversion/tests/libsvn_fs/fs-test.c

Author: stefan2
Date: Wed Mar 18 12:33:03 2015
New Revision: 1667524

URL: http://svn.apache.org/r1667524
Log:
A few FSFS-only tests apply to FSX just as well.  So, run them for
any non-BDBD repo.

* subversion/tests/libsvn_fs/fs-test.c
  (test_fsfs_config_opts): Rename to ...
  (test_create_with_config_opts): ... this. Skip for BDB only.
  (test_modify_txn_being_written): Skip for BDB only.
  (test_funcs): Update function name and test descriptions.

Modified:
    subversion/trunk/subversion/tests/libsvn_fs/fs-test.c

Modified: subversion/trunk/subversion/tests/libsvn_fs/fs-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_fs/fs-test.c?rev=1667524&r1=1667523&r2=1667524&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_fs/fs-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_fs/fs-test.c Wed Mar 18 12:33:03 2015
@@ -6713,8 +6713,8 @@ test_fs_merge(const svn_test_opts_t *opt
 }
 
 static svn_error_t *
-test_fsfs_config_opts(const svn_test_opts_t *opts,
-                      apr_pool_t *pool)
+test_create_with_config_opts(const svn_test_opts_t *opts,
+                             apr_pool_t *pool)
 {
   apr_hash_t *fs_config;
   svn_fs_t *fs;
@@ -6722,9 +6722,9 @@ test_fsfs_config_opts(const svn_test_opt
   const svn_fs_fsfs_info_t *fsfs_info;
 
   /* Bail (with SKIP) on known-untestable scenarios */
-  if (strcmp(opts->fs_type, "fsfs") != 0)
+  if (strcmp(opts->fs_type, SVN_FS_TYPE_BDB) == 0)
     return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL,
-                            "this will test FSFS repositories only");
+                            "this will not test BDB repositories");
 
   /* Remove the test directory from previous runs. */
   SVN_ERR(svn_io_remove_dir2("test-fsfs-config-opts", TRUE, NULL, NULL, pool));
@@ -6828,9 +6828,9 @@ test_modify_txn_being_written(const svn_
   svn_stream_t *bar_contents;
 
   /* Bail (with success) on known-untestable scenarios */
-  if (strcmp(opts->fs_type, SVN_FS_TYPE_FSFS) != 0)
+  if (strcmp(opts->fs_type, SVN_FS_TYPE_BDB) == 0)
     return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL,
-                            "this will test FSFS repositories only");
+                            "this will not test BDB repositories");
 
   /* Create a new repo. */
   SVN_ERR(svn_test__create_fs(&fs, "test-modify-txn-being-written",
@@ -7106,12 +7106,12 @@ static struct svn_test_descriptor_t test
                        "get a delta stream on a file"),
     SVN_TEST_OPTS_PASS(test_fs_merge,
                        "get merging txns with newer revisions"),
-    SVN_TEST_OPTS_PASS(test_fsfs_config_opts,
-                       "test creating FSFS repository with different opts"),
+    SVN_TEST_OPTS_PASS(test_create_with_config_opts,
+                       "test creating a repository with different opts"),
     SVN_TEST_OPTS_PASS(test_txn_pool_lifetime,
                        "test pool lifetime dependencies with txn roots"),
     SVN_TEST_OPTS_PASS(test_modify_txn_being_written,
-                       "test modify txn being written in FSFS"),
+                       "test modify txn being written"),
     SVN_TEST_OPTS_PASS(test_prop_and_text_rep_sharing_collision,
                        "test property and text rep-sharing collision"),
     SVN_TEST_OPTS_PASS(test_internal_txn_props,



Re: svn commit: r1667524 - /subversion/trunk/subversion/tests/libsvn_fs/fs-test.c

Posted by Stefan Fuhrmann <st...@wandisco.com>.
On Thu, Mar 19, 2015 at 10:34 AM, Evgeny Kotkov <evgeny.kotkov@visualsvn.com
> wrote:

> Stefan Fuhrmann <st...@apache.org> writes:
>
> >  static svn_error_t *
> > -test_fsfs_config_opts(const svn_test_opts_t *opts,
> > -                      apr_pool_t *pool)
> > +test_create_with_config_opts(const svn_test_opts_t *opts,
> > +                             apr_pool_t *pool)
> >  {
> >    apr_hash_t *fs_config;
> >    svn_fs_t *fs;
> > @@ -6722,9 +6722,9 @@ test_fsfs_config_opts(const svn_test_opt
> >    const svn_fs_fsfs_info_t *fsfs_info;
> >
> >    /* Bail (with SKIP) on known-untestable scenarios */
> > -  if (strcmp(opts->fs_type, "fsfs") != 0)
> > +  if (strcmp(opts->fs_type, SVN_FS_TYPE_BDB) == 0)
> >      return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL,
> > -                            "this will test FSFS repositories only");
> > +                            "this will not test BDB repositories");
>
> Is there a reason to run this test with --fs-type=fsx?  I think we'd be
> just
> wasting time here, because the test itself doesn't rely on opts->fs_type,
> and everything it does is FSFS-specific.
>
> When creating file systems in this test, we specify SVN_FS_TYPE_FSFS and
> FSFS-specific config options; when checking what we've got, we downcast the
> information structure to an FSFS-specific svn_fs_fsfs_info_t.  I think
> that the
> test was designed to run only with --fs-type=fsfs.
>

You are right, I missed that it is hard-coded to use FSFS.
Reverted to FSFS-only execution in r1668117.

I simply wanted to remove as many fs type restrictions
as possible, i.e. maximize coverage, w/o making the test
fail.

Am I missing something?
>

Tests that are truly backend-specific should go into the
respective libsvn_fs_* folder. There is also a bit of test
duplication between FSFS and FSX there that should be
moved to FS. When I find time & energy, I might sort
that out for 1.10. Patches are welcome.

-- Stefan^2.

Re: svn commit: r1667524 - /subversion/trunk/subversion/tests/libsvn_fs/fs-test.c

Posted by Evgeny Kotkov <ev...@visualsvn.com>.
Stefan Fuhrmann <st...@apache.org> writes:

>  static svn_error_t *
> -test_fsfs_config_opts(const svn_test_opts_t *opts,
> -                      apr_pool_t *pool)
> +test_create_with_config_opts(const svn_test_opts_t *opts,
> +                             apr_pool_t *pool)
>  {
>    apr_hash_t *fs_config;
>    svn_fs_t *fs;
> @@ -6722,9 +6722,9 @@ test_fsfs_config_opts(const svn_test_opt
>    const svn_fs_fsfs_info_t *fsfs_info;
>
>    /* Bail (with SKIP) on known-untestable scenarios */
> -  if (strcmp(opts->fs_type, "fsfs") != 0)
> +  if (strcmp(opts->fs_type, SVN_FS_TYPE_BDB) == 0)
>      return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL,
> -                            "this will test FSFS repositories only");
> +                            "this will not test BDB repositories");

Is there a reason to run this test with --fs-type=fsx?  I think we'd be just
wasting time here, because the test itself doesn't rely on opts->fs_type,
and everything it does is FSFS-specific.

When creating file systems in this test, we specify SVN_FS_TYPE_FSFS and
FSFS-specific config options; when checking what we've got, we downcast the
information structure to an FSFS-specific svn_fs_fsfs_info_t.  I think that the
test was designed to run only with --fs-type=fsfs.

Am I missing something?


Regards,
Evgeny Kotkov