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: integration-test cleanup #8118

Conversation

ericzzzzzzz
Copy link
Contributor

@ericzzzzzzz ericzzzzzzz commented Nov 18, 2022

Fixes: #8116

Description

  • change cleanup(delete) call in test to be run in the same process as test itself instead of running in background process, to avoid background process being killed before skaffold delete gets called.
  • refactor file sync test to use different pod for each test to avoid test contamination.

@ericzzzzzzz ericzzzzzzz marked this pull request as draft November 18, 2022 18:13
@codecov
Copy link

codecov bot commented Nov 18, 2022

Codecov Report

Merging #8118 (708c969) into main (290280e) will decrease coverage by 4.19%.
The diff coverage is 53.26%.

❗ Current head 708c969 differs from pull request most recent head 23be8cf. Consider uploading reports for the commit 23be8cf to get more accurate results

@@            Coverage Diff             @@
##             main    #8118      +/-   ##
==========================================
- Coverage   70.48%   66.29%   -4.20%     
==========================================
  Files         515      599      +84     
  Lines       23150    29347    +6197     
==========================================
+ Hits        16317    19455    +3138     
- Misses       5776     8447    +2671     
- Partials     1057     1445     +388     
Impacted Files Coverage Δ
cmd/skaffold/app/cmd/completion.go 13.04% <0.00%> (-1.25%) ⬇️
cmd/skaffold/app/cmd/credits/export.go 0.00% <0.00%> (ø)
cmd/skaffold/app/cmd/deploy.go 40.90% <0.00%> (-12.94%) ⬇️
cmd/skaffold/app/cmd/test.go 44.44% <0.00%> (ø)
cmd/skaffold/app/exitcode.go 100.00% <ø> (+6.66%) ⬆️
cmd/skaffold/skaffold.go 0.00% <0.00%> (ø)
cmd/skaffold/app/cmd/inspect_tests.go 62.50% <14.28%> (-1.14%) ⬇️
cmd/skaffold/app/cmd/render.go 35.48% <18.18%> (-5.90%) ⬇️
cmd/skaffold/app/cmd/lsp.go 28.12% <28.12%> (ø)
cmd/skaffold/app/cmd/run.go 64.28% <33.33%> (-9.63%) ⬇️
... and 394 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ericzzzzzzz
Copy link
Contributor Author

hmm... This is a little awkward, TestDevSyncDefaultNamespace whole test was passing due to file-sync pod in the first test case not being deleted. We're seeing the second test case failing, this is caused by the second test case the background dev process sees the terminating status of the pod from the first test case and before that client.WaitForPodsReady("test-file-sync") has been already executed, it saw a running pod, that's due to kubeclt delete command returns after it sends request to the cluster, it doesn't wait for the deletion. Perhaps, we shouldn't share the test resource for this whole test.

@pull-request-size pull-request-size bot added size/M and removed size/S labels Nov 24, 2022
@ericzzzzzzz ericzzzzzzz marked this pull request as ready for review November 24, 2022 15:01
Copy link
Contributor

@aaron-prindle aaron-prindle left a comment

Choose a reason for hiding this comment

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

Nice, LGTM!

@aaron-prindle aaron-prindle merged commit d543d48 into GoogleContainerTools:main Nov 29, 2022
@aaron-prindle aaron-prindle added the meta/testing Issues focused on testing Skaffold itself label Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta/testing Issues focused on testing Skaffold itself size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

deployments are not cleaned up in some integration tests with default namespace
2 participants