[test] Allow functional test cases to be skipped #10053

pull jnewbery wants to merge 2 commits into bitcoin:master from jnewbery:skiptests changing 3 files +39 −14
  1. jnewbery commented at 3:13 PM on March 22, 2017: member

    Currently, functional test cases can either pass or fail. There are occasions when it is helpful to skip tests, for example if the system they are running on does not meet the requirements for the test. The rest of the test suite can run without being marked as a failure.

    This PR adds framework for tests to skip if their requirements aren't met.

    This PR also updates rpcbind_test.py to skip if it detects that the system does not meet requirements (linux, ipv4 non-loopback address, ipv6 support).

    This is required to have travis nightly cron jobs run without failure #10052.

  2. Allow test cases to be skipped
    Currently, functional test cases can either pass or fail. There are
    occasions when it is helpful to skip tests, for example if the
    system they are running on does not meet the requirements for the test.
    The rest of the test suite can run without being marked as a failure.
    
    This commit adds framework for tests to skip if their requirements
    aren't met.
    232b6665bc
  3. jnewbery renamed this:
    Allow functional test cases to be skipped
    [test] Allow functional test cases to be skipped
    on Mar 22, 2017
  4. MarcoFalke commented at 7:02 PM on March 22, 2017: member

    utACK 0a6781dbc728abdd294fc199a6522caf592cbe56

    On Wed, Mar 22, 2017 at 4:14 PM, John Newbery notifications@github.com wrote:

    Currently, functional test cases can either pass or fail. There are occasions when it is helpful to skip tests, for example if the system they are running on does not meet the requirements for the test. The rest of the test suite can run without being marked as a failure.

    This PR adds framework for tests to skip if their requirements aren't met.

    This PR also updates rpcbind_test.py to skip if it detects that the system does not meet requirements (linux, ipv4 non-loopback address, ipv6 support).

    This is required to have travis nightly cron jobs run without failure #10052.


    You can view, comment on, or merge this pull request online at:

    #10053

    Commit Summary

    Allow test cases to be skipped Skip rpcbind_test if OS/network requirements are not met.

    File Changes

    M test/functional/rpcbind_test.py (18) M test/functional/test_framework/test_framework.py (9) M test/functional/test_runner.py (26)

    Patch Links:

    #10053.patch #10053.diff

    — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

  5. fanquake added the label Tests on Mar 22, 2017
  6. fanquake commented at 12:04 AM on March 23, 2017: member

    Tested 0a6781d on OS X (the test cannot run). Current behaviour:

    rpcbind_test.py:
    2017-03-23 00:01:56.990000 TestFramework (INFO): Initializing test directory /var/folders/rb/jqqd25w926s5429rf58_zsv00000gn/T/test_guv59zt/18
    2017-03-23 00:01:56.990000 TestFramework (ERROR): Assertion failed
    Traceback (most recent call last):
      File "/Users/xxx/Github/bitcoin/test/functional/test_framework/test_framework.py", line 148, in main
        self.run_test()
      File "/Users/xxx/github/bitcoin/test/functional/rpcbind_test.py", line 55, in run_test
        assert(sys.platform.startswith('linux'))
    AssertionError
    2017-03-23 00:01:56.991000 TestFramework (INFO): Stopping nodes
    
    stderr:
    Traceback (most recent call last):
      File "/Users/xxx/github/bitcoin/test/functional/rpcbind_test.py", line 98, in <module>
        RPCBindTest().main()
      File "/Users/xxx/Github/bitcoin/test/functional/test_framework/test_framework.py", line 163, in main
        stop_nodes(self.nodes)
      File "/Users/xxx/Github/bitcoin/test/functional/test_framework/util.py", line 380, in stop_nodes
        for i, node in enumerate(nodes):
    TypeError: 'NoneType' object is not iterable
    
    Pass: False, Duration: 0 s
    
    TEST            | PASSED | DURATION
    
    rpcbind_test.py | False  | 0 s
    
    ALL             | False  | 0 s (accumulated)
    
    Runtime: 0 s
    

    This PR:

    bash-3.2$ test/functional/test_runner.py rpcbind_test
    
    rpcbind_test.py:
    2017-03-22 23:59:28.910000 TestFramework (INFO): Initializing test directory /var/folders/rb/jqqd25w926s5429rf58_zsv00000gn/T/testchxojvbm/69
    2017-03-22 23:59:28.911000 TestFramework (WARNING): This test can only be run on linux. Skipping test.
    
    Status: Skipped, Duration: 0 s
    
    TEST            | PASSED  | DURATION
    
    rpcbind_test.py | Skipped | 0 s
    
    ALL             | True    | 0 s (accumulated)
    
    Runtime: 0 s
    
  7. in test/functional/test_runner.py:251 in 0a6781dbc7 outdated
     247 | @@ -245,20 +248,20 @@ def run_tests(test_list, src_dir, build_dir, exeext, jobs=1, enable_coverage=Fal
     248 |      job_queue = TestHandler(jobs, tests_dir, test_list, flags)
     249 |  
     250 |      max_len_name = len(max(test_list, key=len))
     251 | -    results = BOLD[1] + "%s | %s | %s\n\n" % ("TEST".ljust(max_len_name), "PASSED", "DURATION") + BOLD[0]
     252 | +    results = BOLD[1] + "%s | %s | %s\n\n" % ("TEST".ljust(max_len_name), "PASSED ", "DURATION") + BOLD[0]
    


    MarcoFalke commented at 11:00 AM on March 23, 2017:
    s/PASSED /STATUS /
    

    jnewbery commented at 4:20 PM on March 23, 2017:

    Agree. Done.

  8. MarcoFalke commented at 6:10 PM on March 23, 2017: member

    Please squash the fixup.

  9. Skip rpcbind_test if OS/network requirements are not met. 0c1ade6a4b
  10. jnewbery force-pushed on Mar 24, 2017
  11. MarcoFalke merged this on Mar 24, 2017
  12. MarcoFalke closed this on Mar 24, 2017

  13. MarcoFalke referenced this in commit ca209230c8 on Mar 24, 2017
  14. PastaPastaPasta referenced this in commit a716568687 on Mar 14, 2019
  15. PastaPastaPasta referenced this in commit d88f99a407 on May 20, 2019
  16. PastaPastaPasta referenced this in commit ae05068c5d on May 21, 2019
  17. PastaPastaPasta referenced this in commit 6d6cb07aee on May 21, 2019
  18. barrystyle referenced this in commit b5d7030409 on Jan 22, 2020
  19. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-15 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me