Uploaded image for project: 'IGB'
  1. IGB
  2. IGBF-3641

Modify IGB test code to not rely on internet connection

    Details

    • Type: Improvement
    • Status: Merged Needs Testing (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      Situation: IGB test code currently has several tests that connect to various online services, such as UCSC DAS. If these services are down it causes the IGB build to fail, including for bitbucket pipelines.

      Task: Modify the IGB test code to either mock the expected results from the online service, and/or if the online service is unavailable the test throws a warning that the service is down, but does not stop the build.

      See IGBF-3626 for an example of how this should be done.

        Attachments

          Issue Links

            Activity

            Hide
            jsirigin Jaya Sravani Sirigineedi added a comment -

            Changing test cases code in the DAS module and mocking the APIs. Rewriting code for the DasDataProviderTest file is done, working on DasServerInfoTest now.

            Show
            jsirigin Jaya Sravani Sirigineedi added a comment - Changing test cases code in the DAS module and mocking the APIs. Rewriting code for the DasDataProviderTest file is done, working on DasServerInfoTest now.
            Hide
            jsirigin Jaya Sravani Sirigineedi added a comment -

            Completed working on changing the test cases in DAS module, added few more test cases too. Checked other modules as well for any third party API calls, found this class LoaderTest which is actually checking whether the APIs are working or not so I didn't mock them instead I changed the code to just leave a warning message incase the API call fails instead of failing the test cases which might effect the build. Working on the last module quickload for any API call testing.

            Show
            jsirigin Jaya Sravani Sirigineedi added a comment - Completed working on changing the test cases in DAS module, added few more test cases too. Checked other modules as well for any third party API calls, found this class LoaderTest which is actually checking whether the APIs are working or not so I didn't mock them instead I changed the code to just leave a warning message incase the API call fails instead of failing the test cases which might effect the build. Working on the last module quickload for any API call testing.
            Hide
            jsirigin Jaya Sravani Sirigineedi added a comment - - edited

            Changed the testcases for all modules, there is only one method in the DAS module, checkValidAndSetUrl for which mocking is difficult, have to change the way the code is written in order to mock it but it doesn't lead to any test case failure even if it's not mocked it just logs an error message in case the server is not responding. As discussed with Nowlan Freese, we won't be mocking this one apart from that everything else has changed. Updated code is available at the branch: https://bitbucket.org/jaya-sravani/integrated-genome-browser/branch/IGBF-3641. Please review and let me know if there are any issues.
            Steps to test:
            Clone the branch in your local and build the application. The application should be successfully built and there shouldn't be any errors
            Note: RestApiDataProviderTest will fail on windows because of the file path error, which will be resolved by Kaushik Gopu commit along with this issue https://jira.bioviz.org/browse/IGBF-3640

            Show
            jsirigin Jaya Sravani Sirigineedi added a comment - - edited Changed the testcases for all modules, there is only one method in the DAS module, checkValidAndSetUrl for which mocking is difficult, have to change the way the code is written in order to mock it but it doesn't lead to any test case failure even if it's not mocked it just logs an error message in case the server is not responding. As discussed with Nowlan Freese , we won't be mocking this one apart from that everything else has changed. Updated code is available at the branch: https://bitbucket.org/jaya-sravani/integrated-genome-browser/branch/IGBF-3641 . Please review and let me know if there are any issues. Steps to test: Clone the branch in your local and build the application. The application should be successfully built and there shouldn't be any errors Note: RestApiDataProviderTest will fail on windows because of the file path error, which will be resolved by Kaushik Gopu commit along with this issue https://jira.bioviz.org/browse/IGBF-3640
            Hide
            nfreese Nowlan Freese added a comment -

            Tested the following files offline and online. Builds were still successful when offline.

            • DasServerInfoTest
            • DasDataProviderTest
            • DASFeatureParserTest
            • LoaderTest
            • RemoteBlastNCBITest

            Ready for pull request.

            Show
            nfreese Nowlan Freese added a comment - Tested the following files offline and online. Builds were still successful when offline. DasServerInfoTest DasDataProviderTest DASFeatureParserTest LoaderTest RemoteBlastNCBITest Ready for pull request.
            Hide
            nfreese Nowlan Freese added a comment -

            I pushed Sravani's branch to my repo so we could run bitbucket pipelines (she is out of minutes). The build was good, so I have created a pull request.

            PR: https://bitbucket.org/lorainelab/integrated-genome-browser/pull-requests/1003

            Show
            nfreese Nowlan Freese added a comment - I pushed Sravani's branch to my repo so we could run bitbucket pipelines (she is out of minutes). The build was good, so I have created a pull request. PR: https://bitbucket.org/lorainelab/integrated-genome-browser/pull-requests/1003
            Hide
            ann.loraine Ann Loraine added a comment - - edited

            PR is merged. Main branch installers are built and deployed to BioViz.org as "early access" IGB.

            Show
            ann.loraine Ann Loraine added a comment - - edited PR is merged. Main branch installers are built and deployed to BioViz.org as "early access" IGB.

              People

              • Assignee:
                Unassigned
                Reporter:
                nfreese Nowlan Freese
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: