-
Notifications
You must be signed in to change notification settings - Fork 2.1k
testing: Use canonical asserts #921
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
Conversation
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Using:
git grep -l '^\s\+assert\.Check(t, err)$' | \
xargs sed -i -e 's/^\(\s\+assert\)\.Check(t, err)$/\1.NilError(t, err)/'
Signed-off-by: Daniel Nephin <dnephin@docker.com>
git grep -l -P '^\s+assert\.Check\(t, ' | \
xargs perl -pi -e 's/^(\s+assert)\.Check(\(t, (?!is).*(\.Execute\(|\.Set\(|\.Write\(|\.Close\(|\.Untar\(|\.WriteFile\(|Validate\().*\)$)/\1.NilError\2/'
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Daniel Nephin <dnephin@docker.com>
git grep -l -P '^\s+assert\.Check\(t, is\.Error\(' | \
xargs perl -pi -e 's/^(\s+assert\.)Check\(t, is\.Error\((.*)\)$/\1Error(t, \2/'
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Codecov Report
@@ Coverage Diff @@
## master #921 +/- ##
==========================================
- Coverage 53.55% 53.54% -0.01%
==========================================
Files 262 262
Lines 16602 16602
==========================================
- Hits 8891 8890 -1
- Misses 7121 7122 +1
Partials 590 590 |
vdemeester
left a comment
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 🐯
thaJeztah
left a comment
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 after a rebase
| // starting with `github.com/` are special-cased, and the build command attempts | ||
| // to clone the remote repo. | ||
| // TODO: test "context selection" logic directly when runBuild is refactored | ||
| // to support testing (ex: docker/cli#294) |
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.
Needs a rebase now?
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.
Rebase will only change the diff shown in github. It will merge clean because the commit is the same.
Branched from #920
grep/sed/perl commands are included in the git commit message.