vendethiel / Sprockets-PHP

Sprockets for PHP
MIT License
50 stars 4 forks source link

Coveralls integration + Codeception #44

Open david-sosa-valdes opened 8 years ago

david-sosa-valdes commented 8 years ago

So i recently acquire some experience using coveralls.io.

I think we could improve the tests using Codeception and make a code-coverage report to Coveralls, so the users can explore all the acceptance and unit tests that we realize and see the latest code-coverage statistics for this project.

Do you like the idea? (if you like the idea i can start working on a pull-request)

https://coveralls.io/features

vendethiel commented 8 years ago

For sure. The tests are currently very ad-hoc, and their only "good" point is that "it's better than no tests at all"...

david-sosa-valdes commented 8 years ago

Excellent!!

david-sosa-valdes commented 8 years ago

I have this fork using Codeception with the same tests you define and add some instructions to execute them in the README file,

The current report summary:

david-sosa-valdes commented 8 years ago

Now we need to improve this coverage report by adding more tests by each component.

david-sosa-valdes commented 8 years ago

I found some interesting points in Locator class:

Methods Tests
save none
skipFile File::skipDirective()
getPathsHash none
resolveFile none
hasDirectory none
getDirectoriesFor Filter\Less

This report concludes that 4 methods (save, getPathsHash, resolveFile and hasDirectory) are not used by any class and the 2 other methods need some tests using another classes.

The 4 methods mentioned doesn't have documentation, if we remove them we can improve the coveralls percentage by +2.53% (53.23%), do you think it's possible to delete these methods?

vendethiel commented 8 years ago

Mh, some of those are very useful at least. Need more tests.

david-sosa-valdes commented 8 years ago

I'm still unfamiliarzed with some aspects of this lib, i'll test all this methods.

vendethiel commented 8 years ago
david-sosa-valdes commented 8 years ago

I have managed to achieve 60.88% in coveralls implementing cache tests.

davidsosavaldes/Sprockets-PHP@052b180

vendethiel commented 8 years ago

Nice. The only thing I'm afraid is that including bootstrap in the tests will make finding the issue much harder, whenever something changes.

david-sosa-valdes commented 8 years ago

I was trying to use some filters but we can try something else, the bootstrap tests are deleted on commit: davidsosavaldes/Sprockets-PHP@b040cd5.