Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Don't parse feature files that do not contain tag filter #95

msaspence opened this Issue · 8 comments

2 participants


I'm using tags to only run the scenario I'm currently working on, this is great because it means its quicker
However behat is still parsing everything, with a big test suite this is really adding up
Running just the file with the scenario I'm working on is both a decent workaround and demonstrates the problem

  • Running one scenario (via tag filter) from the entire suite = 4s
  • Running one scenario (via tag filter) from just the feature file it is in = 0.309s

It would be really nice if I didn't have to specify the file that it is was in
If behat did a regex on each feature file to see if it at least contained the tag(s) I'm filtering by before parsing it
There would still be a performance hit with opening all the files and performing a regular expression but I imagine this would be a fraction compared to parsing the file


Whole 4 seconds to parse? How huge your feature suite is?


I don't mean, that there could be something wrong with your suite, i just want to get whole picture in order to come with better solution, cuz regexing files before parsing doesn't look good for me and it will not work in complex cases with tag inheritance.


Currently I have 243 scenarios with 2596 steps


And the feature files are in subfolders to give me some structure


Not sure if that is relavant or not


Ok. Indeed, it's alot. I'm thinking about optional parser caching layer. That could solve all slowness problems.

@everzet everzet closed this issue from a commit
@everzet everzet added *.feature(s) caching mechanism
In order to use this feature, you need to provide `--cache`
option and path to your caching folder, like:

    behat -fprogress --cache /tmp/myproject/behat

Behat will do the rest. Also, if you use this option all the
time, you can specify it in behat.yml:

    # behat.yml.dist
          cache: /tmp/myproject/behat

Behat will serialize every parsed feature into separate
file and will check their mtime on each run, so your features
would be reparsed only when needed.

closes #95
@everzet everzet closed this in 753c4f6

@msaspence it's in the latest release already (2.3.3) does it fixes your problem?


Yes that is epic, thanks
from 3.5 seconds to parse suite but not run anything to .193s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.