Skip to content

Commit

Permalink
Merge pull request #8505 from zhijianli88/cleanup-tempfiles
Browse files Browse the repository at this point in the history
Cleanup tempfiles
  • Loading branch information
priyawadhwa authored Jul 8, 2020
2 parents 7367c72 + 0ad929f commit b6f0829
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/minikube/kubeconfig/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
func TestDeleteContext(t *testing.T) {
// See kubeconfig_test
fn := tempFile(t, kubeConfigWithoutHTTPS)
defer os.Remove(fn)
if err := DeleteContext("la-croix", fn); err != nil {
t.Fatal(err)
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/minikube/kubeconfig/kubeconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ func TestVerifyEndpoint(t *testing.T) {
t.Run(test.description, func(t *testing.T) {
t.Parallel()
configFilename := tempFile(t, test.existing)
defer os.Remove(configFilename)
err := VerifyEndpoint("minikube", test.hostname, test.port, configFilename)
if err != nil && !test.err {
t.Errorf("Got unexpected error: %v", err)
Expand Down Expand Up @@ -330,6 +331,7 @@ func TestUpdateIP(t *testing.T) {
t.Run(test.description, func(t *testing.T) {
t.Parallel()
configFilename := tempFile(t, test.existing)
defer os.Remove(configFilename)
statusActual, err := UpdateEndpoint("minikube", test.hostname, test.port, configFilename)
if err != nil && !test.err {
t.Errorf("Got unexpected error: %v", err)
Expand Down Expand Up @@ -419,6 +421,7 @@ func Test_Endpoint(t *testing.T) {
for _, test := range tests {
t.Run(test.description, func(t *testing.T) {
configFilename := tempFile(t, test.cfg)
defer os.Remove(configFilename)
hostname, port, err := Endpoint("minikube", configFilename)
if err != nil && !test.err {
t.Errorf("Got unexpected error: %v", err)
Expand Down
1 change: 1 addition & 0 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ then
${pkgs} \
&& echo ok || ((exitcode += 32))
tail -n +2 "${cov_tmp}" >>"${COVERAGE_PATH}"
rm ${cov_tmp}
fi

exit "${exitcode}"

0 comments on commit b6f0829

Please sign in to comment.