浏览代码

Revert "Add missing test (#911)" which accidentally included unrelated changes.

This reverts commit bf1e8bc44ec460980fad19372c04eb37c039fa1f.
Dan Helfman 8 月之前
父节点
当前提交
34305d686c
共有 5 个文件被更改,包括 12 次插入35 次删除
  1. 1 1
      NEWS
  2. 1 1
      borgmatic/borg/create.py
  3. 6 7
      docs/how-to/backup-your-databases.md
  4. 4 3
      tests/unit/borg/test_create.py
  5. 0 23
      tests/unit/commands/test_borgmatic.py

+ 1 - 1
NEWS

@@ -1,7 +1,7 @@
 1.8.15.dev0
  * #911: Add a "key change-passphrase" action to change the passphrase protecting a repository key.
  * #915: Rename repository actions like "rcreate" to more explicit names like "repo-create" for
-   compatibility with recent changes in Borg 2.0.0b10.
+   compatibility with recent Borg 2 changes.
 
 1.8.14
  * #896: Fix an error in borgmatic rcreate/init on an empty repository directory with Borg 1.4.

+ 1 - 1
borgmatic/borg/create.py

@@ -431,7 +431,7 @@ def make_base_create_command(
         + (('--compression', compression) if compression else ())
         + upload_ratelimit_flags
         + (('--upload-buffer', str(upload_buffer_size)) if upload_buffer_size else ())
-        + (('--one-file-system',) if config.get('one_file_system') else ())
+        + (('--one-file-system',) if config.get('one_file_system') or stream_processes else ())
         + numeric_ids_flags
         + atime_flags
         + (('--noctime',) if config.get('ctime') is False else ())

+ 6 - 7
docs/how-to/backup-your-databases.md

@@ -466,14 +466,13 @@ exclude them. <span class="minilink minilink-addedin">Prior to version
 1.7.3</span>Special files were not auto-excluded, and you were responsible for
 excluding them yourself. Common directories to exclude are `/dev` and `/run`,
 but that may not be exhaustive.
-5. <span class="minilink minilink-addedin">Prior to version 1.8.15</span>
-Database hooks also implicitly enabled the `one_file_system` option, which
-meant Borg wouldn't cross filesystem boundaries when looking for files to
-backup. When borgmatic was running in a container, this often required a
-work-around to explicitly add each mounted backup volume to
+5. Database hooks also implicitly enable the `one_file_system` option, which
+means Borg won't cross filesystem boundaries when looking for files to backup.
+This is especially important when running borgmatic in a container, as
+container volumes are mounted as separate filesystems. One work-around is to
+explicitly add each mounted volume you'd like to backup to
 `source_directories` instead of relying on Borg to include them implicitly via
-a parent directory. However, as of borgmatic 1.8.15, `one_file_system` is no
-longer auto-enabled and such work-arounds aren't necessary.
+a parent directory.
 
 
 ### Manual restoration

+ 4 - 3
tests/unit/borg/test_create.py

@@ -989,7 +989,7 @@ def test_make_base_create_command_with_stream_processes_ignores_read_special_fal
         )
     )
 
-    assert create_flags == ('borg', 'create', '--read-special')
+    assert create_flags == ('borg', 'create', '--one-file-system', '--read-special')
     assert create_positional_arguments == REPO_ARCHIVE_WITH_PATHS
     assert not pattern_file
     assert exclude_file
@@ -1031,7 +1031,7 @@ def test_make_base_create_command_with_stream_processes_and_read_special_true_sk
         )
     )
 
-    assert create_flags == ('borg', 'create', '--read-special')
+    assert create_flags == ('borg', 'create', '--one-file-system', '--read-special')
     assert create_positional_arguments == REPO_ARCHIVE_WITH_PATHS
     assert not pattern_file
     assert not exclude_file
@@ -1750,7 +1750,7 @@ def test_create_archive_with_progress_and_stream_processes_calls_borg_with_progr
     flexmock(module).should_receive('collect_borgmatic_source_directories').and_return([])
     flexmock(module).should_receive('make_base_create_command').and_return(
         (
-            ('borg', 'create', '--read-special'),
+            ('borg', 'create', '--one-file-system', '--read-special'),
             REPO_ARCHIVE_WITH_PATHS,
             flexmock(),
             flexmock(),
@@ -1760,6 +1760,7 @@ def test_create_archive_with_progress_and_stream_processes_calls_borg_with_progr
     create_command = (
         'borg',
         'create',
+        '--one-file-system',
         '--read-special',
         '--progress',
     ) + REPO_ARCHIVE_WITH_PATHS

+ 0 - 23
tests/unit/commands/test_borgmatic.py

@@ -981,29 +981,6 @@ def test_run_actions_runs_export_key():
     )
 
 
-def test_run_actions_runs_change_passphrase():
-    flexmock(module).should_receive('add_custom_log_levels')
-    flexmock(module).should_receive('get_skip_actions').and_return([])
-    flexmock(module.command).should_receive('execute_hook')
-    flexmock(borgmatic.actions.change_passphrase).should_receive('run_change_passphrase').once()
-
-    tuple(
-        module.run_actions(
-            arguments={
-                'global': flexmock(dry_run=False, log_file='foo'),
-                'change-passphrase': flexmock(),
-            },
-            config_filename=flexmock(),
-            config={'repositories': []},
-            config_paths=[],
-            local_path=flexmock(),
-            remote_path=flexmock(),
-            local_borg_version=flexmock(),
-            repository={'path': 'repo'},
-        )
-    )
-
-
 def test_run_actions_runs_delete():
     flexmock(module).should_receive('add_custom_log_levels')
     flexmock(module).should_receive('get_skip_actions').and_return([])