websupport-sk / pecl-memcache

PHP Extension - Memcache module with support of newer PHP 7.x and PHP 8.x
https://pecl.php.net/package/memcache
Other
328 stars 101 forks source link

3.0.8 tests fail because connect.inc is missing #94

Open ryandesign opened 2 years ago

ryandesign commented 2 years ago

Running make test after building memcache 3.0.8 (for php 5.6), most tests fail:

=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :    0
Exts tested     :   29
---------------------------------------------------------------------

Number of tests :   71                49
Tests skipped   :   22 ( 31.0%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :   49 ( 69.0%) (100.0%)
Expected fail   :    0 (  0.0%) (  0.0%)
Tests passed    :    0 (  0.0%) (  0.0%)
---------------------------------------------------------------------
Time taken      :    8 seconds
=====================================================================

The log for the first failed test, 001.log, shows why:


---- EXPECTED OUTPUT
int(123)
int(123)

Warning: %s parameter%s

Warning: %s parameter%s
Done
---- ACTUAL OUTPUT
Warning: include(connect.inc): failed to open stream: No such file or directory in /path/to/memcache-3.0.8/tests/001.php on line 3

Warning: include(): Failed opening 'connect.inc' for inclusion (include_path='.:') in /path/to/memcache-3.0.8/tests/001.php on line 3

Notice: Undefined variable: memcache in /path/to/memcache-3.0.8/tests/001.php on line 8

Warning: memcache_set() expects parameter 1 to be MemcachePool, null given in /path/to/memcache-3.0.8/tests/001.php on line 8

Notice: Undefined variable: memcache in /path/to/memcache-3.0.8/tests/001.php on line 12

Warning: memcache_set() expects parameter 1 to be MemcachePool, null given in /path/to/memcache-3.0.8/tests/001.php on line 12
int(123)
int(123)

Notice: Undefined variable: memcache in /path/to/memcache-3.0.8/tests/001.php on line 17

Warning: memcache_set() expects parameter 1 to be MemcachePool, null given in /path/to/memcache-3.0.8/tests/001.php on line 17

Notice: Undefined variable: memcache in /path/to/memcache-3.0.8/tests/001.php on line 18

Fatal error: Call to a member function set() on null in /path/to/memcache-3.0.8/tests/001.php on line 18
---- FAILED

The connect.inc file that the tests require has not been included in the 3.0.8 archive on PECL, nor in fact has it been included in the 3.0.8 tag in this repository, a peculiarly-created tag that shares no history with the rest of the repository.

If I place the 3.0.8 version of connect.inc into the tests directory, then only one test fails:


---- EXPECTED OUTPUT
int(1)
---- ACTUAL OUTPUT
Notice: memcache_connect(): Server localhost (tcp 11211, udp 0) failed with: Connection refused (61) in /path/to/memcache-3.0.8/tests/connect.inc on line 69

Warning: memcache_connect(): Can't connect to localhost:11211, Connection refused (61) in /path/to/memcache-3.0.8/tests/connect.inc on line 69
skip Connection to memcached failed
---- FAILED

Perhaps connect.inc can be included in 3.0.9.