Skip to content
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

Faster tests #2570

Merged
merged 2 commits into from
Jul 31, 2019
Merged

Faster tests #2570

merged 2 commits into from
Jul 31, 2019

Conversation

dgageot
Copy link
Contributor

@dgageot dgageot commented Jul 30, 2019

  • Optimize all tests that take over .6s
  • Use t.Override in placed where it should be used
  • Remove TestRemoteDigest that was not really testing anything
  • Run git tests in parallel

@codecov
Copy link

codecov bot commented Jul 30, 2019

Codecov Report

Merging #2570 into master will decrease coverage by 0.27%.
The diff coverage is 100%.

Impacted Files Coverage Δ
pkg/skaffold/update/update.go 26.08% <100%> (-26.09%) ⬇️
pkg/skaffold/docker/remote.go 15.68% <0%> (-11.77%) ⬇️
pkg/skaffold/build/tag/git_commit.go 69.11% <0%> (-11.77%) ⬇️
pkg/skaffold/docker/auth.go 62.79% <0%> (-9.31%) ⬇️
pkg/skaffold/jib/jib.go 78.49% <0%> (+1.07%) ⬆️

@dgageot
Copy link
Contributor Author

dgageot commented Jul 30, 2019

This PR decreases a bit the code coverage but it was code that was executed only by error.

 + Optimize all tests that take over .6s
 + Use t.Override in placed where it should be used
 + Remove TestRemoteDigest that was not really testing anything
 + Run git tests in parallel

Signed-off-by: David Gageot <[email protected]>
Signed-off-by: David Gageot <[email protected]>
@@ -81,6 +83,9 @@ func TestCreateNewRunner(t *testing.T) {
}
for _, test := range tests {
testutil.Run(t, test.description, func(t *testutil.T) {
t.Override(&update.GetLatestAndCurrentVersion, func() (semver.Version, semver.Version, error) {
Copy link
Member

Choose a reason for hiding this comment

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

nice! didn't know all tests were doing the update check.


defaultPollPeriodInMilliseconds = 100
defer func() { defaultPollPeriodInMilliseconds = originalPollingPeriod }()
t.Override(&executeRolloutStatus, test.mock.Executefunc)
Copy link
Member

Choose a reason for hiding this comment

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

how did this get fixed?

@tejal29 tejal29 merged commit a58b312 into GoogleContainerTools:master Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants