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

Add tests for skaffold init walk flow. #1809

Merged
merged 4 commits into from
Mar 22, 2019

Conversation

tejal29
Copy link
Contributor

@tejal29 tejal29 commented Mar 15, 2019

As we support other helm and kustomize deployers in skaffold init flow, walk will become more complex.
Refactoring it out and adding some tests.

@tejal29 tejal29 force-pushed the refactor_walk branch 3 times, most recently from 7174184 to ace4a83 Compare March 18, 2019 17:14
@codecov-io
Copy link

codecov-io commented Mar 18, 2019

Codecov Report

Merging #1809 into master will increase coverage by 0.3%.
The diff coverage is 95.83%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #1809     +/-   ##
=========================================
+ Coverage   49.21%   49.52%   +0.3%     
=========================================
  Files         166      166             
  Lines        7293     7298      +5     
=========================================
+ Hits         3589     3614     +25     
+ Misses       3355     3335     -20     
  Partials      349      349
Impacted Files Coverage Δ
pkg/skaffold/initializer/init.go 21.6% <95.83%> (+13.96%) ⬆️
pkg/skaffold/util/util.go 67.97% <0%> (+1.3%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d07e88b...860bceb. Read the comment docs.

@tejal29 tejal29 added the kokoro:run runs the kokoro jobs on a PR label Mar 18, 2019
@balopat balopat added kokoro:run runs the kokoro jobs on a PR and removed kokoro:run runs the kokoro jobs on a PR labels Mar 18, 2019
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Mar 18, 2019
@tejal29 tejal29 added the kokoro:run runs the kokoro jobs on a PR label Mar 19, 2019
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Mar 19, 2019
pkg/skaffold/initializer/init_test.go Outdated Show resolved Hide resolved
pkg/skaffold/initializer/init_test.go Outdated Show resolved Hide resolved
pkg/skaffold/initializer/init_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@dgageot dgageot left a comment

Choose a reason for hiding this comment

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

A few style nits. Sorry that it makes it more painful for you to get started. I wish we had a style guide.

pkg/skaffold/initializer/init_test.go Outdated Show resolved Hide resolved
pkg/skaffold/initializer/init_test.go Show resolved Hide resolved
pkg/skaffold/initializer/init_test.go Outdated Show resolved Hide resolved
pkg/skaffold/initializer/init_test.go Outdated Show resolved Hide resolved
tejal29 added 3 commits March 21, 2019 10:07
In this change:
1. Refactor walk into its own function
2. Add sample directory structure and tests.
t.Run(test.description, func(t *testing.T) {
testDir, cleanUp := testutil.NewTempDir(t)
rootDir := testDir.Root()
defer cleanUp()
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: defer cleanUp() should always be called as soon as we get the cleanup

@dgageot
Copy link
Contributor

dgageot commented Mar 22, 2019

@tejal29 approved with a nits

@tejal29 tejal29 merged commit 29f1b8e into GoogleContainerTools:master Mar 22, 2019
@tejal29 tejal29 deleted the refactor_walk branch September 18, 2019 23:05
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.

6 participants