@@ -27,7 +27,7 @@ describe('Dev Containers CLI', function () {
2727
2828 describe ( 'Command build' , ( ) => {
2929
30- it ( 'should build successfully with valid image metadata --label property' , async ( ) => {
30+ it ( 'should build successfully with valid image metadata --label property (image) ' , async ( ) => {
3131 const testFolder = `${ __dirname } /configs/example` ;
3232 const response = await shellExec ( `${ cli } build --workspace-folder ${ testFolder } --label 'name=label-test' --label 'type=multiple-labels'` ) ;
3333 const res = JSON . parse ( response . stdout ) ;
@@ -36,6 +36,15 @@ describe('Dev Containers CLI', function () {
3636 assert . match ( labels . stdout . toString ( ) , / \" n a m e \" : \" l a b e l - t e s t \" / ) ;
3737 } ) ;
3838
39+ it ( 'should build successfully with valid image metadata --label property (dockerfile)' , async ( ) => {
40+ const testFolder = `${ __dirname } /configs/example-dockerfile` ;
41+ const response = await shellExec ( `${ cli } build --workspace-folder ${ testFolder } --label 'name=label-test' --label 'type=multiple-labels'` ) ;
42+ const res = JSON . parse ( response . stdout ) ;
43+ assert . equal ( res . outcome , 'success' ) ;
44+ const labels = await shellExec ( `docker inspect --format '{{json .Config.Labels}}' ${ res . imageName } | jq` ) ;
45+ assert . match ( labels . stdout . toString ( ) , / \" n a m e \" : \" l a b e l - t e s t \" / ) ;
46+ } ) ;
47+
3948 it ( 'should fail to build with correct error message for local feature' , async ( ) => {
4049 const testFolder = `${ __dirname } /configs/image-with-local-feature` ;
4150 try {
0 commit comments