-
Notifications
You must be signed in to change notification settings - Fork 39
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
Fix various issues with running test suite on "non-standard" platforms #2965
Conversation
MacOS' System Integrity Protection wreaks havoc with NAV and its test suite, due to its dependency on pynetsnmp / NET-SNMP: pynetsnmp will load libcrypto using ctypes, which aborts the python process on MacOS with an error message like this: > WARNING: .tox/integration-py39-django32/bin/python is loading libcrypto > in an unsafe way When OpenSSL is installed on MacOS through homebrew, the environment variable DYLD_LIBRARY_PATH must be set for processes to load the correct version of libcrypto. However, newer versions of MacOS sanitizes this environment variable on many levels. The whole debaucle of trying to fix this in a sane way is described at https://hynek.me/articles/macos-dyld-env/ This workaround is no prettier, and will only work if libssl is installed using Homebrew, or if the value of DYLD_LIBRARY_PATH can be gleaned from LD_LIBRARY_PATH.
The epollreactor2 implementation is no good on other platforms. Without this, the test suite would not run on MacOS, e.g.
Test results 9 files 9 suites 8m 12s ⏱️ For more details on these errors, see this check. Results for commit 796a6a1. ♻️ This comment has been updated with latest results. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2965 +/- ##
=======================================
Coverage 56.36% 56.37%
=======================================
Files 602 602
Lines 43818 43822 +4
Branches 48 48
=======================================
+ Hits 24700 24703 +3
- Misses 19106 19107 +1
Partials 12 12 ☔ View full report in Codecov by Sentry. |
At least two or three of NAVs dependencies may need to be built from source when pulled in by pip: psycopg2, python-ldap and Pillow. On platforms like NixOS, the include files for the necessary C libraries may not be in standardized FHS locations, so the C_INCLUDE_PATH is used to convey their locations to the C compiler.
This extracts MacOS and NixOS-related commits from #2675 . They should not affect the test suite on Debian-derived or FHS-compatible Linux OS-es, but will aid in making it run properly on MacOS or NixOS.