@@ -555,9 +555,8 @@ func TestWorkspaceAgentListeningPorts(t *testing.T) {
555555 // should not exist in the response.
556556 _ , appLPort := generateUnfilteredPort (t )
557557 app := & proto.App {
558- Slug : "test-app" ,
559- DisplayName : "test-app" ,
560- Url : fmt .Sprintf ("http://localhost:%d" , appLPort ),
558+ Slug : "test-app" ,
559+ Url : fmt .Sprintf ("http://localhost:%d" , appLPort ),
561560 }
562561
563562 // Generate a filtered port that should not exist in the response.
@@ -624,11 +623,10 @@ func TestWorkspaceAgentAppHealth(t *testing.T) {
624623 authToken := uuid .NewString ()
625624 apps := []* proto.App {
626625 {
627- Slug : "code-server" ,
628- DisplayName : "code-server" ,
629- Command : "some-command" ,
630- Url : "http://localhost:3000" ,
631- Icon : "/code.svg" ,
626+ Slug : "code-server" ,
627+ Command : "some-command" ,
628+ Url : "http://localhost:3000" ,
629+ Icon : "/code.svg" ,
632630 },
633631 {
634632 Slug : "code-server-2" ,
@@ -683,31 +681,24 @@ func TestWorkspaceAgentAppHealth(t *testing.T) {
683681 // empty
684682 err = agentClient .PostWorkspaceAgentAppHealth (ctx , codersdk.PostWorkspaceAppHealthsRequest {})
685683 require .Error (t , err )
686- // invalid name
687- err = agentClient .PostWorkspaceAgentAppHealth (ctx , codersdk.PostWorkspaceAppHealthsRequest {
688- Healths : map [string ]codersdk.WorkspaceAppHealth {
689- "bad-name" : codersdk .WorkspaceAppHealthDisabled ,
690- },
691- })
692- require .Error (t , err )
693- // healcheck disabled
684+ // healthcheck disabled
694685 err = agentClient .PostWorkspaceAgentAppHealth (ctx , codersdk.PostWorkspaceAppHealthsRequest {
695- Healths : map [string ]codersdk.WorkspaceAppHealth {
696- "code-server" : codersdk .WorkspaceAppHealthInitializing ,
686+ Healths : map [uuid. UUID ]codersdk.WorkspaceAppHealth {
687+ metadata . Apps [ 0 ]. ID : codersdk .WorkspaceAppHealthInitializing ,
697688 },
698689 })
699690 require .Error (t , err )
700691 // invalid value
701692 err = agentClient .PostWorkspaceAgentAppHealth (ctx , codersdk.PostWorkspaceAppHealthsRequest {
702- Healths : map [string ]codersdk.WorkspaceAppHealth {
703- "code-server-2" : codersdk .WorkspaceAppHealth ("bad-value" ),
693+ Healths : map [uuid. UUID ]codersdk.WorkspaceAppHealth {
694+ metadata . Apps [ 1 ]. ID : codersdk .WorkspaceAppHealth ("bad-value" ),
704695 },
705696 })
706697 require .Error (t , err )
707698 // update to healthy
708699 err = agentClient .PostWorkspaceAgentAppHealth (ctx , codersdk.PostWorkspaceAppHealthsRequest {
709- Healths : map [string ]codersdk.WorkspaceAppHealth {
710- "code-server-2" : codersdk .WorkspaceAppHealthHealthy ,
700+ Healths : map [uuid. UUID ]codersdk.WorkspaceAppHealth {
701+ metadata . Apps [ 1 ]. ID : codersdk .WorkspaceAppHealthHealthy ,
711702 },
712703 })
713704 require .NoError (t , err )
@@ -716,8 +707,8 @@ func TestWorkspaceAgentAppHealth(t *testing.T) {
716707 require .EqualValues (t , codersdk .WorkspaceAppHealthHealthy , metadata .Apps [1 ].Health )
717708 // update to unhealthy
718709 err = agentClient .PostWorkspaceAgentAppHealth (ctx , codersdk.PostWorkspaceAppHealthsRequest {
719- Healths : map [string ]codersdk.WorkspaceAppHealth {
720- "code-server-2" : codersdk .WorkspaceAppHealthUnhealthy ,
710+ Healths : map [uuid. UUID ]codersdk.WorkspaceAppHealth {
711+ metadata . Apps [ 1 ]. ID : codersdk .WorkspaceAppHealthUnhealthy ,
721712 },
722713 })
723714 require .NoError (t , err )
0 commit comments