[ 
https://issues.apache.org/jira/browse/BEAM-13322?focusedWorklogId=690872&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-690872
 ]

ASF GitHub Bot logged work on BEAM-13322:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 06/Dec/21 10:07
            Start Date: 06/Dec/21 10:07
    Worklog Time Spent: 10m 
      Work Description: ilya-kozyrev commented on a change in pull request 
#16125:
URL: https://github.com/apache/beam/pull/16125#discussion_r762861923



##########
File path: playground/backend/internal/code_processing/code_processing_test.go
##########
@@ -561,3 +568,66 @@ func Test_setJavaExecutableFile(t *testing.T) {
                })
        }
 }
+
+func Test_getRunOrTestCmd(t *testing.T) {
+       unitTests := make(map[string]bool, 1)
+       unitTests[validators.UnitTestValidatorName] = true
+
+       notUnitTests := make(map[string]bool, 1)
+       notUnitTests[validators.UnitTestValidatorName] = false
+
+       runEx := executors.NewExecutorBuilder().
+               WithRunner().
+               WithCommand("runCommand").
+               WithArgs([]string{"arg1"}).
+               Build()
+
+       testEx := executors.NewExecutorBuilder().
+               WithTestRunner().
+               WithCommand("testCommand").
+               WithArgs([]string{"arg1"}).
+               Build()
+
+       wantRunExec := exec.CommandContext(context.Background(), "runCommand", 
"arg1", "")
+       wantTestExec := exec.CommandContext(context.Background(), 
"testCommand", "arg1", "")
+
+       type args struct {
+               valResult      map[string]bool
+               executor       *executors.Executor
+               ctxWithTimeout context.Context
+       }
+
+       tests := []struct {
+               name string
+               args args
+               want *exec.Cmd
+       }{
+               {
+                       //Get cmd objects with set run executor
+                       name: "get run cmd",
+                       args: args{
+                               valResult:      notUnitTests,
+                               executor:       &runEx,
+                               ctxWithTimeout: context.Background(),
+                       },
+                       want: wantRunExec,
+               },
+               {
+                       //Get cmd objects with set test executor
+                       name: "get test cmd",
+                       args: args{
+                               valResult:      unitTests,
+                               executor:       &testEx,
+                               ctxWithTimeout: context.Background(),
+                       },
+                       want: wantTestExec,
+               },
+       }
+       for _, tt := range tests {
+               t.Run(tt.name, func(t *testing.T) {
+                       if got := getExecuteCmd(tt.args.valResult, 
tt.args.executor, tt.args.ctxWithTimeout); !reflect.DeepEqual(got, tt.want) {

Review comment:
       Seems like we have an error here 
   code_processing_test.go:628:30: cannot use tt.args.valResult (variable of 
type *map[string]bool) as map[string]bool value in argument to getRunOrTestCmd 
(compile)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 690872)
    Time Spent: 50m  (was: 40m)

> Add ability to compile and run JAVA unit-tests
> ----------------------------------------------
>
>                 Key: BEAM-13322
>                 URL: https://issues.apache.org/jira/browse/BEAM-13322
>             Project: Beam
>          Issue Type: Sub-task
>          Components: beam-playground
>            Reporter: Daria Malkova
>            Assignee: Daria Malkova
>            Priority: P3
>              Labels: beam-playground-devops, beam-playground-sprint-4, 
> beam-playground-sprint-5
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> * For unit-tests frontend should pass some additional parameter to 
> distinguish examples from unit-tests
>  * Add preparatory to remove the package and import everything inside the 
> package instead



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to