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

Please document how to run Python tests #2395

Open
yurivict opened this issue Aug 27, 2024 · 5 comments · May be fixed by #2416
Open

Please document how to run Python tests #2395

yurivict opened this issue Aug 27, 2024 · 5 comments · May be fixed by #2416
Labels
AEP Arbor Enhancement Proposal enhancement

Comments

@yurivict
Copy link

yurivict commented Aug 27, 2024

The Build/install page should explain how to run Python exension tests.

Running pytest in any of the directories test/, test/unit_distributed/ fails like this:

===>   py311-arbor-0.10.1 depends on file: /usr/local/bin/python3.11 - found
cd /usr/ports/science/py-arbor/work-py311/arbor-0.10.1/python/test/unit_distributed && /usr/bin/env -i HOME=/usr/ports/science/py-arbor/work-py311  PWD="${PWD}"  __MAKE_CONF=/nonexistent OSVERSION=1401500 PATH=/usr/local/libexec/ccache:/usr/ports/science/py-arbor/work-py311/.bin:/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin TERM=xterm-256color NINJA_STATUS="[%p %s/%t] " XDG_DATA_HOME=/usr/ports/science/py-arbor/work-py311  XDG_CONFIG_HOME=/usr/ports/science/py-arbor/work-py311  XDG_CACHE_HOME=/usr/ports/science/py-arbor/work-py311/.cache  HOME=/usr/ports/science/py-arbor/work-py311 PATH=/usr/local/libexec/ccache:/usr/ports/science/py-arbor/work-py311/.bin:/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin PKG_CONFIG_LIBDIR=/usr/ports/science/py-arbor/work-py311/.pkgconfig:/usr/local/libdata/pkgconfig:/usr/local/share/pkgconfig:/usr/libdata/pkgconfig MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES DESTDIR=/usr/ports/science/py-arbor/work-py311/stage PREFIX=/usr/local  LOCALBASE=/usr/local  CC="cc" CFLAGS="-O2 -pipe  -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing "  CPP="cpp" CPPFLAGS="-isystem /usr/local/include"  LDFLAGS=" -fstack-protector-strong -L/usr/local/lib " LIBS=""  CXX="c++" CXXFLAGS="-O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -fPIC -isystem /usr/local/include " CCACHE_DIR="/tmp/.ccache" BSD_INSTALL_PROGRAM="install  -s -m 555"  BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m 555"  BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444" PYTHONPATH=/usr/ports/science/py-arbor/work-py311/stage/usr/local/lib/python3.11/site-packages /usr/local/bin/python3.11 -m pytest -k '' -rs -v -o addopts= -v
==================================================================================== test session starts ====================================================================================
platform freebsd14 -- Python 3.11.9, pytest-8.1.1, pluggy-1.5.0 -- /usr/local/bin/python3.11
cachedir: .pytest_cache
benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase(PosixPath('/usr/ports/science/py-arbor/work-py311/arbor-0.10.1/python/test/unit_distributed/.hypothesis/examples'))
Using --randomly-seed=2274967451
PyQt5 5.15.10 -- Qt runtime 5.15.14 -- Qt compiled 5.15.14
rootdir: /usr/ports/science/py-arbor/work-py311/arbor-0.10.1
configfile: pyproject.toml
plugins: mypy-plugins-3.1.2, timeout-2.1.0, time-machine-2.11.0, datadir-1.5.0, rerunfailures-11.1.2, flaky-3.8.1, benchmark-4.0.0, cov-5.0.0, hypothesis-6.98.18, mock-3.10.0, forked-1.6.0, randomly-3.12.0, asyncio-0.23.8, xdist-3.6.1, env-0.6.2, aspectlib-2.0.0, anyio-4.4.0, typeguard-4.3.0, qt-4.2.0, subprocess-1.5.2
asyncio: mode=Mode.STRICT
collected 0 items / 4 errors                                                                                                                                                                

