@@ -54,13 +54,34 @@ func TestPs(t *testing.T) {
5454 containers , err := tested .Ps (ctx , strings .ToLower (testProject ), compose.PsOptions {})
5555
5656 expected := []compose.ContainerSummary {
57- {ID : "123" , Name : "123" , Image : "foo" , Project : strings .ToLower (testProject ), Service : "service1" ,
58- State : "running" , Health : "healthy" , Publishers : nil },
59- {ID : "456" , Name : "456" , Image : "foo" , Project : strings .ToLower (testProject ), Service : "service1" ,
57+ {ID : "123" , Name : "123" , Names : []string {"/123" }, Image : "foo" , Project : strings .ToLower (testProject ), Service : "service1" ,
58+ State : "running" , Health : "healthy" , Publishers : nil ,
59+ Labels : map [string ]string {
60+ compose .ProjectLabel : strings .ToLower (testProject ),
61+ compose .ConfigFilesLabel : "/src/pkg/compose/testdata/compose.yaml" ,
62+ compose .WorkingDirLabel : "/src/pkg/compose/testdata" ,
63+ compose .ServiceLabel : "service1" ,
64+ },
65+ },
66+ {ID : "456" , Name : "456" , Names : []string {"/456" }, Image : "foo" , Project : strings .ToLower (testProject ), Service : "service1" ,
6067 State : "running" , Health : "" ,
61- Publishers : []compose.PortPublisher {{URL : "localhost" , TargetPort : 90 , PublishedPort : 80 }}},
62- {ID : "789" , Name : "789" , Image : "foo" , Project : strings .ToLower (testProject ), Service : "service2" ,
63- State : "exited" , Health : "" , ExitCode : 130 , Publishers : nil },
68+ Publishers : []compose.PortPublisher {{URL : "localhost" , TargetPort : 90 , PublishedPort : 80 }},
69+ Labels : map [string ]string {
70+ compose .ProjectLabel : strings .ToLower (testProject ),
71+ compose .ConfigFilesLabel : "/src/pkg/compose/testdata/compose.yaml" ,
72+ compose .WorkingDirLabel : "/src/pkg/compose/testdata" ,
73+ compose .ServiceLabel : "service1" ,
74+ },
75+ },
76+ {ID : "789" , Name : "789" , Names : []string {"/789" }, Image : "foo" , Project : strings .ToLower (testProject ), Service : "service2" ,
77+ State : "exited" , Health : "" , ExitCode : 130 , Publishers : nil ,
78+ Labels : map [string ]string {
79+ compose .ProjectLabel : strings .ToLower (testProject ),
80+ compose .ConfigFilesLabel : "/src/pkg/compose/testdata/compose.yaml" ,
81+ compose .WorkingDirLabel : "/src/pkg/compose/testdata" ,
82+ compose .ServiceLabel : "service2" ,
83+ },
84+ },
6485 }
6586 assert .NilError (t , err )
6687 assert .DeepEqual (t , containers , expected )
0 commit comments