MCPcopy Create free account
hub / github.com/UiPath/uipathcli / prepareExecution

Method prepareExecution

plugin/studio/testrun/test_run_command.go:100–131  ·  view source on GitHub ↗
(sources []string, timeout time.Duration, attachRobotLogs bool, folder string, logger log.Logger)

Source from the content-addressed store, hash-verified

98}
99
100func (c TestRunCommand) prepareExecution(sources []string, timeout time.Duration, attachRobotLogs bool, folder string, logger log.Logger) ([]testRunParams, error) {
101 tmp, err := directories.Temp()
102 if err != nil {
103 return nil, err
104 }
105
106 params := []testRunParams{}
107 for i, source := range sources {
108 projectReader := studio.NewStudioProjectReader(source)
109 project, err := projectReader.ReadMetadata()
110 if err != nil {
111 return nil, err
112 }
113 supported, err := project.TargetFramework.IsSupported()
114 if !supported {
115 return nil, err
116 }
117
118 executionLogger := logger
119 if len(sources) > 1 {
120 executionLogger = NewMultiLogger(logger, "["+strconv.Itoa(i+1)+"] ")
121 }
122 uipcli := studio.NewUipcli(c.Exec, executionLogger)
123 err = uipcli.Initialize(project.TargetFramework)
124 if err != nil {
125 return nil, err
126 }
127 destination := filepath.Join(tmp, c.randomTestRunFolderName())
128 params = append(params, *newTestRunParams(i, uipcli, executionLogger, source, destination, timeout, attachRobotLogs, folder))
129 }
130 return params, nil
131}
132
133func (c TestRunCommand) executeAll(params []testRunParams, ctx plugin.ExecutionContext, logger log.Logger) ([]testRunStatus, error) {
134 statusChannel := make(chan testRunStatus)

Callers 1

ExecuteMethod · 0.95

Calls 9

ReadMetadataMethod · 0.95
InitializeMethod · 0.95
TempFunction · 0.92
NewStudioProjectReaderFunction · 0.92
NewUipcliFunction · 0.92
NewMultiLoggerFunction · 0.85
newTestRunParamsFunction · 0.85
IsSupportedMethod · 0.80

Tested by

no test coverage detected