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 py_QuantitativeReportingTests #221

Open
jcfr opened this issue Feb 6, 2018 · 3 comments
Open

Fix py_QuantitativeReportingTests #221

jcfr opened this issue Feb 6, 2018 · 3 comments
Assignees

Comments

@jcfr
Copy link
Collaborator

jcfr commented Feb 6, 2018

$ ctest -V

    Start 1: py_QuantitativeReportingTests

1: Test command: /home/kitware/Dashboards/Nightly/Slicer-0-build/Slicer-build/Slicer "--no-splash" "--testing" "--launcher-additional-settings" "/home/kitware/Dashboards/Nightly/S-0-E-b/QuantitativeReporting-build/AdditionalLauncherSettings.ini" "--additional-module-paths" "/home/kitware/Dashboards/Nightly/S-0-E-b/QuantitativeReporting-build/lib/Slicer-4.9/qt-scripted-modules" "/home/kitware/Dashboards/Nightly/S-0-E-b/SlicerDevelopmentToolbox-build/./lib/Slicer-4.9/qt-loadable-modules" "/home/kitware/Dashboards/Nightly/S-0-E-b/SlicerDevelopmentToolbox-build/./lib/Slicer-4.9/cli-modules" "/home/kitware/Dashboards/Nightly/S-0-E-b/PETDICOMExtension-build/./lib/Slicer-4.9/qt-loadable-modules" "/home/kitware/Dashboards/Nightly/S-0-E-b/PETDICOMExtension-build/./lib/Slicer-4.9/cli-modules" "/home/kitware/Dashboards/Nightly/S-0-E-b/DCMQI-build/dcmqi-build/dcmqi-build/bin" "/home/kitware/Dashboards/Nightly/S-0-E-b/SlicerDevelopmentToolbox-build/./lib/Slicer-4.9/qt-scripted-modules" "--additional-module-paths" "/home/kitware/Dashboards/Nightly/S-0-E-b/QuantitativeReporting-build/lib/Slicer-4.9/qt-scripted-modules" "/home/kitware/Dashboards/Nightly/S-0-E-b/QuantitativeReporting-build/lib/Slicer-4.9/cli-modules" "/home/kitware/Dashboards/Nightly/S-0-E-b/QuantitativeReporting-build/lib/Slicer-4.9/qt-loadable-modules" "--python-code" "import slicer.testing; slicer.testing.runUnitTest(['/home/kitware/Dashboards/Nightly/S-0-E-b/QuantitativeReporting-build/Testing', '/home/kitware/Dashboards/Nightly/S-0-E-b/QuantitativeReporting/Testing'], 'QuantitativeReportingTests')"
1: Test timeout computed to be: 1500
1: Number of registered modules: 145 
1: SystemError: /home/kitware/Dashboards/Nightly/Slicer-0-build/Python-2.7.13/Objects/classobject.c:521: bad argument to internal function
1: qSlicerPythonCppAPI::instantiateClass  - [ "__init__" ] - Failed to instantiate scripted pythonqt class "__init__" 0x7f08d4ab9810 
1: Fail to instantiate module  "__init__" 
1: Number of instantiated modules: 144 
1: Number of loaded modules: 144 
1: Switch to module:  "Welcome" 
1: -------------------------------------------
1: path: ['/home/kitware/Dashboards/Nightly/S-0-E-b/QuantitativeReporting-build/Testing', '/home/kitware/Dashboards/Nightly/S-0-E-b/QuantitativeReporting/Testing']
1: testname: QuantitativeReportingTests
1: -------------------------------------------
1: Closing the scene
1: Starting test_create_report
1: Switch to module:  "QuantitativeReporting" 
1: Loading testdata
1: test_create_report (QuantitativeReportingTests.QuantitativeReportingTest) ... ERROR
1: Closing the scene
1: test_import_labelmap (QuantitativeReportingTests.QuantitativeReportingTest) ... Traceback (most recent call last):
1:   File "/home/kitware/Dashboards/Nightly/Slicer-0-build/Slicer-build/lib/Slicer-4.9/qt-scripted-modules/SegmentEditor.py", line 143, in onSceneEndClose
1:     if self.parent.isEntered:
1: AttributeError: QGroupBox has no attribute named 'isEntered'
1: Starting test_import_labelmap
1: Loading testdata
1: ERROR
1: Closing the scene
1: test_import_segmentation (QuantitativeReportingTests.QuantitativeReportingTest) ... Traceback (most recent call last):
1:   File "/home/kitware/Dashboards/Nightly/Slicer-0-build/Slicer-build/lib/Slicer-4.9/qt-scripted-modules/SegmentEditor.py", line 143, in onSceneEndClose
1:     if self.parent.isEntered:
1: AttributeError: QGroupBox has no attribute named 'isEntered'
1: Starting test_import_segmentation
1: Loading testdata
1: ERROR
1: Closing the scene
1: test_read_report (QuantitativeReportingTests.QuantitativeReportingTest) ... Traceback (most recent call last):
1:   File "/home/kitware/Dashboards/Nightly/Slicer-0-build/Slicer-build/lib/Slicer-4.9/qt-scripted-modules/SegmentEditor.py", line 143, in onSceneEndClose
1:     if self.parent.isEntered:
1: AttributeError: QGroupBox has no attribute named 'isEntered'
1: Starting test_read_report
1: ERROR
1: runTest (slicer.ScriptedLoadableModule.ScriptedLoadableModuleTest) ... No test is defined in ScriptedLoadableModuleTest
1: ok
1: 
1: ======================================================================
1: ERROR: test_create_report (QuantitativeReportingTests.QuantitativeReportingTest)
1: ----------------------------------------------------------------------
1: Traceback (most recent call last):
1:   File "/home/kitware/Dashboards/Nightly/S-0-E-b/QuantitativeReporting/Testing/QuantitativeReportingTests.py", line 186, in test_create_report
1:     self.loadTestVolume()
1:   File "/home/kitware/Dashboards/Nightly/S-0-E-b/QuantitativeReporting/Testing/QuantitativeReportingTests.py", line 119, in loadTestVolume
1:     qrWidget.loadTestData(self.collection, imageDataType="volume", uid=self.data["volume"]["uid"])
1:   File "/home/kitware/Dashboards/Nightly/S-0-E-b/QuantitativeReporting-build/lib/Slicer-4.9/qt-scripted-modules/QuantitativeReporting.py", line 197, in loadTestData
1:     if not len(slicer.dicomDatabase.filesForSeries(uid)):
1: AttributeError: 'NoneType' object has no attribute 'filesForSeries'
1: 
1: ======================================================================
1: ERROR: test_import_labelmap (QuantitativeReportingTests.QuantitativeReportingTest)
1: ----------------------------------------------------------------------
1: Traceback (most recent call last):
1:   File "/home/kitware/Dashboards/Nightly/S-0-E-b/QuantitativeReporting/Testing/QuantitativeReportingTests.py", line 229, in test_import_labelmap
1:     self.loadTestVolume()
1:   File "/home/kitware/Dashboards/Nightly/S-0-E-b/QuantitativeReporting/Testing/QuantitativeReportingTests.py", line 119, in loadTestVolume
1:     qrWidget.loadTestData(self.collection, imageDataType="volume", uid=self.data["volume"]["uid"])
1:   File "/home/kitware/Dashboards/Nightly/S-0-E-b/QuantitativeReporting-build/lib/Slicer-4.9/qt-scripted-modules/QuantitativeReporting.py", line 197, in loadTestData
1:     if not len(slicer.dicomDatabase.filesForSeries(uid)):
1: AttributeError: 'NoneType' object has no attribute 'filesForSeries'
1: 
1: ======================================================================
1: ERROR: test_import_segmentation (QuantitativeReportingTests.QuantitativeReportingTest)
1: ----------------------------------------------------------------------
1: Traceback (most recent call last):
1:   File "/home/kitware/Dashboards/Nightly/S-0-E-b/QuantitativeReporting/Testing/QuantitativeReportingTests.py", line 269, in test_import_segmentation
1:     self.loadTestVolume()
1:   File "/home/kitware/Dashboards/Nightly/S-0-E-b/QuantitativeReporting/Testing/QuantitativeReportingTests.py", line 119, in loadTestVolume
1:     qrWidget.loadTestData(self.collection, imageDataType="volume", uid=self.data["volume"]["uid"])
1:   File "/home/kitware/Dashboards/Nightly/S-0-E-b/QuantitativeReporting-build/lib/Slicer-4.9/qt-scripted-modules/QuantitativeReporting.py", line 197, in loadTestData
1:     if not len(slicer.dicomDatabase.filesForSeries(uid)):
1: AttributeError: 'NoneType' object has no attribute 'filesForSeries'
1: 
1: ======================================================================
1: ERROR: test_read_report (QuantitativeReportingTests.QuantitativeReportingTest)
1: ----------------------------------------------------------------------
1: Traceback (most recent call last):
1:   File "/home/kitware/Dashboards/Nightly/S-0-E-b/QuantitativeReporting/Testing/QuantitativeReportingTests.py", line 143, in test_read_report
1:     loadTestData()
1:   File "/home/kitware/Dashboards/Nightly/S-0-E-b/QuantitativeReporting/Testing/QuantitativeReportingTests.py", line 135, in loadTestData
1:     if not len(slicer.dicomDatabase.filesForSeries(fileData['uid'])):
1: AttributeError: 'NoneType' object has no attribute 'filesForSeries'
1: 
1: ----------------------------------------------------------------------
1: Ran 5 tests in 11.788s
1: 
1: FAILED (errors=4)
1: Traceback (most recent call last):
1:   File "<string>", line 1, in <module>
1:   File "/home/kitware/Dashboards/Nightly/Slicer-0-build/Slicer-build/bin/Python/slicer/testing.py", line 25, in runUnitTest
1:     exitFailure()
1:   File "/home/kitware/Dashboards/Nightly/Slicer-0-build/Slicer-build/bin/Python/slicer/testing.py", line 10, in exitFailure
1:     raise Exception(message)
1: Exception
1: Switch to module:  "" 
1/1 Test #1: py_QuantitativeReportingTests ....***Failed   24.00 sec

