Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
msaspence opened this Issue · 8 comments

2 participants

@msaspence

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

@everzet
Owner

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

@everzet
Owner

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.

@msaspence

Currently I have 243 scenarios with 2596 steps

@msaspence

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

ie:
feature/{catagory}/{test}.feature

Not sure if that is relavant or not

@everzet
Owner

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

@msaspence
@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
    default:
      options:
          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
753c4f6
@everzet everzet closed this in 753c4f6
@everzet
Owner

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

@msaspence

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.