Skip to content

Commit

Permalink
michael's feedback #2
Browse files Browse the repository at this point in the history
  • Loading branch information
gfichtenholt committed Sep 2, 2021
1 parent cb65c43 commit 7e34733
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"io/ioutil"
"net/http"
"net/http/httptest"
"os"
"testing"

redismock "github.com/go-redis/redismock/v8"
Expand Down Expand Up @@ -643,7 +644,11 @@ func TestCreateInstalledPackage(t *testing.T) {
}

// currently needed for CreateInstalledPackage func
t.Setenv("POD_NAMESPACE", "kubeapps")
// TODO (gfichtenholt) replace below with t.Setenv("POD_NAMESPACE", "kubeapps") when we switch to go 1.17
// to avoid compile error "t.Setenv undefined (type *"testing".T has no field or method Setenv)"
origVal := os.Getenv("POD_NAMESPACE")
os.Setenv("POD_NAMESPACE", "kubeapps")
t.Cleanup(func() { os.Setenv("POD_NAMESPACE", origVal) })

for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
Expand Down

0 comments on commit 7e34733

Please sign in to comment.