0% tests passed, 1 tests failed out of 1

Total Test time (real) =  24.00 sec

The following tests FAILED:
	  1 - py_QuantitativeReportingTests (Failed)
Errors while running CTest
@che85
Copy link
Member

che85 commented Feb 6, 2018

@jcfr Thanks a lot for the help today.

Is it uncommon to use the slicer.dicomDatabase in tests? If so, are there any examples how to handle such situations?

@che85 che85 self-assigned this Feb 6, 2018
@jcfr
Copy link
Collaborator Author

jcfr commented Feb 6, 2018

You could look into using the context manager DICOMUtils.TemporaryDICOMDatabase(self.dicomDatabaseDir)

For example, see SlicerRt/SlicerRT@eb6d8e7

che85 added a commit to che85/Reporting that referenced this issue Feb 7, 2018
che85 added a commit that referenced this issue Feb 7, 2018
BUG: fix failing tests (issue #221)
che85 added a commit to che85/Reporting that referenced this issue Apr 21, 2018
)

TODO:
* validation of inputs
* export from subject hierarchy
che85 added a commit to che85/Reporting that referenced this issue Apr 23, 2018
)

TODO:
* validation of inputs
* export from subject hierarchy
che85 added a commit to che85/Reporting that referenced this issue May 15, 2018
)

TODO:
* validation of inputs
* export from subject hierarchy
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

No branches or pull requests

3 participants