========================================================================================== ERRORS ===========================================================================================
___________________________________________________________ ERROR collecting python/test/unit_distributed/test_contexts_arbmpi.py ___________________________________________________________
ImportError while importing test module '/usr/ports/science/py-arbor/work-py311/arbor-0.10.1/python/test/unit_distributed/test_contexts_arbmpi.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.11/site-packages/_pytest/python.py:520: in importtestmodule
    mod = import_path(
/usr/local/lib/python3.11/site-packages/_pytest/pathlib.py:584: in import_path
    importlib.import_module(module_name)
/usr/local/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1204: in _gcd_import
    ???
<frozen importlib._bootstrap>:1176: in _find_and_load
    ???
<frozen importlib._bootstrap>:1147: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:690: in _load_unlocked
    ???
/usr/local/lib/python3.11/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
    exec(co, module.__dict__)
test_contexts_arbmpi.py:8: in <module>
    from .. import cases
E   ImportError: attempted relative import with no known parent package
___________________________________________________________ ERROR collecting python/test/unit_distributed/test_contexts_mpi4py.py ___________________________________________________________
ImportError while importing test module '/usr/ports/science/py-arbor/work-py311/arbor-0.10.1/python/test/unit_distributed/test_contexts_mpi4py.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.11/site-packages/_pytest/python.py:520: in importtestmodule
    mod = import_path(
/usr/local/lib/python3.11/site-packages/_pytest/pathlib.py:584: in import_path
    importlib.import_module(module_name)
/usr/local/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1204: in _gcd_import
    ???
<frozen importlib._bootstrap>:1176: in _find_and_load
    ???
<frozen importlib._bootstrap>:1147: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:690: in _load_unlocked
    ???
/usr/local/lib/python3.11/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
    exec(co, module.__dict__)
test_contexts_mpi4py.py:8: in <module>
    from .. import cases
E   ImportError: attempted relative import with no known parent package
________________________________________________________ ERROR collecting python/test/unit_distributed/test_domain_decompositions.py ________________________________________________________
ImportError while importing test module '/usr/ports/science/py-arbor/work-py311/arbor-0.10.1/python/test/unit_distributed/test_domain_decompositions.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.11/site-packages/_pytest/python.py:520: in importtestmodule
    mod = import_path(
/usr/local/lib/python3.11/site-packages/_pytest/pathlib.py:584: in import_path
    importlib.import_module(module_name)
/usr/local/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1204: in _gcd_import
    ???
<frozen importlib._bootstrap>:1176: in _find_and_load
    ???
<frozen importlib._bootstrap>:1147: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:690: in _load_unlocked
    ???
/usr/local/lib/python3.11/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
    exec(co, module.__dict__)
test_domain_decompositions.py:8: in <module>
    from .. import cases
E   ImportError: attempted relative import with no known parent package
______________________________________________________________ ERROR collecting python/test/unit_distributed/test_simulator.py ______________________________________________________________
ImportError while importing test module '/usr/ports/science/py-arbor/work-py311/arbor-0.10.1/python/test/unit_distributed/test_simulator.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.11/site-packages/_pytest/python.py:520: in importtestmodule
    mod = import_path(
/usr/local/lib/python3.11/site-packages/_pytest/pathlib.py:584: in import_path
    importlib.import_module(module_name)
/usr/local/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1204: in _gcd_import
    ???
<frozen importlib._bootstrap>:1176: in _find_and_load
    ???
<frozen importlib._bootstrap>:1147: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:690: in _load_unlocked
    ???
/usr/local/lib/python3.11/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
    exec(co, module.__dict__)
test_simulator.py:7: in <module>
    from .. import cases
E   ImportError: attempted relative import with no known parent package
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 4 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
===================================================================================== 4 errors in 2.21s =====================================================================================
*** Error code 2

Version: 0.10.1
Python-3.11
FreeBSD 14.1

@yurivict yurivict added AEP Arbor Enhancement Proposal enhancement labels Aug 27, 2024
@thorstenhater
Copy link
Contributor

Hi @yurivict,

there is a short comment on that, namely here
https://docs.arbor-sim.org/en/stable/contrib/test.html#python-tests
It has proven practical, however, to run the following from the cmake build dir
in the development cycle:

PYTHONPATH=`pwd`/python python3 -munittest discover -v -s ../python

@yurivict
Copy link
Author

yurivict commented Aug 27, 2024

The above command fails after some tests succeeding:

cd /usr/ports/science/py-arbor/work-py311/.build &&  /usr/bin/env NINJA_STATUS="[%p %s/%t] " XDG_DATA_HOME=/usr/ports/science/py-arbor/work-py311  XDG_CONFIG_HOME=/usr/ports/science/py-arbor/work-py311  XDG_CACHE_HOME=/usr/ports/science/py-arbor/work-py311/.cache  HOME=/usr/ports/science/py-arbor/work-py311 PATH=/usr/local/libexec/ccache:/usr/ports/science/py-arbor/work-py311/.bin:/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin PKG_CONFIG_LIBDIR=/usr/ports/science/py-arbor/work-py311/.pkgconfig:/usr/local/libdata/pkgconfig:/usr/local/share/pkgconfig:/usr/libdata/pkgconfig MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES DESTDIR=/usr/ports/science/py-arbor/work-py311/stage PREFIX=/usr/local  LOCALBASE=/usr/local  CC="cc" CFLAGS="-O2 -pipe  -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing "  CPP="cpp" CPPFLAGS="-isystem /usr/local/include"  LDFLAGS=" -fstack-protector-strong -L/usr/local/lib " LIBS=""  CXX="c++" CXXFLAGS="-O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -fPIC -isystem /usr/local/include " CCACHE_DIR="/tmp/.ccache" BSD_INSTALL_PROGRAM="install  -s -m 555"  BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m 555"  BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444" PYTHONPATH=/usr/ports/science/py-arbor/work-py311/stage/usr/local/lib/python3.11/site-packages /usr/local/bin/python3.11 -munittest discover -v -s /usr/ports/science/py-arbor/work-py311/arbor-0.10.1/python
test.unit.test_catalogues (unittest.loader._FailedTest.test.unit.test_catalogues) ... ERROR
test_spike_clearing (test.unit.test_clear_samplers.TestClearSamplers.test_spike_clearing) ... ok
test_context (test.unit.test_contexts.TestContexts.test_context) ... ok
test_context_allocation (test.unit.test_contexts.TestContexts.test_context_allocation) ... ok
test_default_allocation (test.unit.test_contexts.TestContexts.test_default_allocation) ... ok
test_default_context (test.unit.test_contexts.TestContexts.test_default_context) ... ok
test_exceptions_allocation (test.unit.test_contexts.TestContexts.test_exceptions_allocation) ... ok
test_set_allocation (test.unit.test_contexts.TestContexts.test_set_allocation) ... ok
test_iclamp (test.unit.test_decor.TestDecorClasses.test_iclamp) ... ok
test_domain_decomposition_exceptions (test.unit.test_domain_decompositions.TestDomain_Decompositions.test_domain_decomposition_exceptions) ... ok
test_domain_decomposition_heterogenous_CPU (test.unit.test_domain_decompositions.TestDomain_Decompositions.test_domain_decomposition_heterogenous_CPU) ... ok
test_domain_decomposition_heterogenous_GPU (test.unit.test_domain_decompositions.TestDomain_Decompositions.test_domain_decomposition_heterogenous_GPU) ... skipped 'GPU not enabled'
test_domain_decomposition_hints (test.unit.test_domain_decompositions.TestDomain_Decompositions.test_domain_decomposition_hints) ... ok
test_domain_decomposition_homogenous_CPU (test.unit.test_domain_decompositions.TestDomain_Decompositions.test_domain_decomposition_homogenous_CPU) ... ok
test_domain_decomposition_homogenous_GPU (test.unit.test_domain_decompositions.TestDomain_Decompositions.test_domain_decomposition_homogenous_GPU) ... skipped 'GPU not enabled'
test_event_generator_explicit_schedule (test.unit.test_event_generators.TestEventGenerator.test_event_generator_explicit_schedule) ... ok
test_event_generator_poisson_schedule (test.unit.test_event_generators.TestEventGenerator.test_event_generator_poisson_schedule) ... ok
test_event_generator_regular_schedule (test.unit.test_event_generators.TestEventGenerator.test_event_generator_regular_schedule) ... ok
test_gid_index_ctor_cell_member (test.unit.test_identifiers.TestCellMembers.test_gid_index_ctor_cell_member) ... ok
test_set_gid_index_cell_member (test.unit.test_identifiers.TestCellMembers.test_set_gid_index_cell_member) ... ok
test_fileio (test.unit.test_io.TestAccIo.test_fileio) ... ok
test_nameio (test.unit.test_io.TestAccIo.test_nameio) ... ok
test_pathio (test.unit.test_io.TestAccIo.test_pathio) ... ok
test_stringio (test.unit.test_io.TestAccIo.test_stringio) ... ok
test_fileio (test.unit.test_io.TestAscIo.test_fileio) ... ok
test_nameio (test.unit.test_io.TestAscIo.test_nameio) ... ok
test_pathio (test.unit.test_io.TestAscIo.test_pathio) ... ok
test_stringio (test.unit.test_io.TestAscIo.test_stringio) ... ok
test_serialize (test.unit.test_io.TestSerdes.test_serialize) ... ok
test_fileio (test.unit.test_io.TestSwcArborIo.test_fileio) ... ok
test_nameio (test.unit.test_io.TestSwcArborIo.test_nameio) ... ok
test_pathio (test.unit.test_io.TestSwcArborIo.test_pathio) ... ok
test_stringio (test.unit.test_io.TestSwcArborIo.test_stringio) ... ok
test_fileio (test.unit.test_io.TestSwcNeuronIo.test_fileio) ... ok
test_nameio (test.unit.test_io.TestSwcNeuronIo.test_nameio) ... ok
test_pathio (test.unit.test_io.TestSwcNeuronIo.test_pathio) ... ok
test_stringio (test.unit.test_io.TestSwcNeuronIo.test_stringio) ... ok
test_compose (test.unit.test_morphology.TestPlacePwlin.test_compose) ... ok
test_identity (test.unit.test_morphology.TestPlacePwlin.test_identity) ... ok
test_mpoint (test.unit.test_morphology.TestPlacePwlin.test_mpoint) ... ok
test_place_pwlin_id (test.unit.test_morphology.TestPlacePwlin.test_place_pwlin_id) ... ok
test_place_pwlin_isometry (test.unit.test_morphology.TestPlacePwlin.test_place_pwlin_isometry) ... ok
test_rotation (test.unit.test_morphology.TestPlacePwlin.test_rotation) ... ok
test_translation (test.unit.test_morphology.TestPlacePwlin.test_translation) ... ok
test_multiple_connections_rr_halt (test.unit.test_multiple_connections.TestMultipleConnections.test_multiple_connections_rr_halt) ... ok
test_multiple_connections_rr_no_halt (test.unit.test_multiple_connections.TestMultipleConnections.test_multiple_connections_rr_no_halt) ... ok
test_multiple_connections_uni (test.unit.test_multiple_connections.TestMultipleConnections.test_multiple_connections_uni) ... ok
test_probe_addr_metadata (test.unit.test_probes.TestCableProbes.test_probe_addr_metadata) ... ok
test_probe_addr_metadata (test.unit.test_probes.TestLifProbes.test_probe_addr_metadata) ... ok
test_probe_result (test.unit.test_probes.TestLifProbes.test_probe_result) ... ok
test_summary (test.unit.test_profiling.TestProfiling.test_summary) ... skipped 'run test only with profiling support'
test_support (test.unit.test_profiling.TestProfiling.test_support) ... ok
test_events_explicit_schedule (test.unit.test_schedules.TestExplicitSchedule.test_events_explicit_schedule) ... ok
test_exceptions_explicit_schedule (test.unit.test_schedules.TestExplicitSchedule.test_exceptions_explicit_schedule) ... ok
test_times_contor_explicit_schedule (test.unit.test_schedules.TestExplicitSchedule.test_times_contor_explicit_schedule) ... ok
test_events_poisson_schedule (test.unit.test_schedules.TestPoissonSchedule.test_events_poisson_schedule) ... ok
test_exceptions_poisson_schedule (test.unit.test_schedules.TestPoissonSchedule.test_exceptions_poisson_schedule) ... ok
test_freq_poisson_schedule (test.unit.test_schedules.TestPoissonSchedule.test_freq_poisson_schedule) ... ok
test_freq_seed_contor_poisson_schedule (test.unit.test_schedules.TestPoissonSchedule.test_freq_seed_contor_poisson_schedule) ... ok
test_freq_tstart_contor_poisson_schedule (test.unit.test_schedules.TestPoissonSchedule.test_freq_tstart_contor_poisson_schedule) ... ok
test_tstart_freq_seed_contor_poisson_schedule (test.unit.test_schedules.TestPoissonSchedule.test_tstart_freq_seed_contor_poisson_schedule) ... ok
test_tstop_poisson_schedule (test.unit.test_schedules.TestPoissonSchedule.test_tstop_poisson_schedule) ... ok
test_events_regular_schedule (test.unit.test_schedules.TestRegularSchedule.test_events_regular_schedule) ... ok
test_exceptions_regular_schedule (test.unit.test_schedules.TestRegularSchedule.test_exceptions_regular_schedule) ... ok
test_none_ctor_regular_schedule (test.unit.test_schedules.TestRegularSchedule.test_none_ctor_regular_schedule) ... ok
test_set_tstart_dt_tstop_regular_schedule (test.unit.test_schedules.TestRegularSchedule.test_set_tstart_dt_tstop_regular_schedule) ... ok
test_tstart_dt_tstop_ctor_regular_schedule (test.unit.test_schedules.TestRegularSchedule.test_tstart_dt_tstop_ctor_regular_schedule) ... ok
test_spikes_sorted (test.unit.test_spikes.TestSpikes.test_spikes_sorted) ... ok

======================================================================
ERROR: test.unit.test_catalogues (unittest.loader._FailedTest.test.unit.test_catalogues)
----------------------------------------------------------------------
ImportError: Failed to import test module: test.unit.test_catalogues
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/unittest/loader.py", line 419, in _find_test_path
    module = self._get_module_from_name(name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/unittest/loader.py", line 362, in _get_module_from_name
    __import__(name)
  File "/usr/ports/science/py-arbor/work-py311/arbor-0.10.1/python/test/unit/test_catalogues.py", line 42, in <module>
    class TestCatalogues(unittest.TestCase):
  File "/usr/ports/science/py-arbor/work-py311/arbor-0.10.1/python/test/unit/test_catalogues.py", line 47, in TestCatalogues
    @fixtures.dummy_catalogue()
     ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/ports/science/py-arbor/work-py311/arbor-0.10.1/python/test/fixtures.py", line 55, in decorator
    fixture = fixture_factory(*args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/ports/science/py-arbor/work-py311/arbor-0.10.1/python/test/fixtures.py", line 40, in inject_fixture
    return func(*bound.args, **bound.kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/ports/science/py-arbor/work-py311/arbor-0.10.1/python/test/fixtures.py", line 173, in dummy_catalogue
    cat_path = _build_cat("dummy", path)
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/ports/science/py-arbor/work-py311/arbor-0.10.1/python/test/fixtures.py", line 40, in inject_fixture
    return func(*bound.args, **bound.kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/ports/science/py-arbor/work-py311/arbor-0.10.1/python/test/fixtures.py", line 161, in _build_cat
    _build_cat_local(name, path)
  File "/usr/ports/science/py-arbor/work-py311/arbor-0.10.1/python/test/fixtures.py", line 120, in _build_cat_local
    raise _BuildCatError(
test.fixtures._BuildCatError: Tests can't build catalogue 'dummy' from '/usr/ports/science/py-arbor/work-py311/arbor-0.10.1/test/unit/dummy':
Traceback (most recent call last):
  File "/usr/local/bin/arbor-build-catalogue", line 318, in <module>
    sp.run(make_cmd, shell=True, check=True, capture_output = True, text = True)
  File "/usr/local/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'make' returned non-zero exit status 2.
 Error:

c++: error: no input files
/bin/sh: -pipe: not found
/bin/sh: -fstack-protector-strong: not found
/bin/sh: -isystem: not found
/bin/sh: /usr/local/include: Permission denied
/bin/sh: -fno-strict-aliasing: not found
/bin/sh: -isystem: not found
/bin/sh: /usr/local/include: Permission denied
make[3]: *** [CMakeFiles/dummy-catalogue.dir/build.make:83: CMakeFiles/dummy-catalogue.dir/generated/dummy/dummy_catalogue.cpp.o] Error 126
make[2]: *** [CMakeFiles/Makefile2:83: CMakeFiles/dummy-catalogue.dir/all] Error 2
make[1]: *** [Makefile:91: all] Error 2


Building catalogue 'dummy' from mechanisms in /usr/ports/science/py-arbor/work-py311/arbor-0.10.1/test/unit/dummy
 * NMODL
   * dummy
Build log:
make[1]: Entering directory '/tmp/tmp_d0w1s6y/build'
[ 25%] modcc generating: /tmp/tmp_d0w1s6y/build/generated/dummy/dummy_catalogue.cpp;/tmp/tmp_d0w1s6y/build/generated/dummy/dummy_cpu.cpp
[ 50%] Building CXX object CMakeFiles/dummy-catalogue.dir/generated/dummy/dummy_catalogue.cpp.o
make[1]: Leaving directory '/tmp/tmp_d0w1s6y/build'



----------------------------------------------------------------------
Ran 68 tests in 0.064s

FAILED (errors=1, skipped=3)
*** Error code 1

@thorstenhater
Copy link
Contributor

Does it still fail after traversing to the arbor checkout and using this instead:

PYTHONPATH=<path/to/build> python3 -munittest discover -v -s python

?
Reasoning: Some of our tests build a shared object plugin and it seems the
fixture is misbehaving such that artifact is not found

@thorstenhater
Copy link
Contributor

thorstenhater commented Aug 27, 2024

Coming back to the error log, I'd also suspect something is off with the invocation:
Quoting the log

c++: error: no input files
/bin/sh: -pipe: not found
/bin/sh: -fstack-protector-strong: not found
/bin/sh: -isystem: not found
/bin/sh: /usr/local/include: Permission denied
/bin/sh: -fno-strict-aliasing: not found
/bin/sh: -isystem: not found
/bin/sh: /usr/local/include: Permission denied

Possibly skip the relevant tests (those loading plugins) and/or check whether you can build a
plugin like so (after make install; otherwise you'll have to adjust at least PYTHONPATH and PATH)

arbor-build-catalogue dummy [...]/test/unit/dummy/

Output should be similar to this

Building catalogue 'dummy' from mechanisms in [...]/test/unit/dummy
 * NMODL
   * dummy
Catalogue has been built and copied to [...]/dummy-catalogue.so

@thorstenhater thorstenhater linked a pull request Sep 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AEP Arbor Enhancement Proposal enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@yurivict @thorstenhater and others