Skip to content

Commit

Permalink
Merge bitcoin/bitcoin#31433: test: #31212 follow up (spelling, refactor)
Browse files Browse the repository at this point in the history
41d934c chore: Typo Overriden -> Overridden (Hodlinator)
c9fb38a refactor test: Cleaner combine_logs.py logic (Hodlinator)

Pull request description:

  - Fixes typo caught by spelling linter (https://github.com/bitcoin/bitcoin/runs/33979284676).
  - Minor but nice refactoring of *combine_logs.py* change that was suggested late: bitcoin/bitcoin#31212 (comment)

ACKs for top commit:
  l0rinc:
    ACK 41d934c
  maflcko:
    lgtm ACK 41d934c
  theStack:
    ACK 41d934c
  BrandonOdiwuor:
    Code Review ACK 41d934c
  tdb3:
    ACK 41d934c

Tree-SHA512: cf8ecc070d0b01df9c4e57a75820e17d4535591e85bf9d271c7b8f60875f7e04b9978c56e9b88c10e89e69ff755c35b23ed291949c32c875a91c3317105a3c79
  • Loading branch information
fanquake committed Dec 8, 2024
2 parents 18d0cfb + 41d934c commit 35000e3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
17 changes: 9 additions & 8 deletions test/functional/combine_logs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2017-2021 The Bitcoin Core developers
# Copyright (c) 2017-present The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Combine logs from multiple bitcoin nodes as well as the test_framework log.
Expand Down Expand Up @@ -81,13 +81,14 @@ def read_logs(tmp_dir):

# Find out what the folder is called that holds node 0's debug.log file
debug_logs = list(pathlib.Path(tmp_dir).glob('node0/**/debug.log'))
if len(debug_logs) > 0:
assert len(debug_logs) < 2, 'Max one debug.log is supported, ' \
'found several:\n\t' + '\n\t'.join([str(f) for f in debug_logs])
path = debug_logs[0]
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)
match len(debug_logs):
case 0:
chain = 'regtest' # fallback to regtest
case 1:
chain = re.search(r'node0/(.+?)/debug\.log$', debug_logs[0].as_posix()).group(1)
case _:
raise RuntimeError('Max one debug.log is supported, found several:\n\t' +
'\n\t'.join(map(str, debug_logs)))

files = [("test", "%s/test_framework.log" % tmp_dir)]
for i in itertools.count():
Expand Down
4 changes: 2 additions & 2 deletions test/functional/feature_config_args.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2017-2022 The Bitcoin Core developers
# Copyright (c) 2017-present The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test various command line arguments and configuration file parameters."""
Expand Down Expand Up @@ -31,7 +31,7 @@ def set_test_params(self):
def setup_network(self):
self.setup_nodes()

# Overriden to not start nodes automatically - doing so is the
# Overridden to not start nodes automatically - doing so is the
# responsibility of each test function.
def setup_nodes(self):
self.add_nodes(self.num_nodes, self.extra_args)
Expand Down

0 comments on commit 35000e3

Please sign in to comment.