Commit Graph

14496 Commits

Author SHA1 Message Date
whythat 1b3866fd0e [qa]: enable rpcbind_test 2020-11-21 03:02:41 +00:00
whythat 3c7f4ca809 [qa]: add parsing for '<host>:<port>' argument form to rpc_url() 2020-11-21 03:02:41 +00:00
fanquake 2fc450d94e [doc] Add OS X ZMQ requirement to QA readme 2020-11-21 03:02:37 +00:00
MarcoFalke 7366e81375 [qa] pull-tester: Start longest test first 2020-11-21 02:34:47 +00:00
MarcoFalke fd7689ff07 [qa] pull-tester: Fix assertion and check for run_parallel 2020-11-21 02:34:47 +00:00
MarcoFalke 63a3c9aceb [qa] test_framework: Use different rpc_auth_pair for each node 2020-11-21 02:34:47 +00:00
Cory Fields ecf9d8eb2b build: a few ugly hacks to get the rpc tests working out-of-tree
- Link pull-tester/rpc-tests.py to the build dir
- Add the build-dir's config to the python path so that tests can find it
- The tests themselves are in srcdir
- Clean up __pycache__ in 'make clean'
2020-11-21 02:34:47 +00:00
Suhas Daftuar 2399cfc7ba Tests: add timeout to sync_blocks() and sync_mempools()
Previously these functions would infinitely loop if sync failed;
now they have a default timeout of 60 seconds, after which an
AssertionError is raised.

sync_blocks() has also been improved and now compares the tip
hash of each node, rather than just using block count.

Zcash: Kept block count check for a couple of tests where we use it.
2020-11-21 02:34:47 +00:00
MarcoFalke 17caf1ddd1 [qa] test_framework: Append portseed to tmpdir
This makes it possible to specify a tmpdir while running tests in
parallel
2020-11-21 02:34:47 +00:00
MarcoFalke 818d2de39b [qa] Remove hardcoded "4 nodes" from test_framework
Zcash: Applied changes to our RPC tests.
2020-11-21 02:34:47 +00:00
MarcoFalke 5a12bc9d83 [qa] Add option --portseed to test_framework 2020-11-21 02:33:27 +00:00
MarcoFalke cbe91ea855 [qa] pull-tester: Run rpc test in parallel 2020-11-21 02:33:27 +00:00
MarcoFalke 0d8a62925a [qa] pull-tester: Adjust comment 2020-11-21 02:33:27 +00:00
MarcoFalke 5f13446dee [qa] Stop other nodes, even when one fails to stop 2020-11-21 02:33:27 +00:00
MarcoFalke 065255d3cb [qa] Update README.md 2020-11-21 02:33:27 +00:00
MarcoFalke 08256c9ec6 [qa] Refactor test_framework and pull tester
* log to stdout
* increase range for p2p and rpc ports
* UPPERCASE_CONSTANTS
* Stop nodes on CTRL+C
2020-11-21 02:33:27 +00:00
MarcoFalke 15721275d0 [qa] Switch to py3
Zcash: We already did this, so most of the backported changes are
ancillary (license header updates and style), but a few are relevant.
2020-11-21 02:33:27 +00:00
MarcoFalke d362b632bf [qa] rpc-tests: Fix link in comment and label error msg 2020-11-21 02:33:27 +00:00
MarcoFalke cc44368315 [qa] pull-tester: Exit early when no tests are run 2020-11-21 02:33:27 +00:00
MarcoFalke e7a6c49c00 [qa] pull-tester: Don't mute zmq ImportError 2020-11-21 02:33:27 +00:00
MarcoFalke db761077e5 [qa] mininode: Catch exceptions in got_data 2020-11-21 02:33:27 +00:00
MarcoFalke 7108d6aaa6 [qa] rpc-tests: Properly use integers, floats 2020-11-21 02:33:27 +00:00
MarcoFalke 65a6249d41 [qa] Use python2/3 syntax 2020-11-21 02:33:27 +00:00
Elliot Olds 845b31a760 Check if zmq is installed in tests, update docs
If ZMQ is enabled, check whether it's installed before running ZMQ tests.
If it isn't, disable ZMQ and print a warning.

