goodspb / pdlib

PHP extension for Dlib.
MIT License
72 stars 19 forks source link

Ubuntu 16.04 - "make test" 5 failures #14

Closed james-cook closed 4 years ago

james-cook commented 5 years ago

Following the README and https://github.com/goodspb/pdlib/issues/12 (installed libx11-dev) the makes of dlib and pdlb seem to have worked ok. But I'm getting 5 failures in "make test"

=====================================================================
PHP         : /usr/bin/php7.0
PHP_SAPI    : cli
PHP_VERSION : 7.0.33-0ubuntu0.16.04.4
ZEND_VERSION: 3.0.0
PHP_OS      : Linux - Linux Ubuntu-1604-xenial-64-minimal 4.15.0-50-generic #54~16.04.1-Ubuntu SMP Wed May 8 15:55:19 UTC 2019 x86_64
INI actual  : /root/makestuff/pdlib/tmp-php.ini
More .INIs  :
CWD         : /root/makestuff/pdlib
Extra dirs  :
VALGRIND    : Not used
=====================================================================
.
.
.
.

FAILED TEST SUMMARY
---------------------------------------------------------------------
Args given to chinese_whispers functions is not correct [tests/chinese_whispers_wrong_arg_type_error.phpt]
Testing CnnFaceDetection constructor without arguments [tests/cnn_face_detection_ctor_error.phpt]
Testing FaceLandmarkDetection constructor without arguments [tests/face_landmark_detection_ctor_error.phpt]
Testing FaceRecognition constructor without arguments [tests/face_recognition_ctor_error.phpt]
Full test for face recognition - download models, detect faces, landmark detection and face recognition. [tests/integration_face_recognition.phpt]

I have added: [pdlib] extension="pdlib.so"

to:

/etc/php/7.0/cli/php.ini

and logged out / in via ssh... but still get these 5 errors...

I updated to php7.2 but get the same errors:

=====================================================================
PHP         : /usr/bin/php7.2
PHP_SAPI    : cli
PHP_VERSION : 7.2.19-1+ubuntu16.04.1+deb.sury.org+1
ZEND_VERSION: 3.2.0
PHP_OS      : Linux - Linux Ubuntu-1604-xenial-64-minimal 4.15.0-50-generic #54~16.04.1-Ubuntu SMP Wed May 8 15:55:19 UTC 2019 x86_64
INI actual  : /root/makestuff/pdlib/tmp-php.ini
More .INIs  :
CWD         : /root/makestuff/pdlib
Extra dirs  :
VALGRIND    : Not used
=====================================================================
.
.
.
.
FAILED TEST SUMMARY
---------------------------------------------------------------------
Args given to chinese_whispers functions is not correct [tests/chinese_whispers_wrong_arg_type_error.phpt]
Testing CnnFaceDetection constructor without arguments [tests/cnn_face_detection_ctor_error.phpt]
Testing FaceLandmarkDetection constructor without arguments [tests/face_landmark_detection_ctor_error.phpt]
Testing FaceRecognition constructor without arguments [tests/face_recognition_ctor_error.phpt]
Full test for face recognition - download models, detect faces, landmark detection and face recognition. [tests/integration_face_recognition.phpt]
agboom commented 5 years ago

I have the exact same errors while building the pdlib package for Alpine. Did you find out what caused it?

For the Alpine PR, see https://github.com/alpinelinux/aports/pull/12174 For the build log, see: https://cloud.drone.io/alpinelinux/aports/13452

andypost commented 5 years ago

installing bz2 extension and fixing test helps to pass it

--- a/tests/integration_face_recognition.phpt   2019-11-28 19:45:52.780512780 +0200
+++ b/tests/integration_face_recognition.phpt   2019-11-28 19:46:05.248704843 +0200
@@ -1,7 +1,7 @@
 --TEST--
 Full test for face recognition - download models, detect faces, landmark detection and face recognition.
 --SKIPIF--
-<?php if (!extension_loaded("pdlib") || (function_exists("bzopen"))) print "skip"; ?>
+<?php if (!extension_loaded("pdlib") || !function_exists("bzopen")) print "skip"; ?>
 --FILE--
 <?php
 $models = array(
andypost commented 5 years ago

the issue with other tests is that they expect to be run in "specific" directory /home/branko/pdlib

aports/testing/php7-pdlib/src/pdlib-1.0/tests$ cat face_recognition_ctor_error.log 

---- EXPECTED OUTPUT
Warning: FaceRecognition::__construct() expects exactly 1 parameter, 0 given in /home/branko/pdlib/tests/face_recognition_ctor_error.php on line 3
string(43) "Unable to parse face_recognition_model_path"
---- ACTUAL OUTPUT
Warning: FaceRecognition::__construct() expects exactly 1 parameter, 0 given in /mnt/testing/php7-pdlib/src/pdlib-1.0/tests/face_recognition_ctor_error.php on line 3
string(43) "Unable to parse face_recognition_model_path"
---- FAILED
stalker314314 commented 5 years ago

Hi, I guess that "branko" would be me:) I created a fix for this in PR: https://github.com/goodspb/pdlib/pull/18. Not sure is @goodspb still available to merge it. Hopefully, it will be soon. If you can test this change directly from https://github.com/stalker314314/pdlib/tree/fixing-tests-on-different-environments, please do!

andypost commented 5 years ago

@stalker314314 thank you, meantime the remaining test needs some love because it's pulling images runtime... Probably kind of SKIP_ONLINE or kinda could help here The the fix for bz2 extension still needed

stalker314314 commented 5 years ago

Sorry, was on a trip, will add fixes for these two in next week-two!