Fixed post-exec in validation

This commit is contained in:
2026-03-01 20:10:23 +01:00
parent a05a77842f
commit 986cdb9ed9
2 changed files with 6 additions and 8 deletions

View File

@@ -320,19 +320,18 @@ class TestSet:
def set_post_exec(self): def set_post_exec(self):
post_exec = self._testdict.get("post_execution", None) post_exec = self._testdict.get("post_execution", None)
if post_exec is None: if post_exec is None:
if self.post_exec_file is not None: self.post_exec_file = None
self.post_exec_file = None
return return
postexec_file = post_exec["file_name"] postexec_file = post_exec["file_name"]
if not os.path.isfile(os.path.join(self._testDir, postexec_file)): if not os.path.isfile(os.path.join(tm.gd("test_directory"), postexec_file)):
raise ETUMSyntaxError(f"Post execution file '{postexec_file}' not found") raise ETUMSyntaxError(f"Post execution file '{postexec_file}' not found")
self.post_exec_file = postexec_file self.post_exec_file = postexec_file
def run_post_exec(self): def run_post_exec(self):
tm.print_debug("Is there a post execution file ?")
post_exec_file = self.post_exec_file post_exec_file = self.post_exec_file
test_dir = tm.gd("test_directory") test_dir = tm.gd("test_directory")

View File

@@ -3,7 +3,6 @@ import py_func.tm as tm
import textwrap import textwrap
import sqlite3 import sqlite3
from junit_xml import TestSuite, TestCase from junit_xml import TestSuite, TestCase
from interpreter.test_items.test_result import TestValue
def _prepare_file_to_save(file_name, file_ext=""): def _prepare_file_to_save(file_name, file_ext=""):
@@ -36,10 +35,10 @@ def _get_testSuite(test, cur):
) )
# Check the results of all # Check the results of all
if result[1] == str(TestValue.NORUN): if result[1] == "SKIP":
tc.add_skipped_info("The test has not being runned") tc.add_skipped_info("The test has not being runned")
elif result[2] == f"{test}_PASS": elif result[2] == f"{test}_PASS":
if result[1] == str(TestValue.FAILURE): if result[1] == "FAIL":
failures += 1 failures += 1
print(f"Item [{test}] Failing on '{result[0]}' : The test should PASS") print(f"Item [{test}] Failing on '{result[0]}' : The test should PASS")
print("*" * 80) print("*" * 80)
@@ -47,7 +46,7 @@ def _get_testSuite(test, cur):
print("*" * 80) print("*" * 80)
tc.add_error_info("The test should PASS!\n\n" + result[4]) tc.add_error_info("The test should PASS!\n\n" + result[4])
elif result[2] == f"{test}_FAIL": elif result[2] == f"{test}_FAIL":
if result[1] == str(TestValue.SUCCESS): if result[1] == "PASS":
failures += 1 failures += 1
print( print(
f"Item [{test}] Failing on '{result[0]}' : \n\tThe test should FAIL" f"Item [{test}] Failing on '{result[0]}' : \n\tThe test should FAIL"