Closed veldsla closed 9 years ago
Could you write a test for ... this test? :D Don't worry about the breaking build right now. It's just stupid Node 0.8.
Sure, but not before next Monday. It also bothers me that it only catches the parallel execution case. Although this could be fixed using the same proposal I did in issue #269. This might have other side effects which I haven't considered, but it does pass all the tests.
May be an easier approach is to catch the issue at the constructor level by simply comparing the task name to the prereq names. Both is maybe also a good idea...
Tests added
Prereq check in init will be skipped on dependency adding to existing task: https://github.com/jakejs/jake/blob/master/lib/jake.js#L201
Oh, interesting. Yes, probably don't want to leave this loophole here.
But if this is a partial fix for your issue, please feel free to merge if it's passing the Node v0.10 tests.
I had not seen any checks for recursive dependencies, it might be an issue also. @mde, I already have some really nice stuff for jake, but it is lack of testing and depend on our internal code. But we planning to contribute back anyway, so I'll bring patches in nearest future.
Would appreciate any contributions, thanks!
Would it be better to move the checks to the createTask instead of the Task constructor? It looks like the only place new Task is called with arguments.
In my local version I also added a check that validates the prerequisites to be an array of strings. I found out that Jake silently exits when a task depends on a taskname that is undefined.
Just be aware that createTask is called for other types of tasks than just simple Task: https://github.com/jakejs/jake/blob/master/lib/api.js
Adding some tests for this stuff would be awesome too.
I merged it for now. But better dependency checking is still needed.
Excellent, thanks for shepherding this!
Added simple test that detects simple cyclic dependencies at runtime.