[
https://issues.apache.org/jira/browse/BEAM-13872?focusedWorklogId=729542&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-729542
]
ASF GitHub Bot logged work on BEAM-13872:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 18/Feb/22 09:27
Start Date: 18/Feb/22 09:27
Worklog Time Spent: 10m
Work Description: daria-malkova commented on a change in pull request
#16891:
URL: https://github.com/apache/beam/pull/16891#discussion_r809814856
##########
File path: playground/backend/internal/code_processing/code_processing_test.go
##########
@@ -962,35 +984,69 @@ func Test_runStep(t *testing.T) {
pipelineOptions string
pipelineLifeCycleCtx context.Context
cancelChannel chan bool
+ createExecFile bool
}
tests := []struct {
name string
args args
code string
}{
{
- name: "Test run step working without an error",
+ name: "Test run step working on python sdk without an
error",
args: args{
ctx: context.Background(),
cacheService: cacheService,
pipelineId: uuid.UUID{},
isUnitTest: false,
- sdkEnv: sdkEnv,
+ sdkEnv: &sdkPythonEnv,
pipelineOptions: "",
pipelineLifeCycleCtx: context.Background(),
cancelChannel: make(chan bool, 1),
+ createExecFile: true,
},
code: "if __name__ == \"__main__\":\n print(\"Hello
world!\")\n",
},
+ {
+ name: "Test run step working on go sdk",
+ args: args{
+ ctx: context.Background(),
+ cacheService: cacheService,
+ pipelineId: uuid.New(),
+ isUnitTest: true,
+ sdkEnv: &sdkGoEnv,
+ pipelineOptions: "",
+ pipelineLifeCycleCtx: context.Background(),
+ cancelChannel: make(chan bool, 1),
+ createExecFile: true,
+ },
+ code: "package main\nimport \"fmt\"\nfunc main() {\n
fmt.Println(\"hello world\")\n}\n",
Review comment:
I would suggest to extract code variables with useful names
##########
File path: playground/backend/internal/code_processing/code_processing_test.go
##########
@@ -695,7 +714,7 @@ func Benchmark_ProcessPython(b *testing.B) {
}
b.StartTimer()
- Process(ctx, cacheService, lc, pipelineId, appEnv, sdkEnv, "")
+ Process(ctx, cacheService, lc, pipelineId, appEnv, sdkEnv,
"--output t.txt")
Review comment:
Let's move it to constant as well as it's done with others)
##########
File path: playground/backend/internal/code_processing/code_processing_test.go
##########
@@ -962,35 +984,69 @@ func Test_runStep(t *testing.T) {
pipelineOptions string
pipelineLifeCycleCtx context.Context
cancelChannel chan bool
+ createExecFile bool
}
tests := []struct {
name string
args args
code string
}{
{
- name: "Test run step working without an error",
+ name: "Test run step working on python sdk without an
error",
args: args{
ctx: context.Background(),
cacheService: cacheService,
pipelineId: uuid.UUID{},
isUnitTest: false,
- sdkEnv: sdkEnv,
+ sdkEnv: &sdkPythonEnv,
pipelineOptions: "",
pipelineLifeCycleCtx: context.Background(),
cancelChannel: make(chan bool, 1),
+ createExecFile: true,
},
code: "if __name__ == \"__main__\":\n print(\"Hello
world!\")\n",
},
+ {
+ name: "Test run step working on go sdk",
+ args: args{
+ ctx: context.Background(),
+ cacheService: cacheService,
+ pipelineId: uuid.New(),
+ isUnitTest: true,
+ sdkEnv: &sdkGoEnv,
+ pipelineOptions: "",
+ pipelineLifeCycleCtx: context.Background(),
+ cancelChannel: make(chan bool, 1),
+ createExecFile: true,
+ },
+ code: "package main\nimport \"fmt\"\nfunc main() {\n
fmt.Println(\"hello world\")\n}\n",
+ },
+ {
+ name: "Test run step without preparing files with code",
+ args: args{
+ ctx: context.Background(),
+ cacheService: cacheService,
+ pipelineId: uuid.UUID{},
+ isUnitTest: true,
+ sdkEnv: sdkJavaEnv,
+ pipelineOptions: "",
+ pipelineLifeCycleCtx: context.Background(),
+ cancelChannel: make(chan bool, 1),
+ createExecFile: false,
+ },
+ code: "class HelloWorld {\n public static void
main(String[] args) {\n System.out.println(\"Hello world!\");\n }\n}",
Review comment:
ditto
--
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: 729542)
Time Spent: 0.5h (was: 20m)
> [Playground] Increase test coverage for the code_processing package
> -------------------------------------------------------------------
>
> Key: BEAM-13872
> URL: https://issues.apache.org/jira/browse/BEAM-13872
> Project: Beam
> Issue Type: Sub-task
> Components: beam-playground
> Reporter: Aydar Zaynutdinov
> Assignee: Pavel Avilov
> Priority: P3
> Labels: beam-playground-backend
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Need to add unit tests to increase test coverage for the _code_processing_
> package.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)