-
-
Notifications
You must be signed in to change notification settings - Fork 72
Description
Using this client with Manticore Search src/Schema.php fails on line 242 because in Manticore the first field name in the response to SHOW TABLES changed from 'Index' to 'Table'. This is fixed by changing that line to
$indexName = $index['Table'] ?? $index['Index'];
After making that change I ran the unit tests:
- 3.5.1 works without any errors
- 2.2.11 i can't run because my system cannot install the old libmysqlclient20 and I can't be bothered setting up a container with an old debian.
- Manticore 10.1.0 I made a conf file for running the unit tests, which I can contribute if you like (relative to the 3.5.1 config it's just a matter of changing the datadir back to the old path specs).
With Manticore 10.10.1
PHPUnit 6.5.14 by Sebastian Bergmann and contributors.
...FSS.....F.......SS.......................................... 63 / 164 ( 38%)
............................................................... 126 / 164 ( 76%)
...................................... 164 / 164 (100%)
Time: 236 ms, Memory: 12.00MB
There were 2 failures:
1) yiiunit\extensions\sphinx\ActiveDataProviderTest::testTotalCountFromMeta
Failed asserting that 1 matches expected 1002.
/home/fsb/yii2-sphinx/tests/ActiveDataProviderTest.php:107
phpvfscomposer:///home/fsb/yii2-sphinx/vendor/phpunit/phpunit/phpunit:52
/home/fsb/yii2-sphinx/vendor/bin/phpunit:118
2) yiiunit\extensions\sphinx\ActiveRecordTest::testFind
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
Array (
'id' => '2'
'author_id' => '2'
'tag' => '3,4'
+ 'title' => 'About dogs'
+ 'content' => 'This article is about dogs. Repeated.'
+ 'create_date' => '2013-11-15 00:00:00'
/home/fsb/yii2-sphinx/tests/ActiveRecordTest.php:89
phpvfscomposer:///home/fsb/yii2-sphinx/vendor/phpunit/phpunit/phpunit:52
/home/fsb/yii2-sphinx/vendor/bin/phpunit:118
FAILURES!
Tests: 164, Assertions: 878, Failures: 2, Skipped: 4.
I spent some time on failure 1) and could not understand it. As far as I can see the data provider doesn't get the total rows result because the meta
response from searchd is empty. The searchd query log shows it is not receiving the SHOW META sql. I tried to understand how come but failed. It has something to do with SQL generation and I found it confusing.
Failure 2) is easy. The result simply has more information than expected and I don't think users would have a problem with that. In other words, this is a failure of the test code. (btw, looks like line 88 of tests/ActiveRecordTest.php is a hack for related purpose.)
Does anyone care?
I considered making a PR but 1) i'm out of practice contributing and made a big mess 2) all i've got is what I wrote above and my manticore-10.1.0.conf file, 3) i don't know how to make the tests run automatically in whatever this travis thing is, i just ran them in my dev repo, 4) i can't do run 2.2.11 tests. 5) who cares? Manticore switched Index -> Table many years ago and it completely broke this client lib. either nobody uses this lib with Manticore or they patched it themselves.
So, what do you want to do?
If we want to fix it and get automatic unit tests running it's probably better for someone who knows that art to do it and I can advise/contribute what I know, most of which is above.