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]