@@ -289,14 +289,8 @@ func TestDynamicSystemView_GeneratePasswordFromPolicy_failed(t *testing.T) {
289
289
}
290
290
}
291
291
292
+ // TestDynamicSystemView_PluginEnv_successful checks that the PluginEnv method returns the expected values in a successful case.
292
293
func TestDynamicSystemView_PluginEnv_successful (t * testing.T ) {
293
- // This test function cannot be parallelized, because it messes with the
294
- // global version.BuildDate variable.
295
- oldBuildDate := version .BuildDate
296
- testBuildDate := time .Now ().Format (time .RFC3339 )
297
- version .BuildDate = testBuildDate
298
- defer func () { version .BuildDate = oldBuildDate }()
299
-
300
294
coreConfig := & CoreConfig {
301
295
CredentialBackends : map [string ]logical.Factory {},
302
296
}
@@ -322,7 +316,7 @@ func TestDynamicSystemView_PluginEnv_successful(t *testing.T) {
322
316
323
317
expectedVersionInfo := version .GetVersion ()
324
318
325
- expectedBuildDate , err := time . Parse ( time . RFC3339 , testBuildDate )
319
+ expectedBuildDate , err := version . GetVaultBuildDate ( )
326
320
if err != nil {
327
321
t .Fatalf ("failed to set up expectedBuildDate: %v" , err )
328
322
}
@@ -340,6 +334,7 @@ func TestDynamicSystemView_PluginEnv_successful(t *testing.T) {
340
334
}
341
335
}
342
336
337
+ // TestDynamicSystemView_PluginEnv_failed checks that the PluginEnv method returns the expected outputs in failure cases.
343
338
func TestDynamicSystemView_PluginEnv_failed (t * testing.T ) {
344
339
cases := map [string ]struct {
345
340
buildDate string
0 commit comments