Tags: Behat/Gherkin
Tags
fix: Reinstate support for legacy tag filters without `@` prefix (#407) As reported by @carlos-granados in #406, the 4.16.0 release broke tag filtering where the tag expression does not contain `@` symbols [e.g. in Behat](https://github.com/Behat/Behat/actions/runs/20028377501/job/57431075976). Behat's filter expression in the failing feature is arguably incorrect: * It uses `new TagFilter('tag2')` (note no leading `@`) - the PHP config object is obviously new but the value has been the same since [the feature was first added in 2014](https://github.com/Behat/Behat/pull/434/files#diff-ca77b0b1e7860ced7eb08cc40f9d6648acc0760a0be45c5fd76a8a19992adbebR92) * All the Behat documentation shows expressing tag filters with the leading `@` e.g. https://docs.behat.org/en/latest/user_guide/configuration/suites.html#suite-filters * The actual implementation of tag filtering is done in Behat/Gherkin. Gherkin's [TagFilterTest only tests tag expressions where the leading `@` is included](https://github.com/Behat/Gherkin/blame/297297343c125d058e18b3f03a24ebb32f70b69d/tests/Filter/TagFilterTest.php) and that appears to have been the case from the beginning. As far as I can see, `TagFilter` has therefore never been meant to accept that expression, and it's been working by accident. However, we obviously don't validate the expression, and we have decided we should reintroduce support for it if even Behat has been relying on it until now. Note that this syntax is officially deprecated and will be removed in the next major - see #408
PreviousNext