AtlasOfLivingAustralia / webapi

Atlas Web service API app
https://api.ala.org.au
1 stars 6 forks source link

Fix failed tests causing build to fail #23

Closed nickdos closed 4 years ago

nickdos commented 5 years ago

See last travis build. Unit tests are failing:

au.org.ala.webapi.AppControllerTests > testSomething FAILED
    groovy.lang.MissingMethodException at AppControllerTests.groovy:12
au.org.ala.webapi.AppTests > testSomething FAILED
    groovy.lang.MissingMethodException at AppTests.groovy:12
au.org.ala.webapi.CategoryControllerTests > testSomething FAILED
    groovy.lang.MissingMethodException at CategoryControllerTests.groovy:12
au.org.ala.webapi.CategoryTests > testSomething FAILED
    groovy.lang.MissingMethodException at CategoryTests.groovy:12
au.org.ala.webapi.ExampleControllerTests > testEdit FAILED
    org.codehaus.groovy.runtime.powerassert.PowerAssertionError at ExampleControllerTests.groovy:72
au.org.ala.webapi.ExampleControllerTests > testSave FAILED
    org.codehaus.groovy.runtime.powerassert.PowerAssertionError at ExampleControllerTests.groovy:38
au.org.ala.webapi.ExampleControllerTests > testShow FAILED
    org.codehaus.groovy.runtime.powerassert.PowerAssertionError at ExampleControllerTests.groovy:60
au.org.ala.webapi.ExampleControllerTests > testCreate FAILED
    java.lang.NullPointerException at ExampleControllerTests.groovy:32
au.org.ala.webapi.ExampleControllerTests > testDelete FAILED
    org.codehaus.groovy.runtime.powerassert.PowerAssertionError at ExampleControllerTests.groovy:134
au.org.ala.webapi.ExampleControllerTests > testUpdate FAILED
    org.codehaus.groovy.runtime.powerassert.PowerAssertionError at ExampleControllerTests.groovy:98
au.org.ala.webapi.ExampleParamControllerTests > testSomething FAILED
    groovy.lang.MissingMethodException at ExampleParamControllerTests.groovy:12
au.org.ala.webapi.ExampleParamTests > testSomething FAILED
    groovy.lang.MissingMethodException at ExampleParamTests.groovy:12
au.org.ala.webapi.ExampleTests > testSomething FAILED
    groovy.lang.MissingMethodException at ExampleTests.groovy:12
au.org.ala.webapi.ParamTests > testSomething FAILED
    groovy.lang.MissingMethodException at ParamTests.groovy:12
au.org.ala.webapi.WebServiceControllerTests > testIndex FAILED
    java.lang.IllegalStateException at WebServiceControllerTests.groovy:17
au.org.ala.webapi.WebServiceControllerTests > testEdit FAILED
    java.lang.IllegalStateException at WebServiceControllerTests.groovy:70
au.org.ala.webapi.WebServiceControllerTests > testList FAILED
    java.lang.IllegalStateException at WebServiceControllerTests.groovy:23
au.org.ala.webapi.WebServiceControllerTests > testSave FAILED
    org.codehaus.groovy.runtime.powerassert.PowerAssertionError at WebServiceControllerTests.groovy:38
au.org.ala.webapi.WebServiceControllerTests > testShow FAILED
    java.lang.IllegalStateException at WebServiceControllerTests.groovy:52
au.org.ala.webapi.WebServiceControllerTests > testCreate FAILED
    java.lang.NullPointerException at WebServiceControllerTests.groovy:30
au.org.ala.webapi.WebServiceControllerTests > testDelete FAILED
    org.codehaus.groovy.runtime.powerassert.PowerAssertionError at WebServiceControllerTests.groovy:134
au.org.ala.webapi.WebServiceControllerTests > testUpdate FAILED
    org.codehaus.groovy.runtime.powerassert.PowerAssertionError at WebServiceControllerTests.groovy:90
au.org.ala.webapi.WebServiceTests > testSomething FAILED
    groovy.lang.MissingMethodException at WebServiceTests.groovy:12
au.org.ala.webapi.WebserviceListControllerTests > testSomething FAILED
    groovy.lang.MissingMethodException at WebserviceListControllerTests.groovy:12
au.org.ala.webapi.AppControllerSpec > Test the save action correctly persists an instance FAILED
    groovy.lang.MissingMethodException at AppControllerSpec.groovy:44
au.org.ala.webapi.AppControllerSpec > Test that the show action returns the correct model FAILED
    groovy.lang.MissingMethodException at AppControllerSpec.groovy:65
au.org.ala.webapi.AppControllerSpec > Test that the edit action returns the correct model FAILED
    groovy.lang.MissingMethodException at AppControllerSpec.groovy:81
au.org.ala.webapi.AppControllerSpec > Test the update action performs an update on a valid domain instance FAILED
    groovy.lang.MissingMethodException at AppControllerSpec.groovy:99
au.org.ala.webapi.AppControllerSpec > Test that the delete action deletes an instance if it exists FAILED
    groovy.lang.MissingMethodException at AppControllerSpec.groovy:131
au.org.ala.webapi.ExampleRunFailureSpec > Test validate with message[1] FAILED
    org.spockframework.runtime.SpockComparisonFailure at ExampleRunFailureSpec.groovy:45
au.org.ala.webapi.ExampleRunResponseSpec > Test validate with content type  is true FAILED
    org.spockframework.runtime.SpockComparisonFailure at ExampleRunResponseSpec.groovy:33
59 tests completed, 31 failed
ansell commented 4 years ago

It looks like the changes for most of these cases were to remove the test or comment them out. Some of them look like stub tests that were never implemented properly but not all of them. Would have been nice to have this in a Pull Request to review overall as it isn't easy to review them individually. If you think the test suite is complete at this point feel free to close it.

Rita-C commented 4 years ago

-The stub tests were generated for Grails 2, and did not work in Grails 3 so they were deleted. -Many controller test cases were not required anymore due to the adopting of "scaffolding".

Code changes for this ticket can be reviewed at https://github.com/AtlasOfLivingAustralia/webapi/compare/f21adf1...b8b4fe0