(t *testing.T)
| 69 | } |
| 70 | |
| 71 | func TestDetectWorkflowScheduleInfo(t *testing.T) { |
| 72 | tests := []struct { |
| 73 | name string |
| 74 | content string |
| 75 | wantRawExpr string |
| 76 | wantFrequency string |
| 77 | wantIsUpdatable bool |
| 78 | wantIsMultiTrigger bool |
| 79 | wantIsOnMap bool |
| 80 | }{ |
| 81 | { |
| 82 | name: "simple on: daily", |
| 83 | content: `--- |
| 84 | on: daily |
| 85 | engine: copilot |
| 86 | --- |
| 87 | # Daily report |
| 88 | `, |
| 89 | wantRawExpr: "daily", |
| 90 | wantFrequency: "daily", |
| 91 | wantIsUpdatable: true, |
| 92 | }, |
| 93 | { |
| 94 | name: "simple on: weekly", |
| 95 | content: `--- |
| 96 | on: weekly |
| 97 | engine: copilot |
| 98 | --- |
| 99 | `, |
| 100 | wantRawExpr: "weekly", |
| 101 | wantFrequency: "weekly", |
| 102 | wantIsUpdatable: true, |
| 103 | }, |
| 104 | { |
| 105 | name: "simple on: hourly", |
| 106 | content: `--- |
| 107 | on: hourly |
| 108 | engine: copilot |
| 109 | --- |
| 110 | `, |
| 111 | wantRawExpr: "hourly", |
| 112 | wantFrequency: "hourly", |
| 113 | wantIsUpdatable: true, |
| 114 | }, |
| 115 | { |
| 116 | name: "simple on: every 3h", |
| 117 | content: `--- |
| 118 | on: every 3h |
| 119 | engine: copilot |
| 120 | --- |
| 121 | `, |
| 122 | wantRawExpr: "every 3h", |
| 123 | wantFrequency: "3-hourly", |
| 124 | wantIsUpdatable: true, |
| 125 | }, |
| 126 | { |
| 127 | name: "on: with custom cron", |
| 128 | content: `--- |
nothing calls this directly
no test coverage detected