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

Investigate debugging junit test files

    Details

    • Type: Task
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      Situation: While creating new junit test cases using Netbeans 8.2 and JDK 1.8.0_251 or 1.8.0_191 on Mac could not Debug Test File. When test file (tried on GFFParserTest.java) was right-clicked > Debug Test File the test results report No tests executed and breakpoints are ignored. Can execute tests on module Core - Genometry (Data Models) by right-clicking and selecting test. This will run through the junit tests, however it does not allow for debugging.

      This was also tested on a separate linux system that was able to debug test files from other projects. However, attempting to debug test files in the IGB project did not work.

      Task: Investigate why the test files cannot be tested or debugged individually.

        Attachments

          Activity

          Hide
          cdias1 Chester Dias (Inactive) added a comment - - edited

          Nowlan Freese I did some digging into the issue and finally got the results that we were looking for.
          ISSUE:
          The debugging or a single test of a file was not possible before however when the whole project was tested the tests ran perfectly.
          tests were showing as running but nothing was shown in the test execution tab.
          Root Cause:
          I think this has something to do with the latest surefire plugin version.
          Solution:
          use version 2.22.2 in pom.xml

          <plugin>
                          <groupId>org.apache.maven.plugins</groupId>
                          <artifactId>maven-surefire-plugin</artifactId>
                          <version>2.22.2</version>
           </plugin>
          
          Show
          cdias1 Chester Dias (Inactive) added a comment - - edited Nowlan Freese I did some digging into the issue and finally got the results that we were looking for. ISSUE: The debugging or a single test of a file was not possible before however when the whole project was tested the tests ran perfectly. tests were showing as running but nothing was shown in the test execution tab. Root Cause: I think this has something to do with the latest surefire plugin version. Solution: use version 2.22.2 in pom.xml <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.22.2</version> </plugin>
          Hide
          ann.loraine Ann Loraine added a comment -

          Thanks Chester Dias !

          Show
          ann.loraine Ann Loraine added a comment - Thanks Chester Dias !
          Hide
          cdias1 Chester Dias (Inactive) added a comment -

          Note on test File names
          All file names have to be ending with *Test.java
          Example: GFFParserTest.java

          Further, as an extension to this, I suggest the use of a fixed version on the rest of the plugins and if possible on dependencies.
          The latest Version can have below issues.
          During testing, if the version is not specified, it will pick up the latest version, and if just before deployment a newer version appears in Nexus. The testing won't highlight the issues of the newer plugin/dependency that is used during deployment. This makes the test invalid.

          Issues like this have occurred before with the latest versions of plugins being unstable.

          Show
          cdias1 Chester Dias (Inactive) added a comment - Note on test File names All file names have to be ending with *Test.java Example: GFFParserTest.java Further, as an extension to this, I suggest the use of a fixed version on the rest of the plugins and if possible on dependencies. The latest Version can have below issues. During testing, if the version is not specified, it will pick up the latest version, and if just before deployment a newer version appears in Nexus. The testing won't highlight the issues of the newer plugin/dependency that is used during deployment. This makes the test invalid. Issues like this have occurred before with the latest versions of plugins being unstable.
          Hide
          nfreese Nowlan Freese added a comment -

          Changed the version of the surefire plugin to 2.22.2 within the igb project pom.

          Can now run tests on individual test files, and can run debugger.

          Chester Dias can you create a branch and submit your changes for a pull request?

          Thanks

          Show
          nfreese Nowlan Freese added a comment - Changed the version of the surefire plugin to 2.22.2 within the igb project pom. Can now run tests on individual test files, and can run debugger. Chester Dias can you create a branch and submit your changes for a pull request? Thanks
          Show
          cdias1 Chester Dias (Inactive) added a comment - PR: https://bitbucket.org/lorainelab/integrated-genome-browser/pull-requests/802/igbf-2416-added-surefire-plugin-version-to/diff
          Hide
          ann.loraine Ann Loraine added a comment -

          Merged.

          Show
          ann.loraine Ann Loraine added a comment - Merged.
          Hide
          nfreese Nowlan Freese added a comment -

          Pulled master. Tested by running tests on individual test files and setting break points with debugger. Working correctly.

          Closing issue.

          Show
          nfreese Nowlan Freese added a comment - Pulled master. Tested by running tests on individual test files and setting break points with debugger. Working correctly. Closing issue.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: