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

testing/php7-pdlib: new aport #12174

Closed
wants to merge 1 commit into from
Closed

testing/php7-pdlib: new aport #12174

wants to merge 1 commit into from

Conversation

agboom
Copy link
Contributor

@agboom agboom commented Nov 28, 2019

No description provided.

@project-bot project-bot bot added this to To Do in Triage Nov 28, 2019
@probot-autolabeler probot-autolabeler bot added the R-testing Testing repository label Nov 28, 2019
@agboom
Copy link
Contributor Author

agboom commented Nov 28, 2019

Hmm, somehow the tests are skipped in my local abuild -r run. Not sure what caused that, but in CI they're not skipped.

Logs of my local (skipped) tests:

PHP_SAPI    : cli
PHP_VERSION : 7.3.11
ZEND_VERSION: 3.3.11
PHP_OS      : Linux - Linux db0caadbe11c 5.3.11-arch1-1 #1 SMP PREEMPT Tue, 12 Nov 2019 22:19:48 +0000 x86_64
INI actual  : /home/builder/aports/testing/php7-pdlib/src/pdlib-1.0/tmp-php.ini
More .INIs  :
CWD         : /home/builder/aports/testing/php7-pdlib/src/pdlib-1.0
Extra dirs  :
VALGRIND    : Not used
=====================================================================
TIME START 2019-11-28 13:49:37
=====================================================================
SKIP Check for pdlib presence [tests/001.phpt]
SKIP Basic tests for chinese_whispers [tests/chinese_whispers_basic.phpt]
SKIP Edge given in edges array for chinese_whispers functions is associative array [tests/chinese_whispers_edge_associative_array_error.phpt]
SKIP Edge elements given in edges array for chinese_whispers functions are not of long type [tests/chinese_whispers_edge_elements_not_long.phpt]
SKIP Edge given in edges array for chinese_whispers functions is not having all values to be arrays with 2 elements [tests/chinese_whispers_edge_not_2_element_error.phpt]
SKIP Edge given in edges array is not array for chinese_whispers functions [tests/chinese_whispers_edge_not_array_error.phpt]
SKIP Args given to chinese_whispers functions is not correct [tests/chinese_whispers_wrong_arg_type_error.phpt]
SKIP Testing CnnFaceDetection constructor without arguments [tests/cnn_face_detection_ctor_error.phpt]
SKIP Testing CnnFaceDetection constructor with model that do not exist [tests/cnn_face_detection_ctor_model_not_found_error.phpt]
SKIP Testing FaceLandmarkDetection constructor without arguments [tests/face_landmark_detection_ctor_error.phpt]
SKIP Testing FaceRecognition constructor without arguments [tests/face_recognition_ctor_error.phpt]
SKIP Full test for face recognition - download models, detect faces, landmark detection and face recognition. [tests/integration_face_recognition.phpt]
=====================================================================
TIME END 2019-11-28 13:49:37

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

