Bug #81389 Unify method for running unit tests
Submitted: 12 May 2016 7:41 Modified: 8 Jul 2016 17:11
Reporter: Anitha Gopi Email Updates:
Status: Closed Impact on me:
None 
Category:Tests: Server Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any

[12 May 2016 7:41] Anitha Gopi
Description:
As per the documentation there are 2 methods to run unit tests (https://dev.mysql.com/doc/mysqltest/2.0/en/unit-tests-google-test.html), make test-unit and ctest. These 2 methods seem to be running different set of tests 

1. ctest - 

100% tests passed, 0 tests failed out of 65

Total Test time (real) =  25.23 sec

2. make test-unit 
Test Summary Report
-------------------
storage/perfschema/unittest/pfs-t                          (Wstat: 0 Tests: 328 Failed: 96)
  Failed tests:  233-328
  Parse errors: Bad plan.  You planned 232 tests but ran 328.
storage/perfschema/unittest/pfs_host-oom-t                 (Wstat: 0 Tests: 7 Failed: 1)
  Failed test:  7
  Parse errors: Bad plan.  You planned 6 tests but ran 7.
storage/perfschema/unittest/pfs_user-oom-t                 (Wstat: 0 Tests: 7 Failed: 1)
  Failed test:  7
  Parse errors: Bad plan.  You planned 6 tests but ran 7.
Files=23, Tests=2557, 23 wallclock secs ( 0.33 usr  0.02 sys + 40.93 cusr  2.44 csys = 43.72 CPU)
Result: FAIL

As you can seen from the summary above number of tests run with each of these methods is different. make test-unit seems to run more tests and could be a superset of ctest. 

How to repeat:
Run commands ctest and make test-unit

Suggested fix:
Two methods for running unit tests is confusing. Deprecate one of the methods and fix the one that is retained to run all tests.
[8 Jul 2016 17:11] Paul DuBois
Posted by developer:
 
Noted in 5.6.32, 5.7.14 changelogs.

For unit-testing with the MySQL test suite, the make unit-test
command is no longer available. The ctest program should be used
instead.