Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Html Testing Renderer & Code Coverage Improvement #5478

Merged
merged 5 commits into from
Dec 26, 2014
Merged

Html Testing Renderer & Code Coverage Improvement #5478

merged 5 commits into from
Dec 26, 2014

Conversation

tranfuga25s
Copy link
Contributor

This patch allows to the user of the HtmlRenderer for the testing interface to use the "All options enabled" which will set debug, show passes and codeverage in the same run.
Also fix the problem with the hide/display of code coverage when there is 2 files with the same name in different routes that are reached by the coverage and are showed by the interface. Before only the first one gets its codecoverage diplayed.

@@ -200,6 +200,7 @@ function coverage_toggle_all() {
* @return string
*/
public function coverageHeader($filename, $percent) {
$hash = md5($filename);
Copy link
Member

Choose a reason for hiding this comment

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

You used spaces instead of tabs for indentation.

@dereuromark
Copy link
Member

👍 I like the changes. Since it is for the test suite only this might be OK going into master. Usually new stuff would go into 2.7 here.

//EDIT: Sometimes I thought if toggling them would work, that would also be a neat way of combining them without an additional link needed.
Also, one cool trick most probably don't know: With the webtestrunner you can also filter by methods using &filter=testMethodName. So it makes the runner just as powerful and useful as the CLI on for most use cases. I wanted to make this also clickable (e.g. via dropdown select), but never had the time. Copy-and-pasting it to the URL is no big deal, though, either.

@tranfuga25s
Copy link
Contributor Author

Maybe with an PRG approach this could be possible... both options, filters and the options.
Will check if gets easy to make the change. Any other possible approach for that option?

@dereuromark
Copy link
Member

I wouldn't make it too complicated for now, given the fact that the webtestrunner will be gone in the next major version. To revive it there we will need to figure out how to pluginize it for 3.0.

@tranfuga25s
Copy link
Contributor Author

There is an idea how to enable the usage of filter with the tests, showing the link when the test fails.

Seems the more practical usage, because the specific test is failing and we want to reworkit and don't execute all the other ones generally.

}
$show = $this->_queryString($show);
$query = $this->_queryString($query);
return array( $show, $query );
Copy link
Member

Choose a reason for hiding this comment

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

cs: spaces too space

@markstory markstory added this to the 2.6.1 milestone Dec 24, 2014
@markstory
Copy link
Member

I am ok with this going into master. Like @dereuromark said the change is only for the test runner.

@dereuromark
Copy link
Member

Maybe squash the commits :) But looks good.

@markstory markstory self-assigned this Dec 26, 2014
@markstory
Copy link
Member

I can clean up any history if necessary before merging.

@tranfuga25s
Copy link
Contributor Author

That should be good, never done it before... Any tutorial how to do it?

@markstory
Copy link
Member

I use git rebase -i to squash commits. If you modify history, you'll need to force push your changes.

@AD7six
Copy link
Member

AD7six commented Dec 26, 2014

@tranfuga25s you might find this answer on SO useful.

Fix failing test

Fix CS problem with new code

Fix test for code coverage generator

Fix tests

Fix CS Errors

Removed spaces in tabulation
Changed scope of function and fix CS problem
…present

CS Fix

Update CakeHtmlReporter.php

Removed spaces in array return
@tranfuga25s
Copy link
Contributor Author

Think i got the idea... The 3 commits are the big changes... i've squashed the fix test and cs's problem commits... Thanks @AD7six and @markstory for the help....

@lorenzo
Copy link
Member

lorenzo commented Dec 26, 2014

Great job, thanks!

lorenzo added a commit that referenced this pull request Dec 26, 2014
Html Testing Renderer & Code Coverage Improvement
@lorenzo lorenzo merged commit 8a4b0e8 into cakephp:master Dec 26, 2014
@dereuromark
Copy link
Member

👏

@tranfuga25s tranfuga25s deleted the HtmlCodeCoverageFix branch December 26, 2014 23:27
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.

None yet

6 participants