odk-x / tool-suite-X

ODK-X Tool Suite Project roadmaps, issue queue, release notes and wiki.
https://www.odk-x.org
Apache License 2.0
25 stars 43 forks source link

Fix Sync-Endpoint-Web-Ui Unit Tests #329

Open wbrunette opened 2 years ago

wbrunette commented 2 years ago

The unit tests should be revised to rely on "odk-rest-interface-2.1.8.jar" and NOT the historic aggregate-rest-interface jar

To test this you should delete the aggregate-rest-interface-2017-06-22.jar dependency.

NOTE: this issue is related to the development branch of the sync-endpoint-web-ui

WaltonG commented 2 years ago

@wbrunette I would like to work on this issue. I trust that it will give me an insight into the endpoint codebase.

wbrunette commented 2 years ago

@WaltonG I have assigned the issue to you. If you delete the jar the unit tests start to fail.

WaltonG commented 2 years ago

@wbrunette After removing the aggregate-rest-interface jar and running junit test the test fails on two classes. OdkUploadClientTest.java and TablesControllerAjaxTest.java. My thought is that this could be test driven development because the tested OdkUploadClient class has not been created and the tested methods in TablesControllerAjax have not been implemented. (they are marked ToDO). I am thinking of creating the UploadClient class and implementing the methods in TablesControllerAjax

wbrunette commented 2 years ago

Sounds like a good approach. Replace missing functionality and make it part of the test code seems like how I would approach it.

WaltonG commented 2 years ago

I just realised that junit gave me a false positive on passed tests. After running maven clean install, surefire reported additional test failures that were omitted by junit. This is a complex issue than I thought

sanyud24 commented 2 years ago

@wbrunette Can I please pick up this issue? It's relevant to the testing Outreachy project so it would give me more exposure to the current test suites. PS: I don't have any ToDo PRs, they are under-review.

sanyud24 commented 2 years ago

@wbrunette I can see the JARs have been updated in this https://github.com/odk-x/sync-endpoint-web-ui/pull/21 PR. But the tests are failing since their behavior hasn't been updated with the changing code:

  1. ODKUploadClient has been removed: https://github.com/odk-x/sync-endpoint-web-ui/commit/1d6dd8a30f9685123296bff533f796ba13302e08 (existed 5 years ago)
  2. TablesControllerAjaxTest: Jackson deserializer is used now, so I updated the JSONNode usages to proper class usages, but now it's failing since the behavior of the unit functions has changed.
WaltonG commented 2 years ago

@sanyud24 You may proceed with the issue

wbrunette commented 2 years ago

@WaltonG and @sanyud24 I have changed the issue to be assigned to @sanyud24