MCPcopy Create free account
hub / github.com/github/gh-aw / TestIsRunnable

Function TestIsRunnable

pkg/cli/commands_utils_test.go:360–660  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

358}
359
360func TestIsRunnable(t *testing.T) {
361 tests := []struct {
362 name string
363 mdContent string
364 lockContent string
365 expected bool
366 expectError bool
367 errorMessage string
368 }{
369 {
370 name: "workflow with schedule trigger",
371 mdContent: `---
372on:
373 schedule:
374 - cron: "0 9 * * *"
375---
376# Test Workflow
377This workflow runs on schedule.`,
378 lockContent: `name: "Test Workflow"
379on:
380 schedule:
381 - cron: "0 9 * * *"
382 workflow_dispatch:
383jobs:
384 test:
385 runs-on: ubuntu-latest
386 steps:
387 - run: echo "test"
388`,
389 expected: true,
390 expectError: false,
391 },
392 {
393 name: "workflow with workflow_dispatch trigger",
394 mdContent: `---
395on:
396 workflow_dispatch:
397---
398# Manual Workflow
399This workflow can be triggered manually.`,
400 lockContent: `name: "Manual Workflow"
401on:
402 workflow_dispatch:
403jobs:
404 test:
405 runs-on: ubuntu-latest
406 steps:
407 - run: echo "test"
408`,
409 expected: true,
410 expectError: false,
411 },
412 {
413 name: "workflow with both schedule and workflow_dispatch",
414 mdContent: `---
415on:
416 schedule:
417 - cron: "0 9 * * 1"

Callers

nothing calls this directly

Calls 5

TempDirFunction · 0.92
IsRunnableFunction · 0.85
RunMethod · 0.45
ErrorfMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected