(t *testing.T)
| 369 | } |
| 370 | |
| 371 | func 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 | }, |
nothing calls this directly
no test coverage detected