-
Notifications
You must be signed in to change notification settings - Fork 365
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
lakectl: fixed bug in argument validation #3185
Conversation
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.
Thanks!
AFAICT f7012dd introduced this regression. Can we have a test that will catch the next time we do something like this?
Refs are subtle, and this is a really bad UX.
@johnnyaug is it possible to add the test value that will break the previous implementation? |
@nopcoder done |
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.
LGTM
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.
THANKS!
esti/lakectl_test.go
Outdated
func TestLakectlBranchAndTagValidation(t *testing.T) { | ||
repoName := generateUniqueRepositoryName() | ||
storage := generateUniqueStorageNamespace(repoName) | ||
validTagName := "my.valid.tag" | ||
|
||
vars := map[string]string{ | ||
"REPO": repoName, | ||
"STORAGE": storage, | ||
"BRANCH": mainBranch, | ||
"TAG": validTagName, | ||
} | ||
invalidBranchName := "my.invalid.branch" | ||
RunCmdAndVerifySuccessWithFile(t, Lakectl()+" repo create lakefs://"+repoName+" "+storage, false, "lakectl_repo_create", vars) | ||
RunCmdAndVerifyFailureWithFile(t, Lakectl()+" branch create lakefs://"+repoName+"/"+invalidBranchName+" --source lakefs://"+repoName+"/"+mainBranch, false, "lakectl_branch_create_invalid", vars) | ||
RunCmdAndVerifySuccessWithFile(t, Lakectl()+" tag create lakefs://"+repoName+"/"+validTagName+" lakefs://"+repoName+"/"+mainBranch, false, "lakectl_tag_create", vars) | ||
} |
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.
Neat!
Please also test main~3
, main~3^2^^
, and a few similar ones?
No description provided.