MCPcopy Index your code
hub / github.com/bootdotdev/bootdev / ApplySubmissionResults

Function ApplySubmissionResults

checks/runner.go:115–162  ·  view source on GitHub ↗
(cliData api.CLIData, failure *api.StructuredErrCLI, ch chan tea.Msg)

Source from the content-addressed store, hash-verified

113}
114
115func ApplySubmissionResults(cliData api.CLIData, failure *api.StructuredErrCLI, ch chan tea.Msg) {
116 for i, step := range cliData.Steps {
117 stepPass := true
118 isFailedStep := false
119 if failure != nil {
120 stepPass = i < failure.FailedStepIndex
121 isFailedStep = i == failure.FailedStepIndex
122 }
123
124 ch <- messages.ResolveStepMsg{
125 Index: i,
126 Passed: &stepPass,
127 }
128
129 if step.CLICommand != nil {
130 for j := range step.CLICommand.Tests {
131 if isFailedStep && j > failure.FailedTestIndex {
132 break
133 }
134
135 testPass := stepPass || (isFailedStep && j < failure.FailedTestIndex)
136 ch <- messages.ResolveTestMsg{
137 StepIndex: i,
138 TestIndex: j,
139 Passed: &testPass,
140 }
141 }
142 }
143 if step.HTTPRequest != nil {
144 for j := range step.HTTPRequest.Tests {
145 if isFailedStep && j > failure.FailedTestIndex {
146 break
147 }
148
149 testPass := stepPass || (isFailedStep && j < failure.FailedTestIndex)
150 ch <- messages.ResolveTestMsg{
151 StepIndex: i,
152 TestIndex: j,
153 Passed: &testPass,
154 }
155 }
156 }
157
158 if !stepPass {
159 break
160 }
161 }
162}
163
164func handleSleep(s api.Sleepable, ch chan tea.Msg) {
165 sleepMs := s.GetSleepAfterMs()

Callers 2

submissionHandlerFunction · 0.92

Calls

no outgoing calls

Tested by 1