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

Method executeAll

plugin/studio/testrun/test_run_command.go:133–170  ·  view source on GitHub ↗
(params []testRunParams, ctx plugin.ExecutionContext, logger log.Logger)

Source from the content-addressed store, hash-verified

131}
132
133func (c TestRunCommand) executeAll(params []testRunParams, ctx plugin.ExecutionContext, logger log.Logger) ([]testRunStatus, error) {
134 statusChannel := make(chan testRunStatus)
135 var wg sync.WaitGroup
136 for _, p := range params {
137 wg.Add(1)
138 go c.execute(p, ctx, p.Logger, &wg, statusChannel)
139 }
140
141 go func() {
142 wg.Wait()
143 close(statusChannel)
144 }()
145
146 var progressBar *visualization.ProgressBar
147 if !ctx.Debug {
148 progressBar = visualization.NewProgressBar(logger)
149 defer progressBar.Remove()
150 }
151 once := sync.Once{}
152 progress := c.showPackagingProgress(progressBar)
153 defer once.Do(func() { close(progress) })
154
155 status := make([]testRunStatus, len(params))
156 for s := range statusChannel {
157 once.Do(func() { close(progress) })
158 status[s.ExecutionId] = s
159 c.updateProgressBar(progressBar, status)
160 }
161
162 results := []testRunStatus{}
163 for _, s := range status {
164 if s.Err != nil {
165 return nil, s.Err
166 }
167 results = append(results, s)
168 }
169 return results, nil
170}
171
172func (c TestRunCommand) updateProgressBar(progressBar *visualization.ProgressBar, status []testRunStatus) {
173 if progressBar == nil {

Callers 1

ExecuteMethod · 0.95

Calls 7

executeMethod · 0.95
RemoveMethod · 0.95
showPackagingProgressMethod · 0.95
updateProgressBarMethod · 0.95
NewProgressBarFunction · 0.92
AddMethod · 0.80
WaitMethod · 0.65

Tested by

no test coverage detected