Browse Source

test suite: minor fixes

The MMGen Project 5 months ago
parent
commit
489d0e733d
3 changed files with 16 additions and 10 deletions
  1. 6 0
      test/cmdtest.py
  2. 2 1
      test/cmdtest_py_d/ct_autosign.py
  3. 8 9
      test/test-release.d/cfg.sh

+ 6 - 0
test/cmdtest.py

@@ -1013,10 +1013,16 @@ if __name__ == '__main__':
 		if os.getenv('MMGEN_EXEC_WRAPPER'):
 			Msg(red(str(e)))
 			Msg(blue('cmdtest.py: spawned script exited with error'))
+		if hasattr(tr, 'tg'):
+			del tr.tg
+		del tr
 		raise
 	except Exception as e:
 		if type(e).__name__ == 'TestSuiteException':
 			rmsg('TEST ERROR: ' + str(e))
+		if hasattr(tr, 'tg'):
+			del tr.tg
+		del tr
 		# if cmdtest.py itself is running under exec_wrapper, re-raise so exec_wrapper can handle exception:
 		if os.getenv('MMGEN_EXEC_WRAPPER') or not os.getenv('MMGEN_IGNORE_TEST_PY_EXCEPTION'):
 			raise

+ 2 - 1
test/cmdtest_py_d/ct_autosign.py

@@ -92,10 +92,11 @@ class CmdTestAutosignBase(CmdTestBase):
 		if hasattr(self,'have_dummy_control_files'):
 			db = LEDControl.boards['dummy']
 			for fn in (db.status, db.trigger):
-				run('sudo rm -f {fn}'.split(), check=True)
+				run(f'sudo rm -f {fn}'.split(), check=True)
 
 		if hasattr(self, 'txdev'):
 			del self.txdev
+
 		if not cfg.no_daemon_stop:
 			if sys.platform == 'darwin':
 				for label in (self.asi.dev_label, self.asi.ramdisk.label):

+ 8 - 9
test/test-release.d/cfg.sh

@@ -68,17 +68,16 @@ init_tests() {
 		- $cmdtest_py dev
 	"
 
+	PYLINT_OPTS='--errors-only --jobs=0'
 	d_lint="code errors with static code analyzer"
 	t_lint="
-		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
+		b $pylint $PYLINT_OPTS mmgen
+		b $pylint $PYLINT_OPTS test
+		b $pylint $PYLINT_OPTS --disable=relative-beyond-top-level test/cmdtest_py_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_py_d
+		- $pylint $PYLINT_OPTS examples
 	"
 
 	if [ "$SKIP_ALT_DEP" ]; then t_lint_skip='b'; else t_lint_skip='a'; fi