#36 Multi-cycle TestSuite not able to finish

v1.1.0.0
closed
aliazzz
None
2020-05-04
2020-04-26
jtebokkel
No
  1. Bug Present as of this commit: https://forge.codesys.com/svn/prj,cfunit,code@362

When running tests that take multiple cycles to complete the test runner stops early. If there is more than one test suite in the project. For instance i have an SQL block I'm testing that takes several calls before it returns results.

Tracked down the source of the bug to FB_CfUnitRunner.RunTestSuiteTests see the attached diff for the fix.

Discussion

  • aliazzz

    aliazzz - 2020-04-26
    • Attachments has changed:

    Diff:

    --- old
    +++ new
    @@ -1 +0,0 @@
    -cfunit.FB_CfUnitRunner.RunTestSuiteTests.diff (702 Bytes; application/octet-stream)
    
     
  • aliazzz

    aliazzz - 2020-04-26

    f*ck... I pressed wrong button!
    Would you be so kind and re-up the diff?

    Thank you so much

     
  • jtebokkel

    jtebokkel - 2020-04-26
    --- cfunit.FB_CfUnitRunner.RunTestSuiteTests_org.pou    2020-04-25 18:04:01.831067800 -0700
    +++ cfunit.FB_CfUnitRunner.RunTestSuiteTests_v1.pou 2020-04-25 18:04:46.702884200 -0700
    @@ -3,6 +3,8 @@
         IF GVL_CfUnit.NumberOfInitializedTestSuites = 0 THEN
             AllTestSuitesFinished := TRUE;
         ELSIF GVL_CfUnit.NumberOfInitializedTestSuites > 0 THEN
    +        // Reset NumberOfTestSuitesFinished for multi-cycle tests
    +   NumberOfTestSuitesFinished := 0;
             FOR Counter := 1 TO GVL_CfUnit.NumberOfInitializedTestSuites BY 1 DO
                 IF GVL_CfUnit.TestSuiteAddresses[Counter]^.AreAllTestsFinished() THEN
                     NumberOfTestSuitesFinished := NumberOfTestSuitesFinished + 1;
    
     
  • aliazzz

    aliazzz - 2020-05-01

    Hi,

    I'd like to know in which version of CfUnit you have found this bug?
    It seems the RC candidate for v1.1.0.0

     
  • aliazzz

    aliazzz - 2020-05-01
    • assigned_to: jtebokkel
     
  • aliazzz

    aliazzz - 2020-05-01
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,4 @@
    -Bug Present as of this commit: https://forge.codesys.com/svn/prj,cfunit,code@362
    +1. Bug Present as of this commit: https://forge.codesys.com/svn/prj,cfunit,code@362
    
     When running tests that take multiple cycles to complete the test runner stops early. If there is more than one test suite in the project. For instance i have an SQL block I'm testing that takes several calls before it returns results.
    
    • Milestone: v1.0 --> v1.1.0.0
     
  • jtebokkel

    jtebokkel - 2020-05-01

    this bug was both in the trunk version of commit 362 and in your branch at that same commit.

     
  • aliazzz

    aliazzz - 2020-05-01

    Okay!

    Would you be so kind and tell me how I can reproduce your issue by using for instance the verifier project or send me some example code in which the issue resides?

    Thank you for your understanding.

    Aliazzz

     
  • aliazzz

    aliazzz - 2020-05-01

    Hi,

    After some studying on the archive that you sent I found that the code is an older code version with some old flaws.
    So to mitigate the problem is easy;

    DELETE your current V1.1.0.2 library from your system
    Install the following attached project archive.

    It contains a fresh v1.0.9.9 CfUnit,
    A special version of the verifier with the Multi Cycle Example integrated.
    The test result should yield:

    | ======================================
    | 
    | ==========TEST RESULTS EXPORTED===========
    I ======================================
    | Failed tests: 112
    | Successful tests: 139
    | Tests: 251
    | Test suites: 24
    | ==========TESTS FINISHED RUNNING==========
    

    I am sorry for any inconvience this might have caused...

    With kind regards,

    Aliazzz

     
  • aliazzz

    aliazzz - 2020-05-01
    • status: open --> accepted
    • assigned_to: jtebokkel --> aliazzz
     
  • aliazzz

    aliazzz - 2020-05-01
    • status: accepted --> pending
     
  • aliazzz

    aliazzz - 2020-05-04

    The problem has been resolved in the daily build

     
  • aliazzz

    aliazzz - 2020-05-04
    • status: pending --> closed
     

Log in to post a comment.