Also add dependency info to test docs, so users know ZMQ is required
before running tests, and so they know how to install it.

When following the build instructions before this change then trying
to run the RPC tests, a unix user would get an error when python
tried to import zmq.

There may be other dependencies that should be added to the docs,
particularly ones for non-unix systems. This is the only unlisted
dependency I encountered using linux.
2020-11-21 02:33:27 +00:00
Wladimir J. van der Laan 239857d7d9 test: don't override BITCOIND and BITCOINCLI if they're set
In rpc-tests.py, don't override BITCOIND and BITCOINCLI if they're
already set. Makes it possible to run the tests with either another tree
or the GUI.
2020-11-21 02:33:27 +00:00
MarcoFalke fb1f76f330 [qa] pull-tester: Cleanup (run keypool, tidy stdout)
* Run keypool (takes 6 seconds)
* Print duration of each rpc test
* Structure output (bold, new lines)
2020-11-21 02:33:27 +00:00
MarcoFalke db27db2e43 [qa] keypool: DRY: Use test framework 2020-11-21 02:33:27 +00:00
MarcoFalke fa44509d6c [qa] keypool: Fix white space to prepare transition to test framework 2020-11-21 02:33:27 +00:00
MarcoFalke 01c36295c4 [qa] Extend README.md 2020-11-21 02:33:27 +00:00
MarcoFalke 80b2274ddf [qa] Split README.md to /qa and /qa/rpc-tests
+ Update with new -help message
2020-11-21 02:33:27 +00:00
Suhas Daftuar 800bf0a45f Remove unmaintained example test script_test.py 2020-11-21 02:33:27 +00:00
James O'Beirne eaf4dfe280 Add basic coverage reporting for RPC tests
Thanks to @MarcoFalke @dexX7 @laanwj for review.

Zcash: Just the --coverage flag for rpc-tests.py, as we backported the
rest of the coverage backend in zcash/zcash#4411.
2020-11-21 02:33:27 +00:00
Wladimir J. van der Laan 5832635532 build: don't distribute tests_config.py
This file is dynamically generated by configure based on the platform,
it doesn't belong in the distribution archive.

Fixes #6929.
2020-11-21 02:33:27 +00:00
MarcoFalke 760e500811 [rpc-tests] Check return code 2020-11-20 03:32:53 +00:00
MarcoFalke 6aa4f19e87 [rpc-tests] fundrawtransaction: Update fee after minRelayTxFee increase
Zcash: Added floor, since our minRelayTxFee is actually lower.
2020-11-20 03:32:53 +00:00
James O'Beirne 480f1bf43e Add tests for gettxoutsetinfo, CLevelDBBatch, CLevelDBIterator
Thanks @dexX7.

Zcash: Rest of this commit was cherry-picked in zcash/zcash#2598.
2020-11-20 03:32:53 +00:00
MarcoFalke 8e58eddab1 [doc] trivial: fix markdown syntax in qa/rpc-tests/README.md 2020-11-20 03:32:53 +00:00
Jeff Garzik 6618580194 qa/pull-tester/rpc-tests.py: chmod 0755
Fix file mode to be executable.

Include dummy whitespace change to force git to change mode.
2020-11-20 03:32:53 +00:00
ptschip 772d780730 Migrated rpc-tests.sh to all python rpc-tests.py
1) created rpc-tests.py
2) deleted rpc-tests.sh
3) travis.yml points to rpc-tests.py
4) Modified Makefile.am
5) Updated README.md
6) Added tests_config.py and deleted tests-config.sh
7) Modified configure.ac with script to set correct path in tests_config.py

