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

More tests + test coverage #1307

Merged
merged 9 commits into from Sep 29, 2013
Merged

More tests + test coverage #1307

merged 9 commits into from Sep 29, 2013

Conversation

ghost
Copy link

@ghost ghost commented Sep 28, 2013

In this PR:

  • added more regression tests (they were taken from php-tests directory — is it used anywhere?)
  • added support for test coverage
  • modified build file generator.

The most interesting part is "test coverage".

Now Phalcon can be build with --enable-coverage key, ie

phpize
./configure --enable-coverage
make

This requires lcov and genhtml programs (apt-get install lcov in Debian and Ubuntu).

To get the test coverage, run

make coverage

This will run regression tests, unit tests and then produce test coverage information in coverage/ directory (open coverage/index.html in the browser to view the details).

This is what the report looks like: https://www.diigo.com/item/image/3zdqq/hjpw

This can be useful if someone wants to write more tests as it shows completely grey areas not covered by any tests.

@phalcon
Copy link
Collaborator

phalcon commented Sep 29, 2013

It seems that we now have 3 unit-test suite-cases

Can we do something ASAP to unify them?

@niden @carvajaldiazeduar @xboston

@ghost
Copy link
Author

ghost commented Sep 29, 2013

Tests in ext/tests are for package maintainers so that they can use make test to make sure that the compiled extension is operational (those tests do not use database or external services etc — no external dependencies); these tests can check things that PHPUnit cannot (ie, make sure there is no crash or that fatal errors are generated as expected — all these things are possible only with process isolation); all the others tests go to unit-tests/.

I see there is php-tests directory but it does not seem to be used.

@niden
Copy link
Member

niden commented Sep 29, 2013

The php-tests is the new test suite.

@ghost
Copy link
Author

ghost commented Sep 29, 2013

So should I put all new tests there? Otherwise we will end up doing duplicate job if we need to migrate the existing test cases into php-tests.

@niden
Copy link
Member

niden commented Sep 29, 2013

Sure thing! I was migrating some of them over but then things got crazy at work .... you know the drill :)

@ghost
Copy link
Author

ghost commented Sep 29, 2013

Looks a bit sad:

.................FF....................F.......................  63 / 459 ( 13%)
............................................................... 126 / 459 ( 27%)
..................................................F..EEEE...... 189 / 459 ( 41%)
...................................EEEF........................ 252 / 459 ( 54%)
......FFFFFFFFFFFFFFFFFFFFF........FFFFFFFFFFFFFFFFFFFFFFFFFFFF 315 / 459 ( 68%)
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 378 / 459 ( 82%)
FFFFF.........................FSegmentation fault

phalcon pushed a commit that referenced this pull request Sep 29, 2013
More tests + test coverage
@phalcon phalcon merged commit d89c1de into phalcon:1.3.0 Sep 29, 2013
@ghost
Copy link
Author

ghost commented Sep 29, 2013

I think I need to revert d89c1de — PHPUnit uses wrong php-cgi binary to run the test and this is why the build fails.

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.

3 participants