Unable to run all method in a test class

Issue #1179 resolved
Nunzio Capasso created an issue

Hello Scott,

has been a while since my last post but here i am again trying to be helpful :P.

Today i noticed this weird behavior that occurs when trying to run a test class.

Basically some method didn't get recognized by the test suite ( in my case 3 out of 47) .

I also tryed to run those methods by themselves and i got the result. I leave u here some pics and a log that i obtained using this filter:

com.illuminatedcloud.intellij.unittest.ApexUnitTestRunProcessHandler com.illuminatedcloud.util.VariableLengthPollingInterval

Kind regards, Nunzio Capasso.

Comments (13)

  1. Scott Wells repo owner

    Sorry for the issue, Nunzio, and thanks for providing the log. I see the following:

    2018-11-29 17:24:56,728 [1697218]  DEBUG - .ApexUnitTestRunProcessHandler -   Filtering by the configured test methods based on simple class name ITA_IFM_UTL035_Spostamenti_Test: { test_receiveSAPQuoteDataNew2 }. 
    2018-11-29 17:24:56,728 [1697218]  DEBUG - .ApexUnitTestRunProcessHandler -   testGetClasseContatoreByPower is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_selector is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_invokeCompatibilityMatrix is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_getWSRequest is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_BPMCalloutService is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_asyncInvokeDocumentale is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_asyncInvokeDocumentale_RI210 is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_asyncInvokeDocumentale_CHblank is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_finalizeR2DAnnulment is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   createActivity_TestP is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_receiveSAPDataKO is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_asyncHandleIntegrationSubmit is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_receiveSAPQuoteData is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   testreceiveFlussoIncassiData is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_handleCaseItemClosure is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   closePositiveServiceRequests_Test is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   closeNegativeServiceRequests_Test is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   closeNegativeServiceRequests_Test_2 is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   testretrySendingCall is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_receiveSAPSDStornoData is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_performCascadeAnnulment is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_GetRegimeShort is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_getAddebitoVoci is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_GetPreventivoComm_Fattura is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_getIdentificativoComparto is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_getCurrentUserPermissionSets is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_cancelIntegrationLogs is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_InboundR2DWebServiceHandlerHelper2 is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_OutboundR2DWebServiceHandlerHelper is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_BPMRequestFactory is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_SetIntegrationStatusAndScartoPhase is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_SetIntegrationStatusAndScartoPhase_Anticipo is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_SetIntegrationStatusAndScartoPhase_Fatt is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_asyncInvokeDocumentaleAnnullamentoAutomatico is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_receiveSAPSDInvoiceData is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_receiveSAPSDInvoiceData_requestOK is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_receiveSAPSDInvoiceDataAnticipo is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_handleCaseItemAnnulment is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_CallSollecitatore is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_commitRequests is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_PhaseManagerActions is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_setConfItemExtDocumentaleValues is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   test_formattaImporto is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]  DEBUG - .ApexUnitTestRunProcessHandler -   quote2order_Test is not a configured test method in test class ITA_IFM_UTL035_Spostamenti_Test. 
    2018-11-29 17:24:56,729 [1697219]   WARN - .ApexUnitTestRunProcessHandler - All test methods for ITA_IFM_UTL035_Spostamenti_Test were filtered. No tests will be run. 
    

    Do you happen to have another copy of the class ITA_IFM_UTL035_Spostamenti_Test in your project somewhere, for example, generated into your offline symbol table? If so, that could be causing the issue, and regenerating your OST would resolve it. Let's start there and see if that helps. If not, we can try a few other things.

  2. Nunzio Capasso reporter

    You are probably right and I will start by saying that by removing all the other classes with the same name the test run just fine. Honestly i don't know how i didn't thought about it before but lemme explain my workflow.

    I often have to work with multiple ORG's and pretty much all of them share the same metadata's for example:

    ORG1 --> development

    ORG2--> merge with other developments

    ORG3--> functional testing

    ect...

    So to obtain quick access to all of them (to quick compare\merge\checking) i created an empty project with a module and an associated SF connection for each ORG. I leave u here a screenshot of my project structure : http://bit.ly/2FMmO4j

    I am using IC in an unsupported way? Do i have to create a project for each connection\ORG?

    PS: before arriving to this conclusion ( and altering my project structure) i tried to rebuild the cache and indices and delete the offline tables but without success.

  3. Scott Wells repo owner

    That explains it. I wouldn't say that you're using IC in an unsupported way, but you are using it in a way that will almost certainly kick off any number of bugs due to the ambiguity around classes with the same name in the same project scope. Technically IC should be limiting the way it resolves types and other symbols to as narrow a scope as possible, but there are some situations where it needs to widen the scope to scan all modules in the project. As a result, when it searches for a class by name, it's finding more than one and isn't sure which to use, so it's probably just quietly skipping the operation ("silently" meaning that it likely logs the situation but doesn't tell the user). Like I said, it's technically a bug, but it's a bug you wouldn't hit if types were unique within the scope of a project.

    The way I handle the same situation is to have a single project against the source code, and I use a combination of version control branches and connection configuration--most often checked into version control so that it switches with the branches--so that I can branch/merge/cherry-pick/etc. across organization-specific branches as necessary, then use IC to deploy to the connection configured for that branch.

    I'd recommend you take a look at the following documentation on how to manage IC config files in version control, then let me know if you have additional questions about how you might set this up:

    http://www.illuminatedcloud.com/support/faq#ProjectVersionControl

  4. Nunzio Capasso reporter

    Thx Scott this explains everything and i will definitely have to change my project structure .But what is not clear to me is that part :

    "version control branches and connection configuration--most often checked into version control so that it switches with the branches--so that I can branch/merge/cherry-pick/etc. across organization-specific branches as necessary, then use IC to deploy to the connection configured for that branch."

    Do this solution require the whole dev team to have some kinda of online version control (like bitBucket) ? (if this is the case , unfortunately we can't adopt it due to the large scale project that we are involved in). Have u got a guide that i can follow?

    Thanks,

    Nunzio.

  5. Scott Wells repo owner

    Nunzio, if your team isn't using version control then that approach may not work for you. You could set up local version control using something like Git and be able to switch branches as described. The other primary option would be, as you stated previously, having a distinct project for each connection and then switch projects instead of branches.

  6. Scott Wells repo owner

    Issue tracker grooming. If this is still an issue, please feel free to reopen, ideally with a concrete reproduction scenario.

  7. Log in to comment