A new template version with a preset without prebuilds configured should result in no prebuilds being created.
(t *testing.T)
| 76 | |
| 77 | // A new template version with a preset without prebuilds configured should result in no prebuilds being created. |
| 78 | func TestNoPrebuilds(t *testing.T) { |
| 79 | t.Parallel() |
| 80 | current := opts[optionSet0] |
| 81 | clock := quartz.NewMock(t) |
| 82 | |
| 83 | presets := []database.GetTemplatePresetsWithPrebuildsRow{ |
| 84 | preset(true, 0, current), |
| 85 | } |
| 86 | |
| 87 | snapshot := prebuilds.NewGlobalSnapshot(presets, nil, nil, nil, nil, nil, nil, clock, testutil.Logger(t)) |
| 88 | ps, err := snapshot.FilterByPreset(current.presetID) |
| 89 | require.NoError(t, err) |
| 90 | |
| 91 | state := ps.CalculateState() |
| 92 | actions, err := ps.CalculateActions(backoffInterval) |
| 93 | require.NoError(t, err) |
| 94 | |
| 95 | validateState(t, prebuilds.ReconciliationState{ /*all zero values*/ }, *state) |
| 96 | validateActions(t, nil, actions) |
| 97 | } |
| 98 | |
| 99 | // A new template version with a preset with prebuilds configured should result in a new prebuild being created. |
| 100 | func TestNetNew(t *testing.T) { |
nothing calls this directly
no test coverage detected