inasafe / inasafe

InaSAFE - QGIS plugin for estimating impact from natural disasters
www.inasafe.org
GNU General Public License v3.0
257 stars 136 forks source link

Failing test on FloodRasterRoadsExperimentalFunction2 #1030

Closed ismailsunni closed 10 years ago

ismailsunni commented 10 years ago

Hi @assefay

Would you like to take a look in this failing test:

http://jenkins.inasafe.org/view/QGIS2-InaSAFE-develop/job/safe-package/lastCompletedBuild/testReport/safe.impact_functions.inundation.test_qgis_native_impact_functions/Test_gis_native_impact_functions/test_raster_roads_impact_optimized/

Error Message

21 != 25
-------------------- >> begin captured logging << --------------------
InaSAFE: DEBUG: calculate_impact called with:
Layers: [<safe.impact_functions.inundation.test_qgis_native_impact_functions.Wrapper instance at 0x70006c8>, <safe.impact_functions.inundation.test_qgis_native_impact_functions.Wrapper instance at 0x7000998>]
Function:<class 'safe.impact_functions.inundation.flood_raster_roads_experimental-optimized.FloodRasterRoadsExperimentalFunction2'>
--------------------- >> end captured logging << ---------------------
Stacktrace

  File "/usr/lib/python2.7/unittest/case.py", line 327, in run
    testMethod()
  File "/var/lib/jenkins/inasafe-dev/safe/impact_functions/inundation/test_qgis_native_impact_functions.py", line 357, in test_raster_roads_impact_optimized
    self.assertEquals(count, 25)
  File "/usr/lib/python2.7/unittest/case.py", line 511, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/lib/python2.7/unittest/case.py", line 504, in _baseAssertEqual
    raise self.failureException(msg)
21 != 25
-------------------- >> begin captured logging << --------------------
InaSAFE: DEBUG: calculate_impact called with:
Layers: [<safe.impact_functions.inundation.test_qgis_native_impact_functions.Wrapper instance at 0x70006c8>, <safe.impact_functions.inundation.test_qgis_native_impact_functions.Wrapper instance at 0x7000998>]
Function:<class 'safe.impact_functions.inundation.flood_raster_roads_experimental-optimized.FloodRasterRoadsExperimentalFunction2'>
ismailsunni commented 10 years ago

I only updated the unit test, so this test pass based on what I saw in the QGIS.

assefay commented 10 years ago

@ismailsunni sorry for the delay. looking at it now ...

ismailsunni commented 10 years ago

@assefay I made an update to the unit test (the expected value) based on what I got from QGIS. I hope it's right.

assefay commented 10 years ago

@ismailsunni I think there seem to be a problem with the function it's self. The results should not have changed. I am looking into the steps to see what has caused the changes in the result.

ismailsunni commented 10 years ago

Hmm, ok.

So, my fix is not right. We can revert my fix.

assefay commented 10 years ago

@ismailsunni , @timlinux

The function was "broken" at one point (a shift of about 1/2 pixel in the corners). This was creating the failure in the test. I tried to figure this out yesterday but missed the deadline. I just fixed it now and will be committing. all test case are now ok. I reverted back the value in the test case to what it was originally. Thanks @ismailsunni. And sorry for the delay.

timlinux commented 10 years ago

Hi @assefa

On Wed, Jun 11, 2014 at 10:31 PM, Yewondwossen Assefa < notifications@github.com> wrote:

@ismailsunni https://github.com/ismailsunni , @timlinux https://github.com/timlinux

The function was "broken" at one point (a shift of about 1/2 pixel in the corners). This was creating the failure in the test. I tried to figure this out yesterday but missed the deadline. I just fixed it now and will be committing. all test case are now ok. I reverted back the value in the test case to what it was originally. Thanks @ismailsunni https://github.com/ismailsunni. And sorry for the delay.

Thanks for this. We found a few tests failing under windows so there is still time for some last minute tweaks today if needed.

Regards

Tim

— Reply to this email directly or view it on GitHub https://github.com/AIFDR/inasafe/issues/1030#issuecomment-45757365.

Tim Sutton

Visit http://linfiniti.com to find out about: