@@ -28,7 +28,12 @@ import {
2828 ServingRuntimeModel ,
2929 TemplateModel ,
3030} from '#~/__tests__/cypress/cypress/utils/models' ;
31- import { DeploymentMode , type InferenceServiceKind , type ServingRuntimeKind } from '#~/k8sTypes' ;
31+ import {
32+ DeploymentMode ,
33+ type TemplateKind ,
34+ type InferenceServiceKind ,
35+ type ServingRuntimeKind ,
36+ } from '#~/k8sTypes' ;
3237import { ServingRuntimePlatform } from '#~/types' ;
3338import { be } from '#~/__tests__/cypress/cypress/utils/should' ;
3439import { asClusterAdminUser } from '#~/__tests__/cypress/cypress/utils/mockUsers' ;
@@ -63,6 +68,7 @@ type HandlersProps = {
6368 disableServingRuntimeParamsConfig ?: boolean ;
6469 disableProjectScoped ?: boolean ;
6570 disableHardwareProfiles ?: boolean ;
71+ servingRuntimesTemplates ?: TemplateKind [ ] ;
6672} ;
6773
6874const initIntercepts = ( {
@@ -948,18 +954,45 @@ describe('Model Serving Global', () => {
948954 cy . findByTestId ( 'app-page-title' ) . should ( 'have.text' , 'Test Inference Service metrics' ) ;
949955 } ) ;
950956 it ( 'Display the version label if the annotation is present' , ( ) => {
951- const servingRuntimeWithVersion = mockServingRuntimeK8sResource ( { } ) ;
952- servingRuntimeWithVersion . metadata . annotations =
953- servingRuntimeWithVersion . metadata . annotations || { } ;
954- servingRuntimeWithVersion . metadata . annotations [ 'opendatahub.io/runtime-version' ] = '1.2.3' ;
957+ const servingRuntimeWithLatestVersion = mockServingRuntimeK8sResource ( {
958+ namespace : 'test-project' ,
959+ name : 'test-inference-service-latest' ,
960+ templateName : 'template-2' ,
961+ version : '1.0.0' ,
962+ } ) ;
963+ const servingRuntimeWithOutdatedVersion = mockServingRuntimeK8sResource ( {
964+ namespace : 'test-project' ,
965+ name : 'test-inference-service-outdated' ,
966+ templateName : 'template-2' ,
967+ version : '0.5.0' ,
968+ } ) ;
969+ const inferenceServiceLatest = mockInferenceServiceK8sResource ( {
970+ name : 'test-inference-service-latest' ,
971+ namespace : 'test-project' ,
972+ displayName : 'Latest Model' ,
973+ modelName : 'test-inference-service-latest' ,
974+ } ) ;
975+ const inferenceServiceOutdated = mockInferenceServiceK8sResource ( {
976+ name : 'test-inference-service-outdated' ,
977+ namespace : 'test-project' ,
978+ displayName : 'Outdated Model' ,
979+ modelName : 'test-inference-service-outdated' ,
980+ } ) ;
955981
956982 initIntercepts ( {
957- servingRuntimes : [ servingRuntimeWithVersion ] ,
983+ servingRuntimes : [ servingRuntimeWithLatestVersion , servingRuntimeWithOutdatedVersion ] ,
984+ inferenceServices : [ inferenceServiceLatest , inferenceServiceOutdated ] ,
958985 } ) ;
959986
960- modelServingGlobal . visit ( ) ;
961- modelServingGlobal . findServingRuntimeVersionLabel ( ) . should ( 'exist' ) ;
962- modelServingGlobal . findServingRuntimeVersionLabel ( ) . should ( 'contain.text' , '1.2.3' ) ;
987+ modelServingGlobal . visit ( 'test-project' ) ;
988+
989+ const latestRow = modelServingSection . getInferenceServiceRow ( 'Latest Model' ) ;
990+ latestRow . findServingRuntimeVersionLabel ( ) . should ( 'contain.text' , '1.0.0' ) ;
991+ latestRow . findServingRuntimeVersionStatusLabel ( ) . should ( 'have.text' , 'Latest' ) ;
992+
993+ const outdatedRow = modelServingSection . getInferenceServiceRow ( 'Outdated Model' ) ;
994+ outdatedRow . findServingRuntimeVersionLabel ( ) . should ( 'contain.text' , '0.5.0' ) ;
995+ outdatedRow . findServingRuntimeVersionStatusLabel ( ) . should ( 'have.text' , 'Outdated' ) ;
963996 } ) ;
964997
965998 it ( 'Not display the version label if the annotation is absent' , ( ) => {
@@ -969,8 +1002,15 @@ describe('Model Serving Global', () => {
9691002 servingRuntimes : [ servingRuntimeWithoutVersion ] ,
9701003 } ) ;
9711004
972- modelServingGlobal . visit ( ) ;
973- modelServingGlobal . findServingRuntimeVersionLabel ( ) . should ( 'not.exist' ) ;
1005+ modelServingGlobal . visit ( 'test-project' ) ;
1006+ modelServingSection
1007+ . getInferenceServiceRow ( 'Test Inference Service' )
1008+ . findServingRuntimeVersionLabel ( )
1009+ . should ( 'not.exist' ) ;
1010+ modelServingSection
1011+ . getInferenceServiceRow ( 'Test Inference Service' )
1012+ . findServingRuntimeVersionStatusLabel ( )
1013+ . should ( 'not.exist' ) ;
9741014 } ) ;
9751015
9761016 it ( 'Should display env vars from a valueFrom secret' , ( ) => {
0 commit comments