예제 #1
0
파일: run_test.go 프로젝트: sr/pachyderm
func TestGetNameToNodeInfo(t *testing.T) {
	pipeline, err := parse.NewParser().ParsePipeline("../parse/testdata/basic")
	require.NoError(t, err)
	nodeInfos, err := getNameToNodeInfo(pipeline.NameToNode)
	require.NoError(t, err)
	require.Equal(t, []string{"bar-node"}, nodeInfos["baz-node-bar-in-bar-out-in"].Parents)
}
예제 #2
0
func TestBasic(t *testing.T) {
	pipeline, err := parse.NewParser().ParsePipeline("../parse/testdata/basic", "")
	require.NoError(t, err)
	pipelineInfo, err := NewGrapher().GetPipelineInfo(pipeline)
	require.NoError(t, err)
	m := pipelineInfo.NameToNodeInfo
	require.Equal(t, []string{"baz-node-bar-in-bar-out-in"}, m["bar-node"].Children)
	require.Equal(t, []string{"bar-node"}, m["baz-node-bar-in-bar-out-in"].Parents)
}
예제 #3
0
func getDirPathAndPipeline(pipelineSource *pps.PipelineSource) (string, *pps.Pipeline, error) {
	if pipelineSource.GithubPipelineSource != nil {
		dirPath, err := githubClone(pipelineSource.GithubPipelineSource)
		if err != nil {
			return "", nil, err
		}
		pipeline, err := parse.NewParser().ParsePipeline(dirPath, pipelineSource.GithubPipelineSource.ContextDir)
		if err != nil {
			return "", nil, err
		}
		return dirPath, pipeline, nil
	}
	return "", nil, fmt.Errorf("must specify pipeline source")
}
예제 #4
0
파일: sourcer.go 프로젝트: sr/pachyderm
func getDirPathAndPipeline(pipelineSource *pps.PipelineSource) (string, *pps.Pipeline, error) {
	if pipelineSource.GetGithubPipelineSource() != nil {
		dirPath, err := githubClone(pipelineSource.GetGithubPipelineSource())
		if err != nil {
			return "", nil, err
		}
		dirPath = filepath.Join(dirPath, pipelineSource.GetGithubPipelineSource().ContextDir)
		pipeline, err := parse.NewParser().ParsePipeline(dirPath)
		if err != nil {
			return "", nil, err
		}
		pipeline.PipelineSourceId = pipelineSource.Id
		return dirPath, pipeline, nil
	}
	return "", nil, fmt.Errorf("must specify pipeline source")
}