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

Adding testing phase to Skaffold run #5594

Merged
merged 9 commits into from
Apr 1, 2021

Conversation

PriyaModali
Copy link
Contributor

@PriyaModali PriyaModali commented Mar 23, 2021

Fixes: #5593

Description
Adding testing phase to the Skaffold run

Skaffold run currently has just build & deploy. We need to add test.

PR includes integration tests.

Testing notes

Here are some sample outputs:

skaffold run - Before the fix. Note that the output has just build & deploy phases of Skaffold - test is missing.

Generating tags...
 - custom-test-example -> custom-test-example:v1.19.0-110-g7a4fc3a50
Checking cache...
 - custom-test-example: Found Locally
Tags used in deployment:
 - custom-test-example -> custom-test-example:5f9781c26f44e942c9217bdef8011a940faca385b03e53887b517e23bf80048e
Starting deploy...
 - pod/custom-test configured
Waiting for deployments to stabilize...
Deployments stabilized in 28.286087ms

skaffold run - After the fix. Note that the output has all three phases of Skaffold - build, test, & deploy.

Generating tags...
 - custom-test-example -> custom-test-example:v1.19.0-109-gb5e3d0b5d
Checking cache...
 - custom-test-example: Found. Tagging
Starting test...
Testing images...
Running custom test command: "./test.sh" with timeout 60 s
go custom test 
ok      github.com/GoogleContainerTools/skaffold/integration/examples/custom-tests      (cached)
Command finished successfully.
Running custom test command: "echo Hello world!!"
Hello world!!
Command finished successfully.
Tags used in deployment:
 - custom-test-example -> custom-test-example:eaa0bc790ed3196db41335a4ab03f5cf06abdd60951bc82f1181a579d5808833
Starting deploy...
 - pod/custom-test configured
Waiting for deployments to stabilize...
Deployments stabilized in 27.561713ms

skaffold run --skip-tests=true - After the fix. Note that the output has just build and deploy phases of Skaffold as the user decided to skip running tests.

Generating tags...
 - custom-test-example -> custom-test-example:v1.19.0-110-g7a4fc3a50
Checking cache...
 - custom-test-example: Found Locally
Tags used in deployment:
 - custom-test-example -> custom-test-example:5f9781c26f44e942c9217bdef8011a940faca385b03e53887b517e23bf80048e
Starting deploy...
 - pod/custom-test configured
Waiting for deployments to stabilize...
Deployments stabilized in 23.717865ms

@PriyaModali PriyaModali added kind/feature-request area/testing Issues concerning the testing phase of Skaffold labels Mar 23, 2021
@PriyaModali PriyaModali requested a review from a team as a code owner March 23, 2021 18:17
@google-cla google-cla bot added the cla: yes label Mar 23, 2021
@codecov
Copy link

codecov bot commented Mar 23, 2021

Codecov Report

Merging #5594 (0da7793) into master (189a03b) will decrease coverage by 0.01%.
The diff coverage is 50.00%.

❗ Current head 0da7793 differs from pull request most recent head dbcfcb8. Consider uploading reports for the commit dbcfcb8 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5594      +/-   ##
==========================================
- Coverage   70.79%   70.78%   -0.02%     
==========================================
  Files         406      406              
  Lines       15461    15466       +5     
==========================================
+ Hits        10946    10947       +1     
- Misses       3711     3713       +2     
- Partials      804      806       +2     
Impacted Files Coverage Δ
cmd/skaffold/app/cmd/run.go 71.42% <50.00%> (-16.08%) ⬇️

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 189a03b...dbcfcb8. Read the comment docs.

@tejal29
Copy link
Contributor

tejal29 commented Mar 23, 2021

Does this respect the --skip-tests flag?

@PriyaModali
Copy link
Contributor Author

Does this respect the --skip-tests flag?

Not now. But can add if the needed.

@PriyaModali
Copy link
Contributor Author

Does this respect the --skip-tests flag?

Not now. But can add if the needed.

Added support for skip-tests.

@PriyaModali PriyaModali marked this pull request as draft March 24, 2021 00:16
@pull-request-size pull-request-size bot added size/L and removed size/S labels Mar 24, 2021
@PriyaModali PriyaModali marked this pull request as ready for review March 24, 2021 04:12
@pull-request-size pull-request-size bot added size/M and removed size/L labels Mar 24, 2021
@PriyaModali PriyaModali changed the title Adding testing phase to the Skaffold run Adding testing phase to Skaffold run Mar 24, 2021
Copy link
Member

@briandealwis briandealwis left a comment

Choose a reason for hiding this comment

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

Please simplify the defer; otherwise this looks good to go.

@pull-request-size pull-request-size bot added size/L and removed size/M labels Apr 1, 2021
@PriyaModali PriyaModali merged commit 400f581 into GoogleContainerTools:master Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing Issues concerning the testing phase of Skaffold cla: yes kind/feature-request size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add testing phase to the skaffold run
4 participants