@@ -368,6 +368,12 @@ func StatusTestOnInstallUpgrade(details VersionDetails, opts TestOptions) func(t
368
368
daprPath := GetDaprPath ()
369
369
output , err := spawn .Command (daprPath , "status" , "-k" )
370
370
require .NoError (t , err , "status check failed" )
371
+
372
+ version , err := semver .NewVersion (details .RuntimeVersion )
373
+ if err != nil {
374
+ t .Error ("failed to parse runtime version" , err )
375
+ }
376
+
371
377
var notFound map [string ][]string
372
378
if ! opts .HAEnabled {
373
379
notFound = map [string ][]string {
@@ -377,6 +383,11 @@ func StatusTestOnInstallUpgrade(details VersionDetails, opts TestOptions) func(t
377
383
"dapr-placement-server" : {details .RuntimeVersion , "1" },
378
384
"dapr-operator" : {details .RuntimeVersion , "1" },
379
385
}
386
+ if version .GreaterThanEqual (VersionWithHAScheduler ) {
387
+ notFound ["dapr-scheduler-server" ] = []string {details .RuntimeVersion , "3" }
388
+ } else if version .GreaterThanEqual (VersionWithScheduler ) {
389
+ notFound ["dapr-scheduler-server" ] = []string {details .RuntimeVersion , "1" }
390
+ }
380
391
} else {
381
392
notFound = map [string ][]string {
382
393
"dapr-sentry" : {details .RuntimeVersion , "3" },
@@ -385,13 +396,19 @@ func StatusTestOnInstallUpgrade(details VersionDetails, opts TestOptions) func(t
385
396
"dapr-placement-server" : {details .RuntimeVersion , "3" },
386
397
"dapr-operator" : {details .RuntimeVersion , "3" },
387
398
}
399
+ if version .GreaterThanEqual (VersionWithScheduler ) {
400
+ notFound ["dapr-scheduler-server" ] = []string {details .RuntimeVersion , "3" }
401
+ }
388
402
}
389
403
390
404
if details .ImageVariant != "" {
391
405
notFound ["dapr-sentry" ][0 ] = notFound ["dapr-sentry" ][0 ] + "-" + details .ImageVariant
392
406
notFound ["dapr-sidecar-injector" ][0 ] = notFound ["dapr-sidecar-injector" ][0 ] + "-" + details .ImageVariant
393
407
notFound ["dapr-placement-server" ][0 ] = notFound ["dapr-placement-server" ][0 ] + "-" + details .ImageVariant
394
408
notFound ["dapr-operator" ][0 ] = notFound ["dapr-operator" ][0 ] + "-" + details .ImageVariant
409
+ if notFound ["dapr-scheduler-server" ] != nil {
410
+ notFound ["dapr-scheduler-server" ][0 ] = notFound ["dapr-scheduler-server" ][0 ] + "-" + details .ImageVariant
411
+ }
395
412
}
396
413
397
414
lines := strings .Split (output , "\n " )[1 :] // remove header of status.
@@ -400,13 +417,13 @@ func StatusTestOnInstallUpgrade(details VersionDetails, opts TestOptions) func(t
400
417
cols := strings .Fields (strings .TrimSpace (line ))
401
418
if len (cols ) > 6 { // atleast 6 fields are verified from status (Age and created time are not).
402
419
if toVerify , ok := notFound [cols [0 ]]; ok { // get by name.
403
- require .Equal (t , DaprTestNamespace , cols [1 ], "namespace must match" )
404
- require .Equal (t , "True" , cols [2 ], "healthly field must be true" )
405
- require .Equal (t , "Running" , cols [3 ], "pods must be Running" )
406
- require .Equal (t , toVerify [1 ], cols [4 ], "replicas must be equal" )
420
+ require .Equal (t , DaprTestNamespace , cols [1 ], "%s namespace must match" , cols [ 0 ] )
421
+ require .Equal (t , "True" , cols [2 ], "%s healthy field must be true" , cols [ 0 ] )
422
+ require .Equal (t , "Running" , cols [3 ], "%s pods must be Running" , cols [ 0 ] )
423
+ require .Equal (t , toVerify [1 ], cols [4 ], "%s replicas must be equal" , cols [ 0 ] )
407
424
// TODO: Skip the dashboard version check for now until the helm chart is updated.
408
425
if cols [0 ] != "dapr-dashboard" {
409
- require .Equal (t , toVerify [0 ], cols [5 ], "versions must match" )
426
+ require .Equal (t , toVerify [0 ], cols [5 ], "%s versions must match" , cols [ 0 ] )
410
427
}
411
428
delete (notFound , cols [0 ])
412
429
}
0 commit comments