[RPC-Tests] add simple way to run rpc test over QT clients #7068

pull jonasschnelli wants to merge 1 commits into bitcoin:master from jonasschnelli:2015/11/rpc_tests_qt changing 2 files +3 −3
  1. jonasschnelli commented at 1:05 PM on November 20, 2015: contributor

    Use env variable QT=1. Example: QT=1 ./qa/rpc-tests/wallet.py --srcdir=src/

    The RPC test will be executed over GUI clients. It pretty cool to visually watch the RPC test slowly gets executed. Much slower then bitcoind; aims to help testing and improving UI situations.

  2. jonasschnelli added the label GUI on Nov 20, 2015
  3. jonasschnelli added the label Tests on Nov 20, 2015
  4. in qa/rpc-tests/test_framework/util.py:None in 343e26c721 outdated
     215 | @@ -214,7 +216,10 @@ def start_node(i, dirname, extra_args=None, rpchost=None, timewait=None, binary=
     216 |      datadir = os.path.join(dirname, "node"+str(i))
     217 |      if binary is None:
     218 |          binary = os.getenv("BITCOIND", "bitcoind")
     219 | -    args = [ binary, "-datadir="+datadir, "-keypool=1", "-discover=0", "-rest" ]
     220 | +    args = [ binary, "-datadir="+datadir, "-server", "-keypool=1", "-discover=0", "-rest" ]
     221 | +    if os.getenv("QT", ""):
     222 | +        args[0] = "bitcoin-qt"
     223 | +        args.append("-server")
    


    paveljanik commented at 1:08 PM on November 20, 2015:

    Adding -server twice here? See changed line 219. Thanks @instagibbs.


    instagibbs commented at 1:21 PM on November 20, 2015:

    219 I think you mean


    jonasschnelli commented at 1:59 PM on November 20, 2015:

    Right. There was one to many. Fixed.

  5. jonasschnelli force-pushed on Nov 20, 2015
  6. in qa/rpc-tests/test_framework/test_framework.py:None in 72f2722cb1 outdated
     112 | @@ -113,6 +113,9 @@ def main(self):
     113 |          self.add_options(parser)
     114 |          (self.options, self.args) = parser.parse_args()
     115 |  
     116 | +        if os.getenv("QT", ""):
     117 | +            self.options.noshutdown = True
    


    MarcoFalke commented at 8:16 PM on November 21, 2015:

    Any reason to do this? This will hinder executing QT=1 ./qa/pull-tester/rpc-tests.py?


    laanwj commented at 8:01 AM on November 24, 2015:

    I'd also prefer passing noshutdown, if desired, as an explicit option.


    jonasschnelli commented at 8:21 AM on November 24, 2015:

    The reason why I added the noshutdown=True is, because i think running a RPC test with the UI needs post-run user based verification (does the GUI looks like expected?). As long as there is no automatic screenshot creating (and maybe auto-comparing) I think the noshutdown flag is appropriate. The QT=1 env flag is a helper IMO. It's not really necessary because one could also pass the path to bitcoin-qt in the BITCOIND env var.


    MarcoFalke commented at 8:47 AM on November 24, 2015:

    I think the noshutdown flag is appropriate.

    Still, you could just pass it via the command line. On the other hand, there is no way to disable it, right now when using QT=.


    laanwj commented at 9:26 AM on November 24, 2015:

    Right. There is no -shutdown to override it the other way. I still think it's better not to conflate "want to use GUI" and "don't want to shutdown".


    jonasschnelli commented at 11:45 AM on November 24, 2015:

    Yes. Agreed. This is a point. Fixed.

  7. in qa/rpc-tests/test_framework/util.py:None in 72f2722cb1 outdated
     217 | @@ -215,6 +218,9 @@ def start_node(i, dirname, extra_args=None, rpchost=None, timewait=None, binary=
     218 |      if binary is None:
     219 |          binary = os.getenv("BITCOIND", "bitcoind")
     220 |      args = [ binary, "-datadir="+datadir, "-keypool=1", "-discover=0", "-rest" ]
     221 | +    if os.getenv("QT", ""):
    


    MarcoFalke commented at 11:41 PM on November 21, 2015:

    QT=0 also triggers?


    jonasschnelli commented at 11:48 AM on November 24, 2015:

    Right. I used the same way than PYTHON_DEBUG is implemented. But i agree, maybe we should change both variables so that they only trigger if they are set with a non-0 value.


    laanwj commented at 7:20 AM on November 25, 2015:

    bool("0") is True not False. Of strings (which are the only thing that can be returned from getenv), only empty strings evalutate to False. So this is correct. Never mind, that's what you meant


    laanwj commented at 11:15 AM on December 14, 2015:

    I would suggest changing the environment variable name. QT seems to be something that could be legitimately used by the toolkit itself, and defined otherwise. Why not PYTHON_USE_QT or so? (it's not that descriptive either but stays with the PYTHON_DEBUG pattern, and avoids accidental collisions.)

  8. gmaxwell commented at 10:04 PM on November 22, 2015: contributor

    utACK. Any idea why it's slower?

  9. jonasschnelli force-pushed on Nov 24, 2015
  10. jonasschnelli force-pushed on Nov 24, 2015
  11. jonasschnelli commented at 11:49 AM on November 24, 2015: contributor

    @gmaxwell: I haven't analyzed why they are slower, but i assume it's because of the whole GUI/QT overhead.

  12. jonasschnelli commented at 12:01 PM on November 24, 2015: contributor

    Maybe I should give some directions where this could go to: QT has easy functions to create a bitmap (example: PNG File) of a window. If there would be a script that runs through all UI situations and create a bunch of screenshots that could help in testing various platforms and all UI change requests (kick a script that builds a html page with screenshots, scroll through them, verify). Testing multiplatform UI is complicated and time robbing. I once used a similar system that could also compare screenshots (% divergence) and where capable of detect unwished UI changes.

  13. laanwj commented at 7:25 AM on November 25, 2015: member

    utACK. Any idea why it's slower?

    With e.g. wallet tests with lots of transactions it's bound to be slower because the UI is doing more in that case, it keeps and maintains its own table of transactions to to do things like sort, as well as draw the screen when core's locks are contended.

  14. MarcoFalke commented at 7:26 AM on November 25, 2015: member

    utACK ffe8fa6

  15. laanwj commented at 1:06 PM on December 3, 2015: member

    Needs rebase

  16. [RPC-Tests] add option to run rpc test over QT clients 979698c171
  17. jonasschnelli force-pushed on Dec 14, 2015
  18. jonasschnelli commented at 11:58 AM on December 14, 2015: contributor

    Rebased and reduced. There are only two changes now:

    1. Pass -server arg always
    2. Add src/qt to the PATH variable

    Tests over QT clients can be run like BITCOIND=bitcoin-qt ./qa/rpc-tests/wallet.py --srcdir=src/.

  19. laanwj commented at 12:03 PM on December 14, 2015: member

    Awesome, utACK

  20. laanwj merged this on Dec 14, 2015
  21. laanwj closed this on Dec 14, 2015

  22. laanwj referenced this in commit 5f3c670d12 on Dec 14, 2015
  23. MarcoFalke commented at 1:06 PM on December 14, 2015: member

    Would be nice to have ./qa/pull-tester/rpc-tests.py support this as well so one can run all test with the gui and check if it passes.

  24. laanwj commented at 1:14 PM on December 14, 2015: member

    Doesn't this simply work?

    BITCOIND=bitcoin-qt ./qa/pull-tester/rpc-tests.py
    
  25. MarcoFalke commented at 1:47 PM on December 14, 2015: member

    Doesn't this simply work?

    Fixed by #7209

  26. luke-jr referenced this in commit eeff3e7c14 on Dec 28, 2015
  27. luke-jr referenced this in commit 05e9b642b0 on Dec 28, 2015
  28. luke-jr referenced this in commit efe8b38523 on Jan 13, 2016
  29. luke-jr referenced this in commit 6191a9b628 on Jan 13, 2016
  30. MarcoFalke 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-21 18:15 UTC

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