populse / populse_mia

Multiparametric Image Analysis
Other
10 stars 9 forks source link

[general need] Currently, unit tests fail #253

Closed servoz closed 2 years ago

servoz commented 2 years ago

This seems to come from the f009289 commit, and after.

servoz commented 2 years ago
denisri commented 2 years ago

Seems like it is due to empty input / output main nodes of a pipeline being deleted (populse/capsul#186), but the tests don't expect this new behaviour ;)

The error is:

======================================================================
ERROR: test_undo_redo (__main__.TestMIAPipelineManager)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/casa/host/src/populse/populse_mia/master/python/populse_mia/test.py", line 2446, in test_undo_redo
    pipeline_manager.redo()
  File "/casa/host/src/populse/populse_mia/master/python/populse_mia/user_interface/pipeline_manager/pipeline_manager_tab.py", line 1920, in redo
    c_e.scene.add_link(source, dest, active=True, weak=False)
  File "/casa/host/src/capsul/master/capsul/qt_gui/widgets/pipeline_developer_view.py", line 1689, in add_link
    source_gnode = self.gnodes[source_gnode_name]
KeyError: 'inputs'
denisri commented 2 years ago

It's not only the test actually, it's the undo/redo features which don't expect the new behaviour.

servoz commented 2 years ago

exactly, I'm looking at this!

servoz commented 2 years ago

The last commits seem to fix the issue. On the other hand we have again a permission issue, with Windows, when we test the deletion of a document in the DataBrowser: PermissionError: [WinError 32] The process cannot access the file because it is being used by another process:

servoz commented 2 years ago

Ah, not only Windows! Mac also fails on TestMIADataBrowser.test_brick_history():

test_brick_history (__main__.TestMIADataBrowser)
Tests the brick history popup ... show_data_history: data/raw_data/sGuerbet-C6-2014-Rat-K52-Tube27-2014-02-14_10-23-17-02-G1_Guerbet_Anat-RARE__pvm_-00-02-20.000.nii
bricks for: data/raw_data/sGuerbet-C6-2014-Rat-K52-Tube27-2014-02-14_10-23-17-02-G1_Guerbet_Anat-RARE__pvm_-00-02-20.000.nii : ['0006f6ff-e8b4-46f0-9a39-a04125ed792b']
brick_id exec_time: <class 'datetime.datetime'> 2018-08-08 18:22:32.371745 , before: None
0006f6ff-e8b4-46f0-9a39-a04125ed792b : smooth1
-- ancestors for: 0006f6ff-e8b4-46f0-9a39-a04125ed792b smooth1 <capsul.process.process.Process object at 0x12b0d3770>
/Users/appveyor/projects/capsul/capsul/qt_gui/widgets/pipeline_developer_view.py:3605: ResourceWarning: unclosed file <_io.TextIOWrapper name='/var/folders/5s/g225f6nd6jl4g8tshbh1ltk40000gn/T/tmpf8s144v1' mode='w' encoding='UTF-8'>
  pipeline_tools.save_dot_graph(dgraph, tfile_name)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
Traceback (most recent call last):
  File "/Users/appveyor/projects/populse-mia/python/populse_mia/user_interface/data_browser/data_browser.py", line 2188, in show_data_history
    win.auto_dot_node_positions()
  File "/Users/appveyor/projects/capsul/capsul/qt_gui/widgets/pipeline_developer_view.py", line 3609, in auto_dot_node_positions
    soma.subprocess.check_call(cmd)
  File "/Users/appveyor/.localpython3.7.11/lib/python3.7/subprocess.py", line 358, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/Users/appveyor/.localpython3.7.11/lib/python3.7/subprocess.py", line 339, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/Users/appveyor/.localpython3.7.11/lib/python3.7/subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "/Users/appveyor/.localpython3.7.11/lib/python3.7/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'dot': 'dot'
Fatal Python error: Aborted
denisri commented 2 years ago

The latter one is because dot (graphviz) is not installed on the test mac system. It should be optional. I'm fixing that.

servoz commented 2 years ago

ok, I'll look at the issue with Windows then.

servoz commented 2 years ago

The issues seem to be fixed now. I'm closing this ticket.