The Welkin Suite Forum

Test classes created in TWS appear as normal classes in test runs



Test classes created in TWS appear as normal classes in test runs

  • Please log in to reply

#1
windows version welkinsuite

joachim.roesecke

    Posted 28 Jan 2018 and edited 31 Jan 2018

    Hi

    I have identified a peculiar behaviour. This is what I did:

    1. Create an apex class in TWS.
    2. After creation, add the "@isTest" annotation making it a test class.

    When created this way, the created test class always appears in the code coverage window with 0% coverage. While the coverage is correct, this influences the overall code coverage in the Salesforce org (must be 75% on average). Even when I look in the developer console, this class appears as a normal class with no coverage. I believe, something is happening during the creation of the class which makes it impossible for Salesforce to exclude it from the code coverage.

    Cheers, Joachim



    2 replies to this topic

    #2

    joachim.roesecke

      Posted 28 Jan 2018

      Never mind. I just found this known issue: https://success.salesforce.com/issues_view?id=a1p3A0000001BaOQAU



      #3

      vlgubanovich

        Posted 31 Jan 2018

        Hi Joachim,


        Thank you for getting to us with this question. It's helpful for us to dig into such cases and understand them as well :)

        I've just rechecked a couple scenarios and it seems that if you'll create a class with @isTest annotation right from the beginning - this class won't appear in the code coverage results at all. I'm not sure if this will work when you'll create a new class in the SF UI and will add @isTest immediately in the editor, however when you create a class in the IDE using the "Unit Test" template - all's good.

        I understand that you already have some (many) classes with such situation, but this might help you for your future test classes.


        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