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

Fix skaffold build templating output and add tests #1841

Merged
merged 8 commits into from
Mar 26, 2019

Conversation

tejal29
Copy link
Contributor

@tejal29 tejal29 commented Mar 20, 2019

fixes #1839

In this commit

  • Add better description on flags so its clear, skaffold build -o is only useful with --quiet.
  • suppress "Complete in " line with --quiet flag so that skaffold build --quiet > build.out output can consumed to by skaffold deploy to correctly parse and construct a build.Artifacts object.
  • Refactor runBuild to move creating a runner and actually building artifacts to another function, so it can be mocked in tests.
  • add tests for --quiet flag and make sure output is as expected when a template is specified vs when its not.
  • change default template to "{{.}}"

@codecov-io
Copy link

codecov-io commented Mar 20, 2019

Codecov Report

Merging #1841 into master will increase coverage by 0.97%.
The diff coverage is 43.75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1841      +/-   ##
==========================================
+ Coverage   49.18%   50.16%   +0.97%     
==========================================
  Files         166      168       +2     
  Lines        7287     7356      +69     
==========================================
+ Hits         3584     3690     +106     
+ Misses       3357     3310      -47     
- Partials      346      356      +10
Impacted Files Coverage Δ
cmd/skaffold/app/cmd/build.go 68.18% <43.75%> (+43.79%) ⬆️
cmd/skaffold/app/skaffold.go 50% <0%> (-10%) ⬇️
cmd/skaffold/app/cmd/run.go 34.61% <0%> (-1.39%) ⬇️
pkg/skaffold/schema/profiles.go 90.64% <0%> (-0.96%) ⬇️
cmd/skaffold/app/cmd/dev.go 13.27% <0%> (-0.37%) ⬇️
pkg/skaffold/event/proto/skaffold.pb.go 5.95% <0%> (-0.07%) ⬇️
pkg/skaffold/watch/triggers.go 52.05% <0%> (-0.06%) ⬇️
pkg/skaffold/event/server.go 35.48% <0%> (ø) ⬆️
pkg/skaffold/kubernetes/wait.go 0% <0%> (ø) ⬆️
pkg/skaffold/schema/versions.go 65.85% <0%> (ø) ⬆️
... and 12 more

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 e8ba045...6bd28dc. Read the comment docs.

@tejal29 tejal29 force-pushed the deploy_build branch 2 times, most recently from 61e6257 to e47c5fa Compare March 20, 2019 23:10
}
}
if err != nil {
return nil, func() { cancel() }, errors.Wrap(err, "creating runner")
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you return cancel instead of func() { cancel() }?

cmd/skaffold/app/cmd/build.go Outdated Show resolved Hide resolved
cmd/skaffold/app/cmd/build_test.go Outdated Show resolved Hide resolved
cmd/skaffold/app/cmd/build_test.go Outdated Show resolved Hide resolved
cmd/skaffold/app/cmd/build_test.go Outdated Show resolved Hide resolved
cmd/skaffold/app/cmd/build.go Outdated Show resolved Hide resolved
cmd/skaffold/app/cmd/build.go Outdated Show resolved Hide resolved
cmd/skaffold/app/cmd/build_test.go Outdated Show resolved Hide resolved
cmd/skaffold/app/cmd/build_test.go Outdated Show resolved Hide resolved
cmd/skaffold/app/cmd/build_test.go Outdated Show resolved Hide resolved
cmd/skaffold/app/cmd/build_test.go Outdated Show resolved Hide resolved
@dgageot dgageot merged commit 9e23d32 into GoogleContainerTools:master Mar 26, 2019
@tejal29 tejal29 deleted the deploy_build branch September 18, 2019 23:06
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.

Fix skaffold build output templating
4 participants