From 533d8d171faa610108ca55adb0f33ef107155c0c Mon Sep 17 00:00:00 2001 From: Timur Sultanov Date: Wed, 31 May 2023 18:48:09 +0400 Subject: [PATCH] [Playground] Fix graph.dot search path Fix search path for the graph.dot file which contains the graph of the pipeline execution. The feature got broken after PR #26842. --- playground/backend/internal/fs_tool/fs.go | 2 +- playground/backend/internal/fs_tool/fs_test.go | 4 ++-- playground/backend/internal/fs_tool/go_fs_test.go | 2 +- playground/backend/internal/fs_tool/lc_constructor.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/playground/backend/internal/fs_tool/fs.go b/playground/backend/internal/fs_tool/fs.go index 9c49fca53a0a..7247eb5ebd73 100644 --- a/playground/backend/internal/fs_tool/fs.go +++ b/playground/backend/internal/fs_tool/fs.go @@ -43,7 +43,7 @@ type LifeCyclePaths struct { AbsoluteExecutableFilePath string // /path/to/workingDir/pipelinesFolder/{pipelineId}/bin/{pipelineId}.{executableFileExtension} AbsoluteBaseFolderPath string // /path/to/workingDir/pipelinesFolder/{pipelineId} AbsoluteLogFilePath string // /path/to/workingDir/pipelinesFolder/{pipelineId}/logs.log - AbsoluteGraphFilePath string // /path/to/workingDir/pipelinesFolder/{pipelineId}/graph.dot + AbsoluteGraphFilePath string // /path/to/workingDir/pipelinesFolder/{pipelineId}/src/graph.dot ProjectDir string // /path/to/workingDir/ FindExecutableName func(context.Context, string) (string, error) FindTestExecutableName func(context.Context, string) (string, error) diff --git a/playground/backend/internal/fs_tool/fs_test.go b/playground/backend/internal/fs_tool/fs_test.go index db029635961f..3f0c9b012168 100644 --- a/playground/backend/internal/fs_tool/fs_test.go +++ b/playground/backend/internal/fs_tool/fs_test.go @@ -313,7 +313,7 @@ func TestNewLifeCycle(t *testing.T) { AbsoluteExecutableFilePath: filepath.Join(execFileFolder, fmt.Sprintf("%s%s", pipelineId.String(), javaCompiledFileExtension)), AbsoluteBaseFolderPath: baseFileFolder, AbsoluteLogFilePath: filepath.Join(baseFileFolder, logFileName), - AbsoluteGraphFilePath: filepath.Join(baseFileFolder, utils.GraphFileName), + AbsoluteGraphFilePath: filepath.Join(srcFileFolder, utils.GraphFileName), }, }, }, @@ -335,7 +335,7 @@ func TestNewLifeCycle(t *testing.T) { AbsoluteExecutableFilePath: filepath.Join(execFileFolder, fmt.Sprintf("%s%s", pipelineId.String(), goExecutableFileExtension)), AbsoluteBaseFolderPath: baseFileFolder, AbsoluteLogFilePath: filepath.Join(baseFileFolder, logFileName), - AbsoluteGraphFilePath: filepath.Join(baseFileFolder, utils.GraphFileName), + AbsoluteGraphFilePath: filepath.Join(srcFileFolder, utils.GraphFileName), }, }, }, diff --git a/playground/backend/internal/fs_tool/go_fs_test.go b/playground/backend/internal/fs_tool/go_fs_test.go index e5e513fd2531..c0d832bcccf0 100644 --- a/playground/backend/internal/fs_tool/go_fs_test.go +++ b/playground/backend/internal/fs_tool/go_fs_test.go @@ -58,7 +58,7 @@ func Test_newGoLifeCycle(t *testing.T) { AbsoluteExecutableFilePath: filepath.Join(binFileFolder, pipelineId.String()+goExecutableFileExtension), AbsoluteBaseFolderPath: baseFileFolder, AbsoluteLogFilePath: filepath.Join(baseFileFolder, logFileName), - AbsoluteGraphFilePath: filepath.Join(baseFileFolder, utils.GraphFileName), + AbsoluteGraphFilePath: filepath.Join(srcFileFolder, utils.GraphFileName), }, }, }, diff --git a/playground/backend/internal/fs_tool/lc_constructor.go b/playground/backend/internal/fs_tool/lc_constructor.go index a33f07b5633f..83179cdd4d2f 100644 --- a/playground/backend/internal/fs_tool/lc_constructor.go +++ b/playground/backend/internal/fs_tool/lc_constructor.go @@ -40,7 +40,7 @@ func newCompilingLifeCycle(pipelineId uuid.UUID, pipelinesFolder, sourceFileExte absExecFilePath, _ := filepath.Abs(filepath.Join(absExecFileFolderPath, execFileName)) absBaseFolderPath, _ := filepath.Abs(baseFileFolder) absLogFilePath, _ := filepath.Abs(filepath.Join(absBaseFolderPath, logFileName)) - absGraphFilePath, _ := filepath.Abs(filepath.Join(absBaseFolderPath, utils.GraphFileName)) + absGraphFilePath, _ := filepath.Abs(filepath.Join(absSrcFileFolderPath, utils.GraphFileName)) return &LifeCycle{ folderGlobs: []string{baseFileFolder, srcFileFolder, binFileFolder},