Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: RPC Tests Improvement List #4076

Closed
zancas opened this issue Jul 23, 2019 · 4 comments
Closed

WIP: RPC Tests Improvement List #4076

zancas opened this issue Jul 23, 2019 · 4 comments
Labels
A-testing Area: Tests and testing infrastructure

Comments

@zancas
Copy link
Contributor

zancas commented Jul 23, 2019

This issue is currently a scratch pad for collecting ideas/observations related to RPC tests.

Codecs:

  • a well defined single transformer between Decimal and struct?
  • test_framework, _response or get_response, should deserialize:
    * some field to bytes
    * some to Decimal
  • check for lurking floats

Possible Duplicated Functionality:

  • e.g. in initialize_chain and start_node
  • make classes use proper constructors where relevant

Compare Py3 implementation with bitcoin core

Efficiency:

  • how often is it necessary to run e.g. "initiate_chain"? Could test run time be cut... by a constant factor?

Etc:

  • Is it necessary to call mininode operations during a test? Perhaps use mininode to precompute test vectors, and then store them in explicit form.
  • generate coverage data from a test run, is there dead code in the test code base?
  • increase granularity of tests
  • use standard assertion checking (pytest)
  • type hints?
  • unit tests?
  • implement components in Rust (e.g. mininode.rs)?

Enhancements:

  • run against bitcoin
  • run against zebrad
  • run against YEC

Code Quality:

  • BitcoinTestFramework should inherit from unittest.Testcase
  • order tests by time
  • coverage of test code, do we have dead code?
@zancas
Copy link
Contributor Author

zancas commented Jul 23, 2019

What about the 2638 lines of Python that aren't in the qa directory, and aren't generated by the build process?

/home/ghurder/freshzcash: 0 $
cloc --exclude-dir qa --include-lang Python .
    1191 text files.
    1176 unique files.
    1172 files ignored.

github.com/AlDanial/cloc v 1.82  T=0.09 s (240.3 files/s, 37452.9 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Python                          22            467            324           2638
-------------------------------------------------------------------------------
SUM:                            22            467            324           2638
-------------------------------------------------------------------------------

@zancas
Copy link
Contributor Author

zancas commented Jul 23, 2019

/home/ghurder/freshzcash: 0 $
for i in `ls -1`; do PYLINES=`cloc --include-lang Python $i | grep Python | awk '{print $NF}'`; if [ "$PYLINES" != "" ]; then echo $PYLINES $i; fi done
1656 contrib
11411 qa
299 src
683 zcutil

zkbot added a commit that referenced this issue Jul 26, 2019
Migrate tests from py2 to py3

When executed with the `zcash/qa/pull-tester/rpc-tests.sh` script the Python code in the `zcash/qa/rpc-tests` directory, and subdirectories, runs under Python 3.5.3.

I tried to _only_ make changes that were necessary for this goal, and nothing else (like causing `BitcoinTestFramework` to inherit from `unittest.TestCase`, deduplicating repeated code, replacing bespoke components with standard solutions, etc.)

I've begun collecting ideas related to such potential improvements here:

#4076  <- (Note: This "improvement list" is, itself, much in need of improvement.)
@Eirik0 Eirik0 added the A-testing Area: Tests and testing infrastructure label Jul 29, 2019
@Eirik0 Eirik0 added this to Needs Prioritization in Arborist Team via automation Jul 29, 2019
@Eirik0
Copy link
Contributor

Eirik0 commented Jul 29, 2019

Hey! Thanks for putting this together. We will look in to this when we look in to the py2->py3 migration.

zkbot added a commit that referenced this issue Feb 7, 2020
WIP: Migrate tests from py2 to py3

When executed with the `zcash/qa/pull-tester/rpc-tests.sh` script the Python code in the `zcash/qa/rpc-tests` directory, and subdirectories, runs under Python 3.5.3.

I tried to _only_ make changes that were necessary for this goal, and nothing else (like causing `BitcoinTestFramework` to inherit from `unittest.TestCase`, deduplicating repeated code, replacing bespoke components with standard solutions, etc.)

I've begun collecting ideas related to such potential improvements here:

#4076  <- (Note: This "improvement list" is, itself, much in need of improvement.)
@zancas
Copy link
Contributor Author

zancas commented Jan 7, 2022

Obsolete.

@zancas zancas closed this as completed Jan 7, 2022
Arborist Team automation moved this from Needs Prioritization to Complete Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testing Area: Tests and testing infrastructure
Projects
Arborist Team
  
Complete
Development

No branches or pull requests

2 participants