Add "--repository" flag to common actions (where it makes sense) #652

Merged
witten merged 7 commits from nain/borgmatic:repository-ticket-#564 into master 2023-03-16 20:21:41 +00:00
Contributor

ticket #564 prune action

ticket #564 prune action
Author
Contributor

Would like some feedback on this pull req.
Tried to implement --repository flag for prune action.

There is some complain by integration test though about " test_parse_arguments_disallows_repository_unless_action_consumes_it".
But we are consuming it in the action, so I don't understand why it's firing.
Help requested.

____________________________________________________________
test_parse_arguments_disallows_repository_unless_action_consumes_it
_____________________________________________________________

    def test_parse_arguments_disallows_repository_unless_action_consumes_it():
        flexmock(module.collect).should_receive('get_default_config_paths').and_return(['default'])
    
>       with pytest.raises(SystemExit):
E       Failed: DID NOT RAISE <class 'SystemExit'>

tests/integration/commands/test_arguments.py:260: Failed

I did take care of the other (unit) test present and added new ones too, for this feature.

Would like some feedback on this pull req. Tried to implement --repository flag for prune action. There is some complain by integration test though about " test_parse_arguments_disallows_repository_unless_action_consumes_it". But we are consuming it in the action, so I don't understand why it's firing. Help requested. ``` ____________________________________________________________ test_parse_arguments_disallows_repository_unless_action_consumes_it _____________________________________________________________ def test_parse_arguments_disallows_repository_unless_action_consumes_it(): flexmock(module.collect).should_receive('get_default_config_paths').and_return(['default']) > with pytest.raises(SystemExit): E Failed: DID NOT RAISE <class 'SystemExit'> tests/integration/commands/test_arguments.py:260: Failed ``` I did take care of the other (unit) test present and added new ones too, for this feature.
Author
Contributor

ftr: I'll get to the other ones (check, compact, create) when this one becomes clearer

ftr: I'll get to the other ones (check, compact, create) when this one becomes clearer
Owner

This is great! I'd say you can just delete that failing test, now that --repository isn't expected to error for the prune action any longer. Thanks! I'll have a look at the rest of the PR when I get a chance.

This is great! I'd say you can just delete that failing test, now that `--repository` isn't expected to error for the `prune` action any longer. Thanks! I'll have a look at the rest of the PR when I get a chance.
nain force-pushed repository-ticket-#564 from 9228994018 to cdbe6cdf3a 2023-03-15 18:45:05 +00:00 Compare
nain added 1 commit 2023-03-15 18:59:55 +00:00
witten requested changes 2023-03-15 23:30:16 +00:00
witten left a comment
Owner

This looks great! I added one suggestion about combining a couple tests, but this looks ready to merge after that's resolved (one way or the other). Thank you!

This looks great! I added one suggestion about combining a couple tests, but this looks ready to merge after that's resolved (one way or the other). Thank you!
@ -11,0 +26,4 @@
)
def test_run_prune_runs_with_no_explicit_repository():
Owner

I might suggest combining this test with the previous one, as (unless I'm missing something) their setups are identical besides should_receive('execute_hook') expectation.

I might suggest combining this test with the previous one, as (unless I'm missing something) their setups are identical besides `should_receive('execute_hook')` expectation.
Author
Contributor

Done.

Done.
witten marked this conversation as resolved
nain added 1 commit 2023-03-16 12:23:54 +00:00
nain requested review from witten 2023-03-16 14:34:05 +00:00
nain force-pushed repository-ticket-#564 from 011a45d680 to 480addd7ce 2023-03-16 14:41:41 +00:00 Compare
nain added 1 commit 2023-03-16 15:15:23 +00:00
nain added 1 commit 2023-03-16 17:16:35 +00:00
nain added 1 commit 2023-03-16 18:02:22 +00:00
3e22414613 Update tests
Make them more explicit. Also formatting.
nain changed title from WIP: Add "--repository" flag to the "prune" action to WIP: Add "--repository" flag to common actions (where it makes sense) 2023-03-16 18:04:37 +00:00
nain changed title from WIP: Add "--repository" flag to common actions (where it makes sense) to Add "--repository" flag to common actions (where it makes sense) 2023-03-16 18:37:53 +00:00
witten merged commit 7a784b8eba into master 2023-03-16 20:21:41 +00:00
Owner

Everything looks great! I just merged it. Thanks again for your work here.

Everything looks great! I just merged it. Thanks again for your work here.
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#652
No description provided.