test: Always define the raii_event_tests test suite #16564

pull candrews wants to merge 1 commits into bitcoin:master from candrews:patch-1 changing 1 files +13 −6
  1. candrews commented at 3:38 pm on August 7, 2019: contributor

    The test suite must always be defined (even when EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED is not defined) so that the test harness doesn’t fail due to not being able to find the raii_event_tests test.

    This improves upon 95f97f4 actually fixing https://github.com/bitcoin/bitcoin/issues/9493

  2. kallewoof commented at 3:54 pm on August 7, 2019: member

    Don’t make pull requests into existing releases, make them into master.

    Edit: the maintainers pull things into the tagged release versions as appropriate. Pull requests basically always go into master, unless they are specific to some release. Yours seems like a generic fix, although I recognize the gentoo downstream issue.

  3. candrews force-pushed on Aug 7, 2019
  4. candrews force-pushed on Aug 7, 2019
  5. candrews changed the base branch on Aug 7, 2019
  6. candrews commented at 4:32 pm on August 7, 2019: contributor

    Don’t make pull requests into existing releases, make them into master.

    I’ve rebased this on master, thank you very much in advance

  7. MarcoFalke renamed this:
    Always define the raii_event_tests test suite
    test: Always define the raii_event_tests test suite
    on Aug 7, 2019
  8. MarcoFalke commented at 4:48 pm on August 7, 2019: member
    Are there steps to reproduce the bug and see that this commit fixes it?
  9. candrews commented at 4:52 pm on August 7, 2019: contributor

    Are there steps to reproduce the bug and see that this commit fixes it?

    Have libevent installed so that EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED is not defined (on Gentoo, that’s done by installing dev-libs/libevent with the debug flag unset.). Then, build bitcoin and run the tests. You’ll get this error output:

    0/var/tmp/portage/net-p2p/bitcoind-0.18.0-r1/work/bitcoin-2472733a24a9364e4c6233ccd04166a26a68cc65/src # test/test_bitcoin -l test_suite -t raii_event_creation
    1Test setup error: no test cases matching filter or all test cases were disabled
    

    With this change, you don’t get such a failure.

  10. DrahtBot added the label Tests on Aug 7, 2019
  11. luke-jr commented at 1:48 am on August 8, 2019: member
    See also #16228
  12. MarcoFalke commented at 8:41 pm on August 8, 2019: member
    Could you move the #if guard inside the boost_auto_test_case, so that the suite and test case appear only once in the file? Also, this does not compile.
  13. laanwj commented at 1:19 pm on August 14, 2019: member
    Agree that this is an issue and needs to be fixed, however I don’t think running empty tests is the right fix to allow for conditional tests.
  14. candrews commented at 3:02 pm on August 14, 2019: contributor
    I agree - I much prefer the approach taken in #16228 - perhaps that can be merged?
  15. DrahtBot commented at 5:50 am on August 24, 2019: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    No conflicts as of last run.

  16. in src/test/raii_event_tests.cpp:14 in b2c8450e6c outdated
     9+BOOST_FIXTURE_TEST_SUITE(raii_event_tests, BasicTestingSetup)
    10+
    11+#ifndef EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED
    12+BOOST_AUTO_TEST_CASE(raii_event_creation)
    13+{
    14+    // dummy; do nothing
    


    luke-jr commented at 7:08 pm on September 20, 2019:

    Suggest replacing with:

    0    // It would probably be ideal to report skipped, but boost::test doesn't seem to make that practical (at least not in versions available with common distros)
    1    BOOST_TEST_MESSAGE("Skipping raii_event_tess: libevent doesn't support event_set_mem_functions");
    
  17. in src/test/raii_event_tests.cpp:11 in b2c8450e6c outdated
     3@@ -4,8 +4,18 @@
     4 
     5 #include <event2/event.h>
     6 
     7+#include <boost/test/unit_test.hpp>
     8+
     9+BOOST_FIXTURE_TEST_SUITE(raii_event_tests, BasicTestingSetup)
    10+
    11+#ifndef EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED
    


    luke-jr commented at 7:09 pm on September 20, 2019:
    Maybe consider making this an #else later on (or at least turn the existing #ifdef into an #else if we prefer the skip-test on top)
  18. luke-jr changes_requested
  19. luke-jr commented at 7:09 pm on September 20, 2019: member
    Concept ACK
  20. Always define the raii_event_tests test suite
    The test suite must always be defined (even when EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED is not defined) so that the test harness doesn't fail due to not being able to find the raii_event_tests test.
    
    This improves upon 95f97f4 actually fixing https://github.com/bitcoin/bitcoin/issues/9493
    9a19c9ada5
  21. in src/test/raii_event_tests.cpp:12 in b2c8450e6c outdated
     3@@ -4,8 +4,18 @@
     4 
     5 #include <event2/event.h>
     6 
     7+#include <boost/test/unit_test.hpp>
     8+
     9+BOOST_FIXTURE_TEST_SUITE(raii_event_tests, BasicTestingSetup)
    10+
    11+#ifndef EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED
    12+BOOST_AUTO_TEST_CASE(raii_event_creation)
    


    luke-jr commented at 7:12 pm on September 20, 2019:
    Also suggest renaming the test to raii_event_tests_SKIPPED
  22. luke-jr commented at 7:17 pm on September 20, 2019: member

    @candrews Here’s a branch that can be force-pushed over this one if you like it:

    https://github.com/bitcoin/bitcoin/compare/master...luke-jr:raii_event_test_fix-0.14

    (Cleanly merges to 0.14.0 through master)

  23. candrews commented at 7:19 pm on September 20, 2019: contributor

    @candrews Here’s a branch that can be force-pushed over this one if you like it:

    master…luke-jr:raii_event_test_fix-0.14

    (Cleanly merges to 0.14.0 through master)

    Awesome, that looks great!

  24. candrews force-pushed on Sep 20, 2019
  25. MarcoFalke commented at 9:06 pm on October 11, 2019: member
    re-run ci
  26. MarcoFalke closed this on Oct 11, 2019

  27. MarcoFalke reopened this on Oct 11, 2019

  28. laanwj commented at 3:41 pm on February 5, 2020: member
    I’d strongly prefer a solution that doesn’t run raii_event_tests (and potentially other test suites) when disabled based on build configuration, instead of working around it by conditionally adding empty tests.
  29. adamjonas commented at 7:57 pm on May 18, 2020: member
    HI @candrews - bumping this to see if you’d like to continue to move this forward towards a solution that doesn’t run raii_event_tests as requested above?
  30. candrews commented at 8:09 pm on May 18, 2020: contributor

    bumping this to see if you’d like to continue to move this forward towards a solution that doesn’t run raii_event_tests as requested above?

    If someone has a suggestion as to how to do that, I’d be happy to update this PR to implement it.

  31. luke-jr commented at 8:39 pm on May 18, 2020: member
    IMO we should just merge this until a better solution is implemented
  32. MarcoFalke commented at 11:00 pm on May 18, 2020: member
    An alternative would be to kill xenial and use something like this: https://www.boost.org/doc/libs/1_59_0/libs/test/doc/html/boost_test/tests_organization/enabling.html
  33. MarcoFalke commented at 11:11 pm on May 18, 2020: member
    Or another alternative (if raising the minimum version of boost is too controversial), could be to make the test skipable when a recent boost version is available or otherwise just make it mandatory and require EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED? (I am assuming that EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED is defined with xenial libevent?)
  34. MarcoFalke commented at 12:55 pm on May 31, 2020: member

    The alternative was closed #16228 (comment), so this seems the best bet right now.

    It can be improved upon later by bumping boost #16564 (comment), but that might or might not be controversial.

    ACK

  35. MarcoFalke closed this on May 31, 2020

  36. MarcoFalke reopened this on May 31, 2020

  37. MarcoFalke commented at 9:55 pm on May 31, 2020: member

    Tested ACK:

    • Current master make check fails as if
    0$ ./src/test/test_bitcoin -t raii_event_tests
    1Test setup error: no test cases matching filter or all test cases were disabled
    
    • This pull:
    0$ ./src/test/test_bitcoin -t raii_event_tests
    1Running 1 test case...
    2
    3*** No errors detected
    

    ACK 9a19c9ada53e84d1ee8521b48f656faad48b737a 🎹

    Signature:

     0-----BEGIN PGP SIGNED MESSAGE-----
     1Hash: SHA512
     2
     3ACK 9a19c9ada53e84d1ee8521b48f656faad48b737a 🎹
     4-----BEGIN PGP SIGNATURE-----
     5
     6iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
     7pUgI0wv/eTNXTgQxxtVBd5iJ83l2Nl0JDo6pKMb1HnS7O+RYBuVywr365x3RuiN5
     8q+GtEc+od70x0Ln/YcJ3tDYcUYsUg/N39petAgE2vkYnD4hCoGBRuV6ftRWiHSwS
     9i099iG5luVWByDfpj/Q7/RJU0r22t2Aa5brUjZE2/yFUZx7EmomK5dWMsRCayigW
    105hFKbMRXNkJekqOSrGqfP9LgZesgCbl06BFOPLnG74Uue5Bnc8sPfn1HwzFpuRwK
    11Mrgiha3L4wj3Xvq4czcM1mVMDBQtdEH3fY2j0JlNZCxwP4DRBYq+fsg0xXZEqWbu
    12w61sW/xKTeAoNTSYqkc1trM1e140xed7Ifc/mle/w2qGrKO0YTrys11z6wDN3lmX
    13ETR1xVjUwbqZopZNk4iGiEU2t6/hjyL/LQI2KEjHMAO4fX+2FNvdDrS0Sl/Et7N7
    141ywk9uKlqamOZZA2tWL9bPJy3/HV5KZHA/O2GHjypQjRVHl2vormBadiVVwYGmAq
    15Te/qqL3D
    16=ARMg
    17-----END PGP SIGNATURE-----
    

    Timestamp of file with hash 10409394f1acc2ff628bcbe5435062c7affa09d444d74bc8b734e1c9f9ba9f87 -

  38. MarcoFalke merged this on May 31, 2020
  39. MarcoFalke closed this on May 31, 2020

  40. sidhujag referenced this in commit b4f1afa07f on Jun 1, 2020
  41. PastaPastaPasta referenced this in commit 5e9ee4a8e6 on Jun 27, 2021
  42. PastaPastaPasta referenced this in commit 40f1f9f027 on Jun 28, 2021
  43. PastaPastaPasta referenced this in commit b7d6279c93 on Jun 29, 2021
  44. PastaPastaPasta referenced this in commit f962a1da90 on Jul 1, 2021
  45. PastaPastaPasta referenced this in commit 660f05d74e on Jul 1, 2021
  46. PastaPastaPasta referenced this in commit 7c37931361 on Jul 14, 2021
  47. PastaPastaPasta referenced this in commit 48da7c553a on Jul 15, 2021
  48. Fabcien referenced this in commit 708ab698c6 on Aug 25, 2021
  49. DrahtBot locked this on Feb 15, 2022

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: 2024-11-18 00:12 UTC

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