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

Fix various issues with running test suite on "non-standard" platforms #2965

Merged
merged 4 commits into from
Sep 16, 2024

Conversation

lunkwill42
Copy link
Member

@lunkwill42 lunkwill42 commented Sep 12, 2024

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.

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.
Copy link

github-actions bot commented Sep 12, 2024

Test results

    9 files      9 suites   8m 12s ⏱️
3 328 tests 3 327 ✅ 0 💤 0 ❌ 1 🔥
6 395 runs  6 394 ✅ 0 💤 0 ❌ 1 🔥

For more details on these errors, see this check.

Results for commit 796a6a1.

♻️ This comment has been updated with latest results.

Copy link

codecov bot commented Sep 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.37%. Comparing base (bc56ce4) to head (796a6a1).
Report is 583 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

Base automatically changed from test/move-snmpsim-requirement to master September 12, 2024 16:42
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.
@lunkwill42 lunkwill42 changed the title Fix strange issues running test suite on MacOS Fix various issues with running test suite on "non-standard" platforms Sep 12, 2024
@lunkwill42 lunkwill42 marked this pull request as ready for review September 12, 2024 16:50
@lunkwill42 lunkwill42 requested review from johannaengland and a team September 12, 2024 16:50
@lunkwill42 lunkwill42 self-assigned this Sep 12, 2024
@lunkwill42 lunkwill42 merged commit b7325f7 into master Sep 16, 2024
19 of 20 checks passed
@lunkwill42 lunkwill42 deleted the test/fix-macos-test-issues branch September 16, 2024 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants