Description
Q | A |
---|---|
Bug report? | yes |
Feature request? | no |
BC Break report? | yes |
RFC? | yes |
Symfony version | 3.4.1 |
PHP version | 5.6.14 |
My first bug report, sorry if I mess something up or am missing information.
Seemingly after #25241, our YAML config file my work uses for behat testing started throwing this error when being parsed:
In Parser.php line 478:
Unable to parse at line 14 (near " baseUri: http://localhost:8080").
Here is our YAML config:
# behat.yml
default:
gherkin:
filters:
tags: "~@platform"
suites:
webservices:
paths: [ %paths.base%/webservices ]
contexts:
- FeatureContext:
# Local
baseUri: http://localhost:8080
basePath: /1.0
# Dev
# baseUri: https://www.exampleurl.com
# basePath: /1.0
# QA
# baseUri: https://www.exampleurl.com
# basePath: /1.0
# Staging
# baseUri: https://www.exampleurl.com
# basePath: /1.0
# Debug
# debug: true
We have it this way to easily switch environments for testing by commenting/uncommenting values. It worked until yesterday. It still fails if I try to use other baseUri and basePath values and by commenting/uncommenting.
I can get it to work now by removing the leading comment (for example, # Local
or # Dev
). A working config looks like this:
# behat.yml
default:
gherkin:
filters:
tags: "~@platform"
suites:
webservices:
paths: [ %paths.base%/webservices ]
contexts:
- FeatureContext:
baseUri: http://localhost:8080
basePath: /1.0
# Dev
# baseUri: https://www.exampleurl.com
# basePath: /1.0
# QA
# baseUri: https://www.exampleurl.com
# basePath: /1.0
# Staging
# baseUri: https://www.exampleurl.com
# basePath: /1.0
# Debug
# debug: true
or
# behat.yml
default:
gherkin:
filters:
tags: "~@platform"
suites:
webservices:
paths: [ %paths.base%/webservices ]
contexts:
- FeatureContext:
# Local
# baseUri: http://localhost:8080
# basePath: /1.0
baseUri: https://www.exampleurl.com
basePath: /1.0
# QA
# baseUri: https://www.exampleurl.com
# basePath: /1.0
# Staging
# baseUri: https://www.exampleurl.com
# basePath: /1.0
# Debug
# debug: true
Note that it works with multiple lines of comments and a blank line separating, but not without the separating blank line. As well, it works if you remove the indentation from the comment like so:
# behat.yml
default:
gherkin:
filters:
tags: "~@platform"
suites:
webservices:
paths: [ %paths.base%/webservices ]
contexts:
- FeatureContext:
# Local
baseUri: http://localhost:8080
basePath: /1.0
# Dev
# baseUri: https://www.exampleurl.com
# basePath: /1.0
# QA
# baseUri: https://www.exampleurl.com
# basePath: /1.0
# Staging
# baseUri: https://www.exampleurl.com
# basePath: /1.0
# Debug
# debug: true
Hopefully this is enough information.