Skip to content

testing: Use canonical asserts - #921

Merged
dnephin merged 5 commits into
docker:masterfrom
dnephin:use-canonical-imports
Mar 7, 2018
Merged

testing: Use canonical asserts#921
dnephin merged 5 commits into
docker:masterfrom
dnephin:use-canonical-imports

Conversation

@dnephin

Copy link
Copy Markdown
Contributor

Branched from #920

grep/sed/perl commands are included in the git commit message.

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-io

Copy link
Copy Markdown

Codecov Report

Merging #921 into master will decrease coverage by <.01%.
The diff coverage is n/a.

@@ 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

@dnephindnephin changed the title Use canonical importstesting: Use canonical assertsMar 7, 2018

@vdemeestervdemeester left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐯

@thaJeztahthaJeztah left a comment

Copy link
Copy Markdown
Member

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)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a rebase now?

Copy link
Copy Markdown
ContributorAuthor

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.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@dnephin@codecov-io@vdemeester@thaJeztah@GordonTheTurtle