File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,12 @@ func (e *Executor) CheckCyclicDep() error {
1313 defer delete (visits , name )
1414
1515 for _ , d := range t .Deps {
16- if err := checkCyclicDep (d .Task , e .Tasks [d .Task ]); err != nil {
16+ // FIXME: ignoring by now. should return an error instead?
17+ task , ok := e .Tasks [d .Task ]
18+ if ! ok {
19+ continue
20+ }
21+ if err := checkCyclicDep (d .Task , task ); err != nil {
1722 return err
1823 }
1924 }
Original file line number Diff line number Diff line change @@ -35,4 +35,22 @@ func TestCyclicDepCheck(t *testing.T) {
3535 }
3636
3737 assert .NoError (t , isNotCyclic .CheckCyclicDep ())
38+
39+ inexixtentTask := & task.Executor {
40+ Tasks : task.Tasks {
41+ "task-a" : & task.Task {
42+ Deps : []* task.Dep {& task.Dep {Task : "invalid-task" }},
43+ },
44+ },
45+ }
46+
47+ // FIXME: by now Task should ignore non existent tasks
48+ // in the future we should improve the detection of
49+ // tasks called with interpolation?
50+ // task:
51+ // deps:
52+ // - task: "task{{.VARIABLE}}"
53+ // vars:
54+ // VARIABLE: something
55+ assert .NoError (t , inexixtentTask .CheckCyclicDep ())
3856}
You can’t perform that action at this time.
0 commit comments