File tree 3 files changed +38
-0
lines changed
3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 781
781
"command" : " openshift.explorer.addCluster.openCrcAddClusterPage" ,
782
782
"title" : " Open Add CRC Cluster Wizard" ,
783
783
"category" : " OpenShift"
784
+ },
785
+ {
786
+ "command" : " openshift.component.test" ,
787
+ "title" : " Test" ,
788
+ "category" : " OpenShift"
789
+ },
790
+ {
791
+ "command" : " openshift.component.test.palette" ,
792
+ "title" : " Test Component" ,
793
+ "category" : " OpenShift"
784
794
}
795
+
785
796
],
786
797
"keybindings" : [
787
798
{
859
870
"command" : " openshift.component.create" ,
860
871
"when" : " view == openshiftProjectExplorer"
861
872
},
873
+ {
874
+ "command" : " openshift.component.test" ,
875
+ "when" : " false"
876
+ },
862
877
{
863
878
"command" : " openshift.component.createFromRootWorkspaceFolder" ,
864
879
"when" : " view == workbench.view.explorer"
1237
1252
"when" : " view == openshiftProjectExplorer && viewItem == component" ,
1238
1253
"group" : " c4@5"
1239
1254
},
1255
+ {
1256
+ "command" : " openshift.component.test" ,
1257
+ "when" : " view == openshiftProjectExplorer && viewItem == component" ,
1258
+ "group" : " c4@6"
1259
+ },
1240
1260
{
1241
1261
"command" : " openshift.component.delete" ,
1242
1262
"when" : " view == openshiftProjectExplorer && viewItem == componentNoContext" ,
Original file line number Diff line number Diff line change @@ -256,6 +256,10 @@ export class Command {
256
256
return `odo create ${ type } :${ version } ${ name } ${ version ?'--s2i' :'' } --binary ${ binary } --app ${ app } --project ${ project } --context ${ context } ` ;
257
257
}
258
258
259
+ static testComponent ( ) {
260
+ return 'odo test --show-log' ;
261
+ } ;
262
+
259
263
@verbose
260
264
static createService (
261
265
project : string ,
Original file line number Diff line number Diff line change @@ -920,6 +920,20 @@ export class Component extends OpenShiftItem {
920
920
) ;
921
921
}
922
922
923
+ @vsCommand ( 'openshift.component.test' , true )
924
+ @selectTargetComponent (
925
+ 'Select an Application' ,
926
+ 'Select a Component you want to debug (showing only Components pushed to the cluster)' ,
927
+ ( value : OpenShiftComponent ) => value . contextValue === ContextType . COMPONENT_PUSHED && value . kind === ComponentKind . DEVFILE
928
+ )
929
+ static async test ( component : OpenShiftComponent ) : Promise < string | void > {
930
+ if ( ! component ) return null ;
931
+ if ( component . kind === ComponentKind . S2I ) {
932
+ return 'Test command does not supported for S2I components' ;
933
+ }
934
+ await Component . odo . executeInTerminal ( Command . testComponent ( ) , component . contextPath . fsPath , `OpenShift: Test '${ component . getName ( ) } ' Component` ) ;
935
+ }
936
+
923
937
@vsCommand ( 'openshift.component.import' )
924
938
static async import ( component : OpenShiftObject ) : Promise < string | null > {
925
939
const prjName = component . getParent ( ) . getParent ( ) . getName ( ) ;
You can’t perform that action at this time.
0 commit comments