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

Method execute

plugin/studio/testrun/test_run_command.go:200–228  ·  view source on GitHub ↗
(params testRunParams, ctx plugin.ExecutionContext, logger log.Logger, wg *sync.WaitGroup, status chan<- testRunStatus)

Source from the content-addressed store, hash-verified

198}
199
200func (c TestRunCommand) execute(params testRunParams, ctx plugin.ExecutionContext, logger log.Logger, wg *sync.WaitGroup, status chan<- testRunStatus) {
201 defer wg.Done()
202 defer func() { _ = os.RemoveAll(params.Destination) }()
203 args := c.preparePackArguments(params, ctx)
204 exitCode, stdErr, err := params.Uipcli.ExecuteAndWait(args...)
205 if err != nil {
206 status <- *newTestRunStatusError(params.ExecutionId, err)
207 return
208 }
209 if exitCode != 0 {
210 status <- *newTestRunStatusError(params.ExecutionId, fmt.Errorf("Error packaging tests: %v", stdErr))
211 return
212 }
213
214 nupkgPath := studio.FindLatestNupkg(params.Destination)
215 nupkgReader := studio.NewNupkgReader(nupkgPath)
216 nuspec, err := nupkgReader.ReadNuspec()
217 if err != nil {
218 status <- *newTestRunStatusError(params.ExecutionId, err)
219 return
220 }
221
222 folderId, testSet, execution, err := c.runTests(nupkgPath, nuspec.Id, nuspec.Version, params, ctx, logger, status)
223 if err != nil {
224 status <- *newTestRunStatusError(params.ExecutionId, err)
225 return
226 }
227 status <- *newTestRunStatusDone(params.ExecutionId, folderId, len(execution.TestCaseExecutions), testSet, execution)
228}
229
230func (c TestRunCommand) runTests(nupkgPath string, processKey string, processVersion string, params testRunParams, ctx plugin.ExecutionContext, logger log.Logger, status chan<- testRunStatus) (int, *api.TestSet, *api.TestExecution, error) {
231 status <- *newTestRunStatusUploading(params.ExecutionId)

Callers 1

executeAllMethod · 0.95

Calls 8

preparePackArgumentsMethod · 0.95
ReadNuspecMethod · 0.95
runTestsMethod · 0.95
FindLatestNupkgFunction · 0.92
NewNupkgReaderFunction · 0.92
newTestRunStatusErrorFunction · 0.85
newTestRunStatusDoneFunction · 0.85
ExecuteAndWaitMethod · 0.80

Tested by

no test coverage detected