Running tests after building from source

The basics of how to develop, test, and use models.
Post Reply
jpinezich
Posts: 3
Joined: Sun Dec 12, 2021 10:18 pm

Running tests after building from source

Post by jpinezich »

Following the directions here: https://neuronsimulator.github.io/nrn/c ... tions.html

In particular I tried to run these commands after cloning:
mkdir build
cmake .. -DNRN_ENABLE_TESTS=ON ...
make -j
make test
ctest -VV -R parallel_tests
cd ../test/pynrn
python3 -m pytest test_bbss.py

The 24 tests from make test ran fine and reported passed.
The ctest -VV command could not find tests.
test_bbss.py produced errors about HocObject no attribute 'Follower'.
Not sure what I am missing?

jpinezich@jpinezich-VirtualBox:~/NRN/git/nrn/test/pynrn$ python3 -m pytest test_bbss.py
==================================================================================== test session starts =====================================================================================
platform linux -- Python 3.8.10, pytest-7.0.1, pluggy-1.0.0
rootdir: /home/jpinezich/NRN/git/nrn
plugins: cov-3.0.0
collected 1 item

test_bbss.py F [100%]

========================================================================================== FAILURES ==========================================================================================
_________________________________________________________________________________________ test_bbss __________________________________________________________________________________________

def test_bbss():
print("focus on BinQ initialization Issue #1444")
ncell = 3
n = 5

> model = Model2(5)

test_bbss.py:108:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <test_bbss.Model2 object at 0x7fa6e2ba4070>, n = 5

def __init__(self, n):
self.ncell_per_layer = [1, n, 2]
self.cells = {}
# make cells and associate with gid (round robin distribution)
for ilayer, ncell in enumerate(self.ncell_per_layer):
for icell in range(ncell):
gid = self.info2gid(ilayer, icell)
if (gid % pc.nhost()) == pc.id():
> self.cells[gid] = h.Follower()
E AttributeError: 'hoc.HocObject' object has no attribute 'Follower'

test_bbss.py:57: AttributeError
------------------------------------------------------------------------------------ Captured stdout call ------------------------------------------------------------------------------------
focus on BinQ initialization Issue #1444
================================================================================== short test summary info ===================================================================================
FAILED test_bbss.py::test_bbss - AttributeError: 'hoc.HocObject' object has no attribute 'Follower'
===================================================================================== 1 failed in 0.08s ======================================================================================
jpinezich@jpinezich-VirtualBox:~/NRN/git/nrn/test/pynrn$
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: Running tests after building from source

Post by hines »

The ctest -VV command could not find tests.
I'm not seeing a problem with that (when launched from the build folder). It verbosely executed all tests. Not sure what went wrong in your case. Please copy the error message here.
test_bbss.py produced errors about HocObject no attribute 'Follower'.
Changing folders to ~/NRN/git/nrn/test/pynrn and launching python3 -m pytest test_bbss.py
requires first that you launch
nrnivmodl
in that folder so that the Follower mechanism is available.
jpinezich
Posts: 3
Joined: Sun Dec 12, 2021 10:18 pm

Re: Running tests after building from source

Post by jpinezich »

I'm not sure what I did differently, but it passed the parallel test: "0 tests failed out of 1"

jpinezich@jpinezich-VirtualBox:~/NRN/git/nrn/build$ ctest -VV -R parallel_tests
UpdateCTestConfiguration from :/home/jpinezich/NRN/git/nrn/build/DartConfiguration.tcl
Parse Config file:/home/jpinezich/NRN/git/nrn/build/DartConfiguration.tcl
UpdateCTestConfiguration from :/home/jpinezich/NRN/git/nrn/build/DartConfiguration.tcl
Parse Config file:/home/jpinezich/NRN/git/nrn/build/DartConfiguration.tcl
Test project /home/jpinezich/NRN/git/nrn/build
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 6
Start 6: parallel_tests

