drupalextension icon indicating copy to clipboard operation
drupalextension copied to clipboard

Cannot filter features by line number

Open jhedstrom opened this issue 7 years ago • 1 comments

Due to the way Drupal\DrupalExtension\Context\Environment\Reader::findSubContextClasses() is currently working, filtering a feature file by line number is broken.

vendor/bin/behat  --profile=drupal8 features/d8.feature:7
No scenarios
No steps
4m55.46s (20.82Mb)

In ExerciseController.php line 111:

  No specifications found at path(s) `features/d8.feature:7`. This might be because of incorrect paths configuration in your `suites`.

This is because when it loads each driver, if it implements SubDriverFinderInterface, then the getSubDriverPaths() method is called, which in turn bootstraps Drupal, and that changes the current working directory to Drupal. Thus, relative paths like features/d8.feature result in a file not found issue in Behat's PathsFilter::isFeatureMatch() when realpath($feature->getFile()) returns false.

jhedstrom avatar May 14 '18 18:05 jhedstrom

I can't get vendor/bin/behat features/d8.feature to work even without specifying a line number. Whatever I try I get that error.

jonathanjfshaw avatar Nov 08 '18 11:11 jonathanjfshaw