Browse Source

BTC-only testing fixes

The MMGen Project 8 months ago
parent
commit
82f2fb1db9

+ 2 - 0
test/cmdtest_py_d/ct_misc.py

@@ -99,6 +99,8 @@ class CmdTestMisc(CmdTestBase):
 		return self.xmrwallet_txview(op='txlist')
 
 	def examples_bip_hd(self):
+		if cfg.no_altcoin:
+			return 'skip'
 		return self.spawn('examples/bip_hd.py',cmd_dir='.')
 
 	def coin_daemon_info(self):

+ 11 - 3
test/test-release.d/cfg.sh

@@ -24,6 +24,7 @@ init_groups() {
 	noalt_tests='dep alt obj color unit hash ref tool tool2 gen autosign_btc btc btc_tn btc_rt'
 	quick_tests='dep alt obj color unit hash ref tool tool2 gen autosign btc btc_rt altref altgen eth etc xmr'
 	qskip_tests='lint btc_tn bch bch_rt ltc ltc_rt'
+	noalt_ok_tests='lint'
 
 	[ "$MSYS2" ] && SKIP_LIST='autosign autosign_btc autosign_live'
 	[ "$ARM32" -o "$ARM64" ] && SKIP_LIST+=' etc'
@@ -69,12 +70,19 @@ init_tests() {
 
 	d_lint="code errors with static code analyzer"
 	t_lint="
-		- $pylint --errors-only mmgen
-		- $pylint --errors-only test
+		b $pylint --errors-only mmgen
+		b $pylint --errors-only test
+		b $pylint --errors-only --disable=relative-beyond-top-level test/cmdtest_py_d
+
+		a $pylint --errors-only --ignore-paths '.*/eth/.*' mmgen
+		a $pylint --errors-only --ignore-paths '.*/ut_dep.py,.*/ut_testdep.py' test
+		a $pylint --errors-only --ignore-paths '.*/ct_ethdev.py' --disable=relative-beyond-top-level test/cmdtest_py_d
+
 		- $pylint --errors-only examples
-		- $pylint --errors-only --disable=relative-beyond-top-level test/cmdtest_py_d
 	"
 
+	if [ "$SKIP_ALT_DEP" ]; then t_lint_skip='b'; else t_lint_skip='a'; fi
+
 	d_unit="low-level subsystems"
 	t_unit="- $unit_tests_py --exclude testdep,dep,daemon"
 

+ 1 - 1
test/test-release.sh

@@ -69,7 +69,7 @@ run_tests() {
 	for t in $1; do
 		desc_id="d_$t" desc=${!desc_id}
 		if [ "$SKIP_ALT_DEP" ]; then
-			ok=$(for a in $noalt_tests; do if [ $t == $a ]; then echo 'ok'; fi; done)
+			ok=$(for a in $noalt_tests $noalt_ok_tests; do if [ $t == $a ]; then echo 'ok'; fi; done)
 			if [ ! "$ok" ]; then
 				echo -e "${BLUE}Skipping altcoin test '$t'$RESET"
 				continue

+ 7 - 3
test/unit_tests.py

@@ -179,6 +179,10 @@ def run_test(test,subtest=None):
 		gmsg(f'Running unit test {test}')
 		tests_seen.append(test)
 
+	if cfg.no_altcoin_deps and getattr(mod,'altcoin_dep',None):
+		cfg._util.qmsg(gray(f'Skipping unit test {test!r} [--no-altcoin-deps]'))
+		return
+
 	if hasattr(mod,'unit_tests'): # new class-based API
 		t = getattr(mod,'unit_tests')()
 		altcoin_deps = getattr(t,'altcoin_deps',())
@@ -193,13 +197,13 @@ def run_test(test,subtest=None):
 		for subtest in subtests:
 			subtest_disp = subtest.replace('_','-')
 			if cfg.no_altcoin_deps and subtest in altcoin_deps:
-				cfg._util.qmsg(gray(f'Invoked with --no-altcoin-deps, so skipping subtest {subtest_disp!r}'))
+				cfg._util.qmsg(gray(f'Skipping unit subtest {subtest_disp!r} [--no-altcoin-deps]'))
 				continue
 			if sys.platform == 'win32' and subtest in win_skip:
-				cfg._util.qmsg(gray(f'Skipping subtest {subtest_disp!r} for Windows platform'))
+				cfg._util.qmsg(gray(f'Skipping unit subtest {subtest_disp!r} for Windows platform'))
 				continue
 			elif platform.machine() == 'aarch64' and subtest in arm_skip:
-				cfg._util.qmsg(gray(f'Skipping subtest {subtest_disp!r} for ARM platform'))
+				cfg._util.qmsg(gray(f'Skipping unit subtest {subtest_disp!r} for ARM platform'))
 				continue
 			run_subtest(t,subtest)
 		if hasattr(t,'_post'):

+ 2 - 0
test/unit_tests_d/ut_xmrseed.py

@@ -4,6 +4,8 @@
 test/unit_tests_d/ut_xmrseed: Monero mnemonic unit test for the MMGen suite
 """
 
+altcoin_dep = True
+
 from mmgen.util import msg,msg_r,ymsg
 
 from ..include.common import cfg,qmsg,vmsg