6: Test command: /usr/bin/cmake "-E" "env" "mpiexec" "-n" "6" "--oversubscribe" "/home/jpinezich/NRN/git/nrn/build/bin/nrniv" "-mpi" "-python" "/home/jpinezich/NRN/git/nrn/test/parallel_tests/test_subworld.py"
6: Environment variables:
6: NEURONHOME=/home/jpinezich/NRN/git/nrn/build/share/nrn
6: NRNHOME=/home/jpinezich/NRN/git/nrn/build
6: LD_LIBRARY_PATH=/home/jpinezich/NRN/git/nrn/build/lib:
6: CORENRNHOME=/home/jpinezich/NRN/git/nrn/build
6: PYTHONPATH=/home/jpinezich/NRN/git/nrn/build/lib/python:/home/jpinezich/NRN/git/nrn/test/rxd:
6: Test timeout computed to be: 1500
6: numprocs=6
6: NEURON -- VERSION 8.0a-747-g20e6aa4e master (20e6aa4e) 2022-02-16
6: Duke, Yale, and the BlueBrain Project -- Copyright 1984-2021
6: See http://neuron.yale.edu/neuron/credits
6:
6: id_world nhost_world id_bbs nhost_bbs ibbs nbbs id nhost
6: 0 6 0 2 0 2 0 3
6: 1 6 -1 -1 0 2 1 3
6: 2 6 -1 -1 0 2 2 3
6: 4 6 -1 -1 1 2 1 3
6: 5 6 -1 -1 1 2 2 3
6: 3 6 1 2 1 2 0 3
6: f(submit 0) id_world=0 id=0
6: working returned ('submit 0', 0, 0) (submit passed submit 0)
6: f(submit 1) id_world=0 id=0
6: f(submit 0) id_world=1 id=1
6: working returned ('submit 1', 0, 0) (submit passed submit 1)
6: f(submit 2) id_world=0 id=0
6: working returned ('submit 2', 0, 0) (submit passed submit 2)
6: f(submit 3) id_world=0 id=0
6: working returned ('submit 3', 0, 0) (submit passed submit 3)
6: f(submit 4) id_world=0 id=0
6: working returned ('submit 4', 0, 0) (submit passed submit 4)
6: f(submit 1) id_world=1 id=1
6: f(submit 0) id_world=2 id=2
6: f(submit 2) id_world=1 id=1
6: f(submit 3) id_world=1 id=1
6: f(submit 4) id_world=1 id=1
6: f(submit 1) id_world=2 id=2
6: f(submit 2) id_world=2 id=2
6: f(submit 3) id_world=2 id=2
6: f(submit 4) id_world=2 id=2
1/1 Test #6: parallel_tests ................... Passed 0.53 sec

The following tests passed:
parallel_tests

100% tests passed, 0 tests failed out of 1

Total Test time (real) = 0.53 sec
jpinezich@jpinezich-VirtualBox:~/NRN/git/nrn/build$
jpinezich
Posts: 3
Joined: Sun Dec 12, 2021 10:18 pm

Re: Running tests after building from source

Post by jpinezich »

Also, I did get a little further with test_bbss.py by issuing the command for the Follower:

nrnivmodl
python3 -m pytest test_bbss.py

Here is the error:

jpinezich@jpinezich-VirtualBox:~/NRN/git/nrn/test/pynrn$ nrnivmodl

jpinezich@jpinezich-VirtualBox:~/NRN/git/nrn/test/pynrn$ python3 -m pytest test_bbss.py
==================================================================================== test session starts =====================================================================================
platform linux -- Python 3.8.10, pytest-7.0.1, pluggy-1.0.0
rootdir: /home/jpinezich/NRN/git/nrn
plugins: cov-3.0.0
collected 1 item

test_bbss.py F [100%]

'dot dot dot' (skipped over print out of files)

E RuntimeError: hoc error

test_bbss.py:179: RuntimeError
------------------------------------------------------------------------------------ Captured stdout call ------------------------------------------------------------------------------------
focus on BinQ initialization Issue #1444
{0: Follower[0], 100: Follower[1], 101: Follower[2], 102: Follower[3], 103: Follower[4], 104: Follower[5], 200: Follower[6], 201: Follower[7]}
{(0, 100): NetCon[0], (0, 101): NetCon[1], (0, 102): NetCon[2], (0, 103): NetCon[3], (0, 104): NetCon[4], (100, 200): NetCon[5], (101, 200): NetCon[6], (102, 200): NetCon[7], (103, 200): NetCon[8], (104, 200): NetCon[9], (100, 201): NetCon[10], (101, 201): NetCon[11], (102, 201): NetCon[12], (103, 201): NetCon[13], (104, 201): NetCon[14]}
{0: NetCon[15]}
srun tsave=1.1 tstop=5 start=0.9999 delay=0
after save
SelfEvent target=NetStim[0] 1.1999 flag=1
PreSyn src=Follower[0] 2.0999
PreSyn src=Follower[0] 2.1999
after restore
SelfEvent target=NetStim[0] 0.9999 flag=3
SelfEvent target=NetStim[0] 1.1999 flag=1
PreSyn src=Follower[0] 2.0999
PreSyn src=Follower[0] 2.1999
------------------------------------------------------------------------------------ Captured stderr call ------------------------------------------------------------------------------------
NEURON: NetStim[0] :Event arrived out of order. Must call ParallelContext.set_maxstep AFTER assigning minimum NetCon.delay
near line 0
objref hoc_obj_[2]
^
ParallelContext[0].psolve(5)
================================================================================== short test summary info ===================================================================================
FAILED test_bbss.py::test_bbss - RuntimeError: hoc error
===================================================================================== 1 failed in 0.09s ======================================================================================
jpinezich@jpinezich-VirtualBox:~/NRN/git/nrn/test/pynrn$ history -l 3
Post Reply