Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. QA Tools
  3. Squish
  4. (squish-python) squishrunner returns zero (0) exit code when using --retry 1 even if there are fatal errors
Forum Updated to NodeBB v4.3 + New Features

(squish-python) squishrunner returns zero (0) exit code when using --retry 1 even if there are fatal errors

Scheduled Pinned Locked Moved Unsolved Squish
3 Posts 2 Posters 720 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sawjan
    wrote on 24 Oct 2024, 05:06 last edited by
    #1

    Steps to reproduce:

    1. Install python urllib3 module: pip install urllib3==2.2.3
    2. Use the following code in the squish test script (this will cause fatal error)
      import urllib
      
      urllib.request.urlretrieve(<some-url>)
      
    3. Run the squish tests:
      squishrunner --testsuite <path-to-suite> --retry 1 --reportgen stdout --exitCodeOnFail 1
      

    Fatal error:

    START     	Start 'gui'                   	Test 'gui' started
    START_TEST_CASE	Start 'tst_activity'          	Test 'tst_activity' started (tst_activity)
    FATAL     	/drone/src/test/gui/shared/scripts/helpers/SyncHelper.py:22: Evaluation error	AttributeError: module 'urllib' has no attribute 'request'
    END_TEST_CASE	End 'tst_activity'            	End of test 'tst_activity'
    END       	End 'gui'                     	End of test 'gui'
    *******************************************************
    Summary:
    Number of Test Cases:	   1
    Number of Tests:	   0
    Number of Errors:	   0
    Number of Fatals:	   1
    Number of Fails:	   0
    Number of Passes:	   0
    Number of Expected Fails:	   0
    Number of Unexpected Passes:	   0
    Number of Warnings:	   0
    *******************************************************
    

    Check exit code:

    > echo $?
    0
    

    The exit code should be non-zero in terms of errors

    Note: If I remove --retry 1 option and run the tests again then the exit code will be 1

    Squish details:

    • Squish version: 7.2.1
    • Built Qt version: 6.6.x
    J 1 Reply Last reply 24 Oct 2024, 06:24
    0
    • S Sawjan
      24 Oct 2024, 05:06

      Steps to reproduce:

      1. Install python urllib3 module: pip install urllib3==2.2.3
      2. Use the following code in the squish test script (this will cause fatal error)
        import urllib
        
        urllib.request.urlretrieve(<some-url>)
        
      3. Run the squish tests:
        squishrunner --testsuite <path-to-suite> --retry 1 --reportgen stdout --exitCodeOnFail 1
        

      Fatal error:

      START     	Start 'gui'                   	Test 'gui' started
      START_TEST_CASE	Start 'tst_activity'          	Test 'tst_activity' started (tst_activity)
      FATAL     	/drone/src/test/gui/shared/scripts/helpers/SyncHelper.py:22: Evaluation error	AttributeError: module 'urllib' has no attribute 'request'
      END_TEST_CASE	End 'tst_activity'            	End of test 'tst_activity'
      END       	End 'gui'                     	End of test 'gui'
      *******************************************************
      Summary:
      Number of Test Cases:	   1
      Number of Tests:	   0
      Number of Errors:	   0
      Number of Fatals:	   1
      Number of Fails:	   0
      Number of Passes:	   0
      Number of Expected Fails:	   0
      Number of Unexpected Passes:	   0
      Number of Warnings:	   0
      *******************************************************
      

      Check exit code:

      > echo $?
      0
      

      The exit code should be non-zero in terms of errors

      Note: If I remove --retry 1 option and run the tests again then the exit code will be 1

      Squish details:

      • Squish version: 7.2.1
      • Built Qt version: 6.6.x
      J Online
      J Online
      jsulm
      Lifetime Qt Champion
      wrote on 24 Oct 2024, 06:24 last edited by
      #2

      @Sawjan said in (squish-python) squishrunner returns zero (0) exit code when using --retry 1 even if there are fatal errors:

      urllib.request.urlretrieve(<some-url>)

      Pay attention to the error message you get.
      Replace it with:

      import urllib.request
      

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Sawjan
        wrote on 28 Oct 2024, 07:11 last edited by
        #3

        Yes, import urllib.request is the correct one. But I used import urllib just to reproduce the fatal error while running the squish test. urllib is not the concern of this topic. I want to discuss the exit code of squishrunner with --retry 1 whenever there is a fatal error. I would expect the non-zero exit code but it returns 0.

        1 Reply Last reply
        0

        1/3

        24 Oct 2024, 05:06

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved