Page MenuHomePhabricator

Added better error reporting for running individual functional tests
ClosedPublic

Authored by jasonbcox on Mar 16 2019, 15:29.

Details

Summary

While Nico was debugging functional tests with pdb, he found that it was difficult to interact with the pdb CLI when the test was run via test_runner. The best way is to run the test directly. However, out-of-tree builds produce a file-not-found error that is non-descriptive. Digging in the code, I found that there's little indication that BITCOIND and BITCOINCLI binary paths can be set explicitly, fixing this issue.

The best way to inform the operator is a simple error message that matches this issue.

Test Plan

Note that test.py is any individual test (not test_runner.py):

# Build out-of-tree
mkdir build
cd build
../configure
make

# Without this patch
../test/functional/test.py # Produces a file-not-found error message

# With this patch
BITCOIND=~/bitcoind ../test/functional/test.py # Some invalid path produces a nice error message
BITCOIND=./src/bitcoind ../test/functional/test.py # Test runs as expected

BITCOINCLI=~/bitcoin-cli ../test/functional/test.py # Some invalid path produces a nice error message
BITCOINCLI=./src/bitcoin-cli ../test/functional/test.py # Test runs as expected

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Mar 23 2019, 14:45
This revision was automatically updated to reflect the committed changes.