MCPcopy
hub / github.com/cli/cli / TestRun

Function TestRun

pkg/cmd/workflow/run/run_test.go:321–1164  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

319}
320
321func TestRun(t *testing.T) {
322 noInputsYAMLContent := []byte(`
323name: minimal workflow
324on: workflow_dispatch
325jobs:
326 yell:
327 runs-on: ubuntu-latest
328 steps:
329 - name: do a yell
330 run: |
331 echo "AUUUGH!"
332`)
333 encodedNoInputsYAMLContent := base64.StdEncoding.EncodeToString(noInputsYAMLContent)
334 yamlContent := []byte(`
335name: a workflow
336on:
337 workflow_dispatch:
338 inputs:
339 greeting:
340 default: hi
341 description: a greeting
342 name:
343 required: true
344 description: a name
345jobs:
346 greet:
347 runs-on: ubuntu-latest
348 steps:
349 - name: perform the greet
350 run: |
351 echo "${{ github.event.inputs.greeting}}, ${{ github.events.inputs.name }}!"`)
352
353 encodedYAMLContent := base64.StdEncoding.EncodeToString(yamlContent)
354
355 yamlContentChoiceIp := []byte(`
356name: choice inputs
357on:
358 workflow_dispatch:
359 inputs:
360 name:
361 type: choice
362 description: Who to greet
363 default: monalisa
364 options:
365 - monalisa
366 - cschleiden
367 favourite-animal:
368 type: choice
369 description: What's your favourite animal
370 required: true
371 options:
372 - dog
373 - cat
374jobs:
375 greet:
376 runs-on: ubuntu-latest
377 steps:
378 - name: Send greeting

Callers

nothing calls this directly

Calls 15

RegisterMethod · 0.95
VerifyMethod · 0.95
RESTFunction · 0.92
JSONResponseFunction · 0.92
StatusStringResponseFunction · 0.92
StatusJSONResponseFunction · 0.92
TestFunction · 0.92
InitRepoHostnameFunction · 0.92
NewMockPrompterFunction · 0.92
runRunFunction · 0.85
SetStdinTTYMethod · 0.80
SetStdoutTTYMethod · 0.80

Tested by

no test coverage detected