-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remote: verify repository exists when level requires it #3194
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -257,3 +257,22 @@ def test_modify_missing_remote(dvc): | |
|
||
with pytest.raises(ConfigError, match=r"unable to find remote section"): | ||
remote_config.modify("myremote", "gdrive_client_id", "xxx") | ||
|
||
|
||
@pytest.mark.parametrize( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Solution is for config in general, but tests are for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My bad, that's a left over. Those tests are not relevant since they were replaced for the ones in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🙈 I got confused with the other pull-request: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I prefer testing the CLI in this case, it is more complete, but if you want, I use the API. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @MrOutis CLI is a dumb wrapper for API. We always test API, so let's do the same here. If you want to check that CLI returns proper codes on corresponding exceptions, just add a unit test to |
||
"cmd", | ||
[ | ||
["remote", "add", "example", "https://example.com"], | ||
["remote", "add", "--local", "example", "https://example.com"], | ||
["remote", "modify", "example", "random", "value"], | ||
["remote", "modify", "--local", "example", "random", "value"], | ||
["remote", "remove", "example"], | ||
["remote", "remove", "--local", "example"], | ||
["remote", "list"], | ||
["remote", "list", "--local"], | ||
["remote", "default", "example"], | ||
["remote", "default", "--local", "example"], | ||
], | ||
) | ||
def test_commands_outside_dvc_repository(tmp_dir, cmd): | ||
assert 253 == main(cmd) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a new parameter because I didn't want to mess up with any previous logic dealing with having an empty
dvc_dir
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MrOutis This looks like a hack rather than a proper solution 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@efiop, could you explain? Not sure how to proceed with such observation 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are hacking your way through the bug instead of solving the bug. This
verify_repo
shouldn't be an option at all. Config should always raise if you try to modify in-repo config when there isn't one.