Zcash: Migrated our test list over, and other necessary modifications.
The UI changes were not migrated.
2020-11-20 03:32:53 +00:00
Casey Rodarmor 4761c9f2bc Add p2p-fullblocktest.py
Zcash: Includes pyflakes changes.
2020-11-20 03:32:53 +00:00
Daniel Kraft 95d1f887ca Fix crash when mining with empty keypool.
Since the introduction of the ScriptForMining callback, the mining
functions (setgenerate and generate) crash with an assertion failure
(due to a NULL pointer script returned) if the keypool is empty.  Fix
this by giving a proper error.

Zcash: Adapted to our MinerAddress type.

Co-authored-by: Jack Grigg <jack@electriccoin.co>
2020-11-20 03:30:37 +00:00
Homu 877212414a Auto merge of #4745 - nathan-at-least:autoconf-require-prog, r=str4d
configure.ac: Introduce macros to simplify requiring tools.

## what

Introduce two `ZC_REQUIRE_(PROG|TOOL)` macros that are like `AC_PATH_(PROG|TOOL)` except they immediately error out if the target program is not detected.

Then require almost all programs, except for two known optional cases: three programs required only if `--with-lcov` is given, and then `ccache` which has exceptional logic (The equivalent of "--enable-ccache=auto" by default, with explicit 'yes' or 'no' possible, each with different detection needs.)

## why

Provide early explicit errors for build misconfigurations. Hopefully this should never hit our "standard official flow" which relies on the `./zcutil/build.sh` path, though it may come into play for anyone experimenting with the build system or altering dependencies.

### background motivation

While prototyping a nix build system I didn't provide the `cargo` program to the `zcashd` build process. `./configure` happily exited with a success value, but the build system was instantiated with the `CARGO` make / shell variable set to the empty string, which lead to a strange command execution where a long command of `… $CARGO build …` became `…  build …`, so bash looked for a program named `build`. I spent a bit too long looking for where "build" was defined in our dependencies. 😆
2020-11-20 01:03:29 +00:00
Nate Wilcox da081de356 configure.ac: Introduce macros to simplify requiring tools. 2020-11-20 00:59:43 +00:00
Homu bf70e357cf Auto merge of #4553 - oxarbitrage:issue4356, r=daira
Return address in z_importviewingkey error

Closes https://github.com/zcash/zcash/issues/4536.
2020-11-19 17:49:58 +00:00
Kris Nuttycombe 9a5f9bf5ee
Merge branch 'master' into issue4356 2020-11-19 07:22:39 -07:00
Homu 10b09d483e Auto merge of #4793 - str4d:faster-rpc-tests, r=str4d
test: Use default shielded address in RPC tests where the type is irrelevant

This means we are running these tests against the recommended functionality,
and that these RPC tests will now use the faster Sapling addresses.
2020-11-19 14:15:08 +00:00
Homu 949fdca3a6 Auto merge of #4873 - str4d:rpc-test-blocks, r=str4d
Enable mininodes to construct blocks in RPC tests

Includes changes to disable difficulty adjustment on regtest, cherry-picked from:
- bitcoin/bitcoin#6853
- bitcoin/bitcoin#13046

The ZIP 143/243 logic is ported from https://github.com/zcash-hackworks/zcash-test-vectors
2020-11-18 15:11:49 +00:00
Homu 2cc836680a Auto merge of #4843 - furszy:2020_improving_sendmany_redudant_loops_first_round, r=daira
Improving asyncOp_sendmany redundancies (first round)

Work over async sendmany operation flow. Specifically on the utxo finding, utxo selection, total amount calculation and the tx inputs appending process.  Removed several unneeded for loops over the entire utxo set, re structuring and cleaning the flow.
2020-11-18 13:54:13 +00:00
Jack Grigg 044ff5716e test: Re-enable regtest difficulty adjustment for unit tests that use it 2020-11-18 12:17:57 +00:00
Homu e3974db2d3 Auto merge of #4870 - mdr0id:canopy_smoke_tests_update, r=str4d
Update expected fails for  Sprout txns flows on Canopy

Updating smoke test for Canopy consensus
2020-11-18 11:52:29 +00:00