mirror of
https://github.com/pgsty/minio.git
synced 2026-03-16 17:53:43 +01:00
start using t.SetEnv instead of os.Setenv (#14787)
This commit is contained in:
@@ -181,6 +181,9 @@ M9ofSEt/bdRD
|
||||
}
|
||||
|
||||
func TestLoadX509KeyPair(t *testing.T) {
|
||||
t.Cleanup(func() {
|
||||
os.Unsetenv(EnvCertPassword)
|
||||
})
|
||||
for i, testCase := range loadX509KeyPairTests {
|
||||
privateKey, err := createTempFile("private.key", testCase.privateKey)
|
||||
if err != nil {
|
||||
@@ -192,9 +195,8 @@ func TestLoadX509KeyPair(t *testing.T) {
|
||||
t.Fatalf("Test %d: failed to create tmp certificate file: %v", i, err)
|
||||
}
|
||||
|
||||
os.Unsetenv(EnvCertPassword)
|
||||
if testCase.password != "" {
|
||||
os.Setenv(EnvCertPassword, testCase.password)
|
||||
t.Setenv(EnvCertPassword, testCase.password)
|
||||
}
|
||||
_, err = LoadX509KeyPair(certificate, privateKey)
|
||||
if err != nil && !testCase.shouldFail {
|
||||
|
||||
@@ -1655,8 +1655,7 @@ func TestCSVRanges(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestParquetInput(t *testing.T) {
|
||||
os.Setenv("MINIO_API_SELECT_PARQUET", "on")
|
||||
defer os.Setenv("MINIO_API_SELECT_PARQUET", "off")
|
||||
t.Setenv("MINIO_API_SELECT_PARQUET", "on")
|
||||
|
||||
testTable := []struct {
|
||||
requestXML []byte
|
||||
@@ -1757,8 +1756,7 @@ func TestParquetInput(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestParquetInputSchema(t *testing.T) {
|
||||
os.Setenv("MINIO_API_SELECT_PARQUET", "on")
|
||||
defer os.Setenv("MINIO_API_SELECT_PARQUET", "off")
|
||||
t.Setenv("MINIO_API_SELECT_PARQUET", "on")
|
||||
|
||||
testTable := []struct {
|
||||
requestXML []byte
|
||||
@@ -1860,8 +1858,7 @@ func TestParquetInputSchema(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestParquetInputSchemaCSV(t *testing.T) {
|
||||
os.Setenv("MINIO_API_SELECT_PARQUET", "on")
|
||||
defer os.Setenv("MINIO_API_SELECT_PARQUET", "off")
|
||||
t.Setenv("MINIO_API_SELECT_PARQUET", "on")
|
||||
|
||||
testTable := []struct {
|
||||
requestXML []byte
|
||||
|
||||
Reference in New Issue
Block a user