(t *testing.T)
| 748 | } |
| 749 | |
| 750 | func TestSelfReference(t *testing.T) { |
| 751 | rt, id := testruntime.NewInstance(t) |
| 752 | testruntime.PutFiles(t, rt, id, map[string]string{ |
| 753 | "/models/bar1.sql": `SELECT * FROM bar1`, |
| 754 | }) |
| 755 | bar1Model, bar1Res := newModel("SELECT * FROM bar1", "bar1", "bar1", 0) |
| 756 | bar1Res.Meta.Refs[0].Kind = runtime.ResourceKindModel |
| 757 | bar1Res.Meta.ReconcileError = `cyclic dependency` |
| 758 | bar1Model.State = &runtimev1.ModelState{} |
| 759 | |
| 760 | testruntime.ReconcileParserAndWait(t, rt, id) |
| 761 | testruntime.RequireReconcileState(t, rt, id, 2, 1, 0) |
| 762 | testruntime.RequireResource(t, rt, id, bar1Res) |
| 763 | |
| 764 | testruntime.DeleteFiles(t, rt, id, "/models/bar1.sql") |
| 765 | testruntime.ReconcileParserAndWait(t, rt, id) |
| 766 | testruntime.RequireReconcileState(t, rt, id, 1, 0, 0) |
| 767 | } |
| 768 | |
| 769 | func TestCyclesWithThreeModels(t *testing.T) { |
| 770 | // Create cyclic model |
nothing calls this directly
no test coverage detected