Number of tests :   12                 0
Tests skipped   :   12 (100.0%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :    0 (  0.0%) (  0.0%)
Expected fail   :    0 (  0.0%) (  0.0%)
Tests passed    :    0 (  0.0%) (  0.0%)
---------------------------------------------------------------------
Time taken      :    0 seconds
=====================================================================

@agboom
Copy link
Contributor Author

agboom commented Nov 28, 2019

I think it has something to do with loading the shared library, as these logs on my machine point out:

PHP Warning:  PHP Startup: Unable to load dynamic library 'pdlib.so' (tried: /home/builder/aports/testing/php7-pdlib/src/pdlib-1.0/modules/pdlib.so (Error relocating /usr/lib/libdlib.so.19.18.0: _ZNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEEC1Ev: symbol not found), /home/builder/aports/testing/php7-pdlib/src/pdlib-1.0/modules/pdlib.so.so (Error loading shared library /home/builder/aports/testing/php7-pdlib/src/pdlib-1.0/modules/pdlib.so.so: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'pdlib.so' (tried: /home/builder/aports/testing/php7-pdlib/src/pdlib-1.0/modules/pdlib.so (Error relocating /usr/lib/libdlib.so.19.18.0: _ZNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEEC1Ev: symbol not found), /home/builder/aports/testing/php7-pdlib/src/pdlib-1.0/modules/pdlib.so.so (Error loading shared library /home/builder/aports/testing/php7-pdlib/src/pdlib-1.0/modules/pdlib.so.so: No such file or directory)) in Unknown on line 0

=====================================================================
PHP         : /usr/bin/php7
Warning: PHP Startup: Unable to load dynamic library 'pdlib.so' (tried: /home/builder/aports/testing/php7-pdlib/src/pdlib-1.0/modules/pdlib.so (Error relocating /usr/lib/libdlib.so.19.18.0: _ZNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEEC1Ev: symbol not found), /home/builder/aports/testing/php7-pdlib/src/pdlib-1.0/modules/pdlib.so.so (Error loading shared library /home/builder/aports/testing/php7-pdlib/src/pdlib-1.0/modules/pdlib.so.so: No such file or directory)) in Unknown on line 0

This is not logged in the CI build.

How would I go around debugging this?

@andypost
Copy link
Contributor

yep, mostly all tests are broken because of expectation of specific directory like

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

and only this one fails for some reason

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

---- EXPECTED OUTPUT
Processing detection model
Processing prediction model
Processing recognition model
Detection
Faces found = 1
Face[0] in bounding box (left=187, top=186, right=357, bottom=355)
Since we used model with 5 shape predictions, we found 5 landmark parts
Descriptor is vector of 128 dimensions
---- ACTUAL OUTPUT
Processing detection model

Fatal error: Uncaught Error: Call to undefined function bzopen() in /mnt/testing/php7-pdlib/src/pdlib-1.0/tests/integration_face_recognition.php:22
Stack trace:
#0 {main}
  thrown in /mnt/testing/php7-pdlib/src/pdlib-1.0/tests/integration_face_recognition.php on line 22
---- FAILED

@andypost andypost changed the title testing/php7-pdlib: testing/php7-pdlib: new aport Nov 28, 2019
@andypost andypost added A-new Adds a new aport package C-php labels Nov 28, 2019
@agboom
Copy link
Contributor Author

agboom commented Nov 28, 2019

I think it has something to do with loading the shared library...

The test looks for a file called pdlib.so.so, I'm trying to find out where this comes from.

@andypost
Copy link
Contributor

The workaround is to comment out broken tests

diff --git a/testing/php7-pdlib/APKBUILD b/testing/php7-pdlib/APKBUILD
index 28d29419ea..ce3d42d868 100644
--- a/testing/php7-pdlib/APKBUILD
+++ b/testing/php7-pdlib/APKBUILD
@@ -9,24 +9,30 @@ url="https://github.com/goodspb/pdlib"
 arch="all"
 license="MIT"
 depends="php7-common dlib"
-makedepends="php7-dev pkgconf"
+makedepends="php7-dev pkgconf php7-bz2"
 source="$pkgname-$pkgver.tar.gz::https://github.com/goodspb/$_pkgreal/archive/v$pkgver.tar.gz"
 builddir="$srcdir/$_pkgreal-$pkgver"
 
 build() {
-       cd "$builddir"
        phpize7
        ./configure --prefix=/usr --with-php-config=php-config7
        make
 }
 
 check() {
-       cd "$builddir"
+       # Remove broken tests https://github.com/goodspb/pdlib/issues/14
+       rm \
+               tests/chinese_whispers_wrong_arg_type_error.phpt \
+               tests/cnn_face_detection_ctor_error.phpt \
+               tests/face_landmark_detection_ctor_error.phpt \
+               tests/face_recognition_ctor_error.phpt \
+               tests/integration_face_recognition.phpt   # Downloads huge images
+       # Tests require bz2 extension which is not bundled
+       sed -i 's#PHP_TEST_SHARED_EXTENSIONS =  `#PHP_TEST_SHARED_EXTENSIONS = -d extension=/usr/lib/php7/modules/bz2.so `#' Makefile
        make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test
 }
 
 package() {
-       cd "$builddir"
        make INSTALL_ROOT="$pkgdir" install
        install -d "$pkgdir"/etc/php7/conf.d
        echo "extension=$_pkgreal.so" > "$pkgdir"/etc/php7/conf.d/$_pkgreal.ini

@andypost
Copy link
Contributor

not sure about last one, it fails to download for me(

@probot-autolabeler probot-autolabeler bot added R-community Community repository R-main Main repository labels Nov 28, 2019
@agboom
Copy link
Contributor Author

agboom commented Nov 28, 2019

Thanks for your help @andypost! I've applied your diff and committed again

@agboom
Copy link
Contributor Author

agboom commented Nov 28, 2019

I'll keep an eye out on goodspb/pdlib#14 and enable the tests when they work again.

@algitbot
Copy link

Merged in 2b68695 by @andypost. Thanks for your contribution!

(This pull request has been closed automatically by GitHub PR Closer. If you think that it’s not resolved yet, please add a comment.)

@algitbot algitbot closed this Nov 30, 2019
Triage automation moved this from To Do to Done Nov 30, 2019
@andypost
Copy link
Contributor

@andypost
Copy link
Contributor

Disabled with 9c60d06

@repo-lockdown
Copy link

repo-lockdown bot commented Jan 3, 2020

This repository does not accept Pull Requests (PR) anymore. Development has moved to https://gitlab.alpinelinux.org/alpine/aports Please signup and create a Merge Request (MR) instead. Sorry for the inconvenience caused.

@repo-lockdown repo-lockdown bot locked and limited conversation to collaborators Jan 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-new Adds a new aport package C-php R-testing Testing repository
Projects
3 participants