aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-10-10 13:18:54 -0400
committerMarcoFalke <falke.marco@gmail.com>2019-10-10 13:19:10 -0400
commitd5a770b70d55a5874fbd7796a171de22abbbd342 (patch)
tree5b425a7be1d3284445e42f7f30814884c1daa7c0 /test/functional
parentbefdef8aee899dcf7e40aa5ea4bc1b0256381cdc (diff)
parentd478a472eb0d666e8a762ed8d24fafbabc5f94f3 (diff)
Merge #16973: test: Fix combine_logs.py for AppVeyor build
d478a472eb0d666e8a762ed8d24fafbabc5f94f3 test: Fix combine_logs.py for AppVeyor build (Martin Zumsande) Pull request description: Fixes #16894 This fixes the problem of AppVeyor builds not showing `debug.log` if a functional test fails, because the windows separator `\` doesn't work together with the regex in `combine_logs.py`. A fix was already attempted in #16896, however, that PR became inactive and was marked "up for grabs", plus it's a really small change. As suggested by jamesob, this PR uses `pathlib`: For the glob and to convert the path to a posix-style string, it leaves the regex as is (in contrast to #16896 which adjusted the regex). I tested this locally on Windows and Ubuntu. Top commit has no ACKs. Tree-SHA512: 603b4359b6009b6da874c30f69759acda03730ee5747898a0fe957a5fc37ee9ba07858c6aa2169bf4c40521f37e47138e8314d698652ea2760fa0a3f76b890bd
Diffstat (limited to 'test/functional')
-rwxr-xr-xtest/functional/combine_logs.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/functional/combine_logs.py b/test/functional/combine_logs.py
index 367d0f6916..a70d9c4ac1 100755
--- a/test/functional/combine_logs.py
+++ b/test/functional/combine_logs.py
@@ -8,7 +8,6 @@ If no argument is provided, the most recent test directory will be used."""
import argparse
from collections import defaultdict, namedtuple
-import glob
import heapq
import itertools
import os
@@ -78,10 +77,11 @@ def read_logs(tmp_dir):
for each of the input log files."""
# Find out what the folder is called that holds the debug.log file
- chain = glob.glob("{}/node0/*/debug.log".format(tmp_dir))
- if chain:
- chain = chain[0] # pick the first one if more than one chain was found (should never happen)
- chain = re.search(r'node0/(.+?)/debug\.log$', chain).group(1) # extract the chain name
+ glob = pathlib.Path(tmp_dir).glob('node0/**/debug.log')
+ path = next(glob, None)
+ if path:
+ assert next(glob, None) is None # more than one debug.log, should never happen
+ chain = re.search(r'node0/(.+?)/debug\.log$', path.as_posix()).group(1) # extract the chain name
else:
chain = 'regtest' # fallback to regtest (should only happen when none exists)