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

Modify IGB test code to not rely on internet connection

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • 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

            nfreese Nowlan Freese made changes -
            Resolution Done [ 10000 ]
            Status Post-merge Testing In Progress [ 10003 ] Closed [ 6 ]
            nfreese Nowlan Freese made changes -
            Assignee Jaya Sravani Sirigineedi [ jsirigin ]
            Hide
            nfreese Nowlan Freese added a comment -

            I'm able to build the main branch locally without an internet connection. There are UnknownHostException for the tests that need an internet connection, but they do not affect the build.

            Closing ticket.

            Show
            nfreese Nowlan Freese added a comment - I'm able to build the main branch locally without an internet connection. There are UnknownHostException for the tests that need an internet connection, but they do not affect the build. Closing ticket.
            nfreese Nowlan Freese made changes -
            Status Merged Needs Testing [ 10002 ] Post-merge Testing In Progress [ 10003 ]
            ann.loraine Ann Loraine made changes -
            Status Reviewing Pull Request [ 10303 ] Merged Needs Testing [ 10002 ]
            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.
            ann.loraine Ann Loraine made changes -
            Status Pull Request Submitted [ 10101 ] Reviewing Pull Request [ 10303 ]
            nfreese Nowlan Freese made changes -
            Status Ready for Pull Request [ 10304 ] Pull Request Submitted [ 10101 ]
            nfreese Nowlan Freese made changes -
            Assignee Jaya Sravani Sirigineedi [ jsirigin ]
            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
            ann.loraine Ann Loraine made changes -
            Rank Ranked higher
            ann.loraine Ann Loraine made changes -
            Sprint Spring 7, Spring 8 [ 191, 192 ] Spring 7, Spring 8, Spring 9 [ 191, 192, 193 ]
            nfreese Nowlan Freese made changes -
            Status First Level Review in Progress [ 10301 ] Ready for Pull Request [ 10304 ]
            nfreese Nowlan Freese made changes -
            Assignee Nowlan Freese [ nfreese ] Jaya Sravani Sirigineedi [ jsirigin ]
            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.
            nfreese Nowlan Freese made changes -
            Assignee Nowlan Freese [ nfreese ]
            nfreese Nowlan Freese made changes -
            Status Needs 1st Level Review [ 10005 ] First Level Review in Progress [ 10301 ]
            jsirigin Jaya Sravani Sirigineedi made changes -
            Status In Progress [ 3 ] Needs 1st Level Review [ 10005 ]
            jsirigin Jaya Sravani Sirigineedi made changes -
            Assignee Jaya Sravani Sirigineedi [ jsirigin ]
            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
            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.
            ann.loraine Ann Loraine made changes -
            Rank Ranked higher
            ann.loraine Ann Loraine made changes -
            Sprint Spring 7 [ 191 ] Spring 7, Spring 8 [ 191, 192 ]
            nfreese Nowlan Freese made changes -
            Sprint Spring 8 [ 192 ] Spring 7 [ 191 ]
            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.
            jsirigin Jaya Sravani Sirigineedi made changes -
            Status To-Do [ 10305 ] In Progress [ 3 ]
            nfreese Nowlan Freese made changes -
            Sprint Spring 7 [ 191 ] Spring 8 [ 192 ]
            nfreese Nowlan Freese made changes -
            Assignee Jaya Sravani Sirigineedi [ jsirigin ]
            nfreese Nowlan Freese made changes -
            Sprint Spring 6 [ 190 ] Spring 7 [ 191 ]
            nfreese Nowlan Freese made changes -
            Link This issue relates to IGBF-3626 [ IGBF-3626 ]
            nfreese Nowlan Freese made changes -
            Field Original Value New Value
            Epic Link IGBF-1531 [ 17617 ]
            nfreese Nowlan Freese created issue -

              People

              • Assignee:
                jsirigin Jaya Sravani Sirigineedi
                Reporter:
                nfreese Nowlan Freese
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: