Hook files must be sorted by file names.#26
Conversation
|
@geekbrother Thanks for the PR! I think this is a good idea, but I'm actually considering this should be directly a part of Dredd so the behavior is consistent for all hooks. I'm even surprised Dredd doesn't evaluate the glob before passing it to the hooks handler, because glob implementations can differ between languages. If this functionality was shifted to Dredd, glob evaluation would happen there and hook handlers would get a resolved list of files, would that be a solution for you? Would you be willing to work on it? |
|
It would be great to add this directly to Dredd, but it needs to change dredd -> hook_language communication for each hook language :( It can be done in feature and I can do this by PRs to Dredd and hook_languages repos. |
|
I'd merge this one and solve it generally later, what do you think @honzajavorek ? |
|
I agree! |
|
I filed this: apiaryio/dredd#680 |
Example
We have some hook files, they named for control hooks flow in case of using glob filepathes:
dredd.yml using glob path:
At the Dredd start it will produce console output:
info: Found Hookfiles: 0=/_hooks/10-first.py, 1=/_hooks/20-second.py, 2=/_hooks/30-third.pyso we'll expect this order of hooks execution.
But python glob returns unordered files list. As a result hook files are executed unordered and we can't control hooks execution flow.