Skip to content

Comments

Multiple example tables and tags support #117#119

Closed
stukalin wants to merge 3 commits intoBehat:masterfrom
stukalin:feature/issue-117
Closed

Multiple example tables and tags support #117#119
stukalin wants to merge 3 commits intoBehat:masterfrom
stukalin:feature/issue-117

Conversation

@stukalin
Copy link
Contributor

@stukalin stukalin commented Dec 9, 2016

See issue #117 for additional information. I tried to test it properly and not break anything:)

@stukalin stukalin force-pushed the feature/issue-117 branch 2 times, most recently from cb0290d to 256c973 Compare December 11, 2016 10:29
.gitignore Outdated
vendor
composer.phar
composer.lock
.idea/*
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in a global gitignore, not project specific (otherwise we would need eclipse, netbeans, and whatever other ides / editors, which is quite long and not useful)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rolled back

Copy link
Member

@stof stof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will stop my review here until you revert the method reordering. It is just impossible to find out what really changed.

.gitignore Outdated
vendor
composer.phar
composer.lock
.idea/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*
* @return Boolean
*/
public function isScenarioMatch(ScenarioInterface $scenario)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't move method around. It makes the review harder (I know need to check manually if the moved code is the same) and breaks git blame without any benefit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rolled back

*
* @return Boolean
*/
public function isScenarioMatch(ScenarioInterface $scenario)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rolled back

@stukalin
Copy link
Contributor Author

Just a few words on what was changed. So the idea was to allow having more than 1 examples table in an outline and those examples tables can be tagged. The main changes hence were:

  • array of ExampleNodeTable in the OutlineNode class
  • parsing of tags on Examples table in the Parser class
  • new behavior in the TagFilter class

@stukalin
Copy link
Contributor Author

@stof Could you possibly proceed with the code review? That'd be just perfect:)

@stof
Copy link
Member

stof commented Dec 23, 2016

I won't have the time today, so it will have to wait until after the Christmas weekend (I won't do open-source code review on Christmas Eve)

@everzet
Copy link
Member

everzet commented Jan 9, 2017

There are a lot of comments and nesting in this code that I'd rather be private methods of the class.

@stukalin
Copy link
Contributor Author

@everzet I refactored a bit there...

@stukalin
Copy link
Contributor Author

Wow, it takes looong, @stof @everzet ;)

Copy link
Member

@everzet everzet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job overall!!!

Sadly I can't merge it yet due to some minor and one major gripe. The most critical thing here is a BC break in OutlineNode. I'd rather avoid it.

array $tags,
array $steps,
ExampleTableNode $table,
array $tables,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a backwards compatibility break. Unless you are willing to wait till next Gherkin major, which might never happen on this codebase, you'd better approach this differently.

array('action', 'outcome'),
array('act#3', 'out#3'),
), $exampleTableNodes[0]->getRows());
$this->assertEquals(array('etag2'), $exampleTableNodes[0]->getTags());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test would benefit from breaking down.

/** @noinspection PhpUndefinedMethodInspection */
$this->assertEquals(array($exampleTableNode2), $scenarioInterfaces[0]->getExampleTables());
/** @noinspection PhpUndefinedMethodInspection */
$this->assertEquals(array($exampleTableNode3), $scenarioInterfaces[1]->getExampleTables());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

$this->assertFalse($tagFilter->isScenarioMatch($feature, $scenario));

$tagFilter = new TagFilter('@etag1&&@etag3');
$this->assertFalse($tagFilter->isScenarioMatch($feature, $scenario), "Tags from different examples tables");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

- { keyword_type: 'Given', type: '前提', text: '50 を入力', line: 8 }
- { keyword_type: 'Given', type: 'かつ', text: '70 を入力', line: 9 }
- { keyword_type: 'When', type: 'もし', text: 'add ボタンを押した', line: 10 }
- { keyword_type: 'Then', type: 'ならば', text: '結果は 120 を表示', line: 11 }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather not touch existing etalons and add a new one instead.

@examples_tag3 @examples_tag4
Examples:
| state |
| missing |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, I'd rather us not touching existing tests. You're adding new feature, so the old behaviour and tests proving it must stay unchanged.

@everzet
Copy link
Member

everzet commented Jun 30, 2017

@stukalin Wow, it takes looong, @stof @everzet ;)

I wish people's enthusiasm towards their contributions had direct impact on maintainers life and well-being. Until that happens I'm afraid maintainers will need to take care of their personal and professional lives themselves, deprioritising everything else ;)

@everzet
Copy link
Member

everzet commented Aug 30, 2017

Great job overall, but I'm closing this as some important changes I suggested weren't addressed. If anyone shows interest in taking over this PR and continuing - feel free to open new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants