You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/12/17 14:38:52 UTC

[GitHub] [beam] AydarZaynutdinov commented on a change in pull request #16273: [BEAM-13478][Playground][Bugfix] Fix java unit test

AydarZaynutdinov commented on a change in pull request #16273:
URL: https://github.com/apache/beam/pull/16273#discussion_r771437886



##########
File path: playground/backend/internal/environment/environment_service.go
##########
@@ -173,9 +174,13 @@ func createExecutorConfig(apacheBeamSdk pb.Sdk, configPath string) (*ExecutorCon
 	}
 	switch apacheBeamSdk {
 	case pb.Sdk_SDK_JAVA:
-		executorConfig.CompileArgs = append(executorConfig.CompileArgs, getEnv(beamPathKey, defaultBeamJarsPath))
-		executorConfig.RunArgs[1] = fmt.Sprintf("%s%s", executorConfig.RunArgs[1], getEnv(beamPathKey, defaultBeamJarsPath))
-		executorConfig.TestArgs[1] = fmt.Sprintf("%s%s", executorConfig.TestArgs[1], getEnv(beamPathKey, defaultBeamJarsPath))
+		args, err := concatBeamJarsToString()
+		if err != nil {
+			return nil, err

Review comment:
       Need to add some log here or in `concatBeamJarsToString()` method

##########
File path: playground/backend/internal/fs_tool/fs_test.go
##########
@@ -303,7 +303,7 @@ func TestLifeCycle_GetAbsoluteExecutableFilePath(t *testing.T) {
 	baseFileFolder := fmt.Sprintf("%s_%s", baseFileFolder, pipelineId)
 	srcFileFolder := baseFileFolder + "/src"
 
-	filePath := fmt.Sprintf("%s/%s", srcFileFolder, pipelineId.String()+javaSourceFileExtension)
+	filePath := fmt.Sprintf("%s/%s", srcFileFolder, pipelineId.String()+JavaSourceFileExtension)

Review comment:
       ```suggestion
   	filePath := filepath.Join(srcFileFolder, fmt.Sprintf("%s%s", pipelineId.String(), JavaSourceFileExtension))
   ```

##########
File path: playground/backend/internal/preparators/go_preparators.go
##########
@@ -51,16 +54,15 @@ func formatCode(args ...interface{}) error {
 	return nil
 }
 
-func changeFileName(args ...interface{}) error {
+func changeGoTestFileName(args ...interface{}) error {
 	filePath := args[0].(string)
-	isUnitTest := args[1].(bool)
-	if isUnitTest {
+	validationResults := args[1].(*sync.Map)
+	isUnitTest, ok := validationResults.Load(validators.UnitTestValidatorName)
+	if ok && isUnitTest.(bool) {
 		testFileName := fmt.Sprintf("%s_test.%s", strings.Split(filePath, sep)[0], goName)
-		cmd := exec.Command(mvCmd, filePath, testFileName)
-		fmt.Println(cmd.String())
-		stdout, err := cmd.CombinedOutput()
+		err := os.Rename(filePath, testFileName)
 		if err != nil {
-			return errors.New(string(stdout))
+			return err

Review comment:
       Maybe add some log here?




-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org