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

Function TestSchedulePreprocessing

pkg/workflow/schedule_preprocessing_test.go:371–576  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

369}
370
371func TestSchedulePreprocessing(t *testing.T) {
372 tests := []struct {
373 name string
374 frontmatter map[string]any
375 workflowIdentifier string
376 expectedCron string
377 checkScattered bool
378 expectedError bool
379 errorSubstring string
380 }{
381 {
382 name: "daily schedule",
383 frontmatter: map[string]any{
384 "on": map[string]any{
385 "schedule": []any{
386 map[string]any{
387 "cron": "0 2 * * *",
388 },
389 },
390 },
391 },
392 expectedCron: "0 2 * * *",
393 },
394 {
395 name: "weekly schedule",
396 frontmatter: map[string]any{
397 "on": map[string]any{
398 "schedule": []any{
399 map[string]any{
400 "cron": "30 6 * * 1",
401 },
402 },
403 },
404 },
405 expectedCron: "30 6 * * 1",
406 },
407 {
408 name: "interval schedule",
409 frontmatter: map[string]any{
410 "on": map[string]any{
411 "schedule": []any{
412 map[string]any{
413 "cron": "every 10 minutes",
414 },
415 },
416 },
417 },
418 workflowIdentifier: "test-workflow.md",
419 checkScattered: true,
420 },
421 {
422 name: "existing cron expression unchanged",
423 frontmatter: map[string]any{
424 "on": map[string]any{
425 "schedule": []any{
426 map[string]any{
427 "cron": "0 9 * * 1",
428 },

Callers

nothing calls this directly

Calls 6

SetWorkflowIdentifierMethod · 0.95
NewCompilerFunction · 0.85
RunMethod · 0.45
ErrorfMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected