The Welkin Suite Forum

Unit test debugging exiting when there is a test with a caught exception



Unit test debugging exiting when there is a test with a caught exception

  • Please log in to reply

#1
windows version welkinsuite

donnie745

    Posted 20 Sep 2017

    Hi I've just installed a trial version of The Welkin Suite and I've been having a look at the debugging functionality for unit tests. I have a unit test class including tests that check for exceptions being thrown from particular methods (the exceptions thrown are of our own in-house Exception types that we have subclassed and deployed to our environment). I am wanting to debug one of our other test methods that don't involve exceptions being thrown and unfortunately it seems in order to debug unit tests the debugging session has to run all unit tests in the test class.

    Before I get to hit my breakpoints in the specific test I want to debug, a dialog appears and the code breaks at the throwing of the exception within one of the other tests in the test class. Despite the unit tests catching the exception thrown the debug session exits on continuing (even pressing F10 to step to next line the debug session will progress to the catch clause but then exit when pressing F10 again to go into the catch clause block). This means I need to comment out a block of unit tests in order to successfully hit my breakpoints in the test I'm interested in debugging which isn't ideal (it would be nice to be able to debug a single unit test similar to how you can execute a single unit test within a test class, I did see another bug from someone with a title that looks like it's raised this point but if you'd like me to raise a separate issue for this I will as it would be very handy).




    6 replies to this topic

    #2

    donnie745

      Posted 20 Sep 2017

      Hadn't realised the debugging runs whatever test the cursor is currently on, sorry I'm new to this! I'd left the cursor on one of the test methods that was testing the exception throwing hence why I was never hitting the breakpoint I'd set in the other test method! Happy for this issue to be closed although it would be nice if the right-click context menu by each unit test declaration would add "Debug test class" & "Debug test method" menu options to the existing "Execute test class" & "Execute test method" menu options.



      #3

      vlgubanovich

        Posted 21 Sep 2017

        Hi Donnie,

        We're glad that you've got it working as expected and hope there's no bugs in your code :)

        Regarding your suggestion to add "Debug test class" command to the context menu - to be honest I'm not sure about the use cases when it might be handy. Can you please share some use cases that you might see for such command?


        Thank you,

        Vladimir


        Vladimir Gubanovich
        Head of Product
         
        The Welkin Suite
        skype id: vladimir.gubanovich
        e-mail: vladimir.gubanovich@welkinsuite.com


        #4

        donnie745

          Posted 21 Sep 2017

          Hi Vladimar,

          I guess my last comment regarding adding the debugging menu items to the pop-up context menus appearing when right-clicking on the hexagons by the test method signatures was more concerned with having the "Debug test method" option available. I agree adding a "Debug test class" is not really that necessary.

          Now that I've had more time using the UI it's fine running the debug test method menu option using the top menu bar with the cursor within the test method or using the right mouse click menu option when right clicking on a line of code within the method. I just feel it would be more intuitive to have a "Debug test method" menu option within the hexagon right click context menu alongside the "Execute..." menu options.

          Another option that would be handy would be to add an "Execute test methods..." menu option which would bring up a dialog with a checkbox list of the test methods in the class where you can select a number of particular tests that you'd like to execute.

           

          Cheers,

          Donnie



          #5

          vlgubanovich

            Posted 21 Sep 2017

            Hi Donnie,

            Agree about the "Debug test method" option - fits nicely to that menu:)

            And also it seems that the option the "Execute test methods..." makes sense and might be handy in some certain cases with huge test classes. 

            We'll certainly add it to our backlog. And we'll think if it would be better to implement a new selection popup for this puprose or it'll be better to open the "Run tests" wizard with focus on the selected test class, so it'll be possible to check methods there.

            Thank you for sharing your ideas - it's great to hear them, and even better feeling is when we implement those ideas:) 


            Best regards,

            Vladimir


            Vladimir Gubanovich
            Head of Product
             
            The Welkin Suite
            skype id: vladimir.gubanovich
            e-mail: vladimir.gubanovich@welkinsuite.com


            #6

            donald.macleod

              Posted 22 Sep 2017

              Hi Vladimir,

              I hadn't spotted the "Run tests" wizard with the filtering, nice:-) That goes a long way to resolving my initial gripe as I was just going through runs involving executing a single test method at a time or executing all the methods in my test class prior to seeing this wizard. Still getting to grips with things as you can see:-)


              Cheers,

              Donnie



              #7

              vlgubanovich

                Posted 22 Sep 2017

                Hi Donnie,


                That's always nice to find something new :)

                We've tried to compile a set of very short but helpful videos in the Getting Started section - it should appear each time you start the IDE + you can also access it from the main menu Help -> Getting Started. I believe you'll also find something new and interesting there!



                Best regards,

                Vladimir


                Vladimir Gubanovich
                Head of Product
                 
                The Welkin Suite
                skype id: vladimir.gubanovich
                e-mail: vladimir.gubanovich@welkinsuite.com





                Boost Your Productivity. Get Started Today

                Try Free Trial