From 5252e8d69129e476d29bb0fb26e3743fb41debd2 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sat, 15 Mar 2025 18:24:52 +0000 Subject: [PATCH] test-release.py: restore Pylint test --- test/test-release.d/cfg.sh | 15 ++++++++++++++- test/test-release.sh | 9 ++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/test/test-release.d/cfg.sh b/test/test-release.d/cfg.sh index 2dc82202..fdc56435 100755 --- a/test/test-release.d/cfg.sh +++ b/test/test-release.d/cfg.sh @@ -20,7 +20,7 @@ groups_desc=" init_groups() { dfl_tests='dep alt obj color daemon mod hash ref tool tool2 gen help autosign btc btc_tn btc_rt altref altgen bch bch_rt ltc ltc_rt eth etc xmr' - extra_tests='dep dev lint autosign_live ltc_tn bch_tn' + extra_tests='dep dev lint pylint autosign_live ltc_tn bch_tn' noalt_tests='dep alt obj color daemon mod hash ref tool tool2 gen help autosign btc btc_tn btc_rt' quick_tests='dep alt obj color daemon mod hash ref tool tool2 gen help autosign btc btc_rt altref altgen eth etc xmr' qskip_tests='lint btc_tn bch bch_rt ltc ltc_rt' @@ -80,6 +80,19 @@ init_tests() { b ruff check examples $STDOUT_DEVNULL " + PYLINT_OPTS='--errors-only --jobs=0' + d_pylint="code errors with static code analyzer" + e_pylint="Error checking failed!" + t_pylint=" + b $pylint $PYLINT_OPTS mmgen + b $pylint $PYLINT_OPTS test + b $pylint $PYLINT_OPTS --disable=relative-beyond-top-level test/cmdtest_d + a $pylint $PYLINT_OPTS --ignore-paths '.*/eth/.*' mmgen + a $pylint $PYLINT_OPTS --ignore-paths '.*/ut_dep.py,.*/ut_testdep.py' test + a $pylint $PYLINT_OPTS --ignore-paths '.*/ct_ethdev.py' --disable=relative-beyond-top-level test/cmdtest_d + - $pylint $PYLINT_OPTS examples + " + d_daemon="low-level subsystems involving coin daemons" t_daemon="- $daemontest_py --exclude exec" diff --git a/test/test-release.sh b/test/test-release.sh index 560043e0..c82ea497 100755 --- a/test/test-release.sh +++ b/test/test-release.sh @@ -18,8 +18,7 @@ run_test() { set +x - tests="t_$1" - skips="t_$1_skip" + local tests="t_$1" skips="t_$1_skip" continue_on_error="e_$1" have_error= while read skip test; do [ "$test" ] || continue @@ -35,11 +34,13 @@ run_test() { echo -e "${GREEN}Running:$RESET $test_disp" eval "$test" || { echo -e $RED"test-release.sh: test '$CUR_TEST' failed at command '$test'"$RESET - exit 1 + have_error=1 + [ "${!continue_on_error}" ] || exit 1 } fi fi done <<<${!tests} + if [ "$have_error" ]; then { echo -e "$RED${!continue_on_error}$RESET"; exit 1; }; fi } prompt_skip() { @@ -276,6 +277,7 @@ gentest_py='test/gentest.py --quiet' scrambletest_py='test/scrambletest.py' altcoin_mod_opts='--quiet' mmgen_tool='cmds/mmgen-tool' +pylint='PYTHONPATH=. pylint' # PYTHONPATH required by older Pythons (e.g. v3.9) python='python3' rounds=10 typescript_file='test-release.out' @@ -370,6 +372,7 @@ do tooltest_py+=" --verbose" mmgen_tool+=" --verbose" objattrtest_py+=" --verbose" + pylint+=" --verbose" scrambletest_py+=" --verbose" ;; X) IN_REEXEC=1 ;; *) exit ;;