diff --git a/.github/workflows/run-standard-tests.yml b/.github/workflows/run-standard-tests.yml index cb6e54ccb..472e6f165 100644 --- a/.github/workflows/run-standard-tests.yml +++ b/.github/workflows/run-standard-tests.yml @@ -9,7 +9,16 @@ name: Run Standard Tests on: workflow_dispatch: pull_request: - paths: [src/**] + paths: + - '**CMakeLists.txt' + - src/**.h + - src/**.cpp + - src/**.java + - src/**.dd + - src/**.inc + - src/**.lex + - src/**.yac + - test/LearningTest/** env: KhiopsBatchMode: true jobs: diff --git a/test/LearningTest/cmd/python/test_khiops.py b/test/LearningTest/cmd/python/test_khiops.py index bdde6f06b..18852150c 100644 --- a/test/LearningTest/cmd/python/test_khiops.py +++ b/test/LearningTest/cmd/python/test_khiops.py @@ -95,6 +95,23 @@ def test(modl_path, samples_path, sample_test): # verifie l'existence du repertoire et du fichier de sample_test # et lance la comparaison pour le sample 'sample_test' + def filter_lines(lines, filtered_pattern): + """retourne les lignes sans celles contenant le pattern en parametre""" + output_lines = [] + for line in lines: + if filtered_pattern not in line: + output_lines.append(line) + return output_lines + + def filter_empty_lines(lines): + """retourne les lignes sans les lignes vides""" + output_lines = [] + for line in lines: + line = line.strip() + if line != "": + output_lines.append(line) + return output_lines + # check MODL path if modl_path != "nul": if not os.path.isfile(modl_path): @@ -290,57 +307,34 @@ def test(modl_path, samples_path, sample_test): # En cas d'anomalie, memorisation du contenu de des sorties standard if stdout != "": - # Pour les test KNI, le stdout contient une ligne avec le nombre de records - ok = False is_kni = "KNI" in modl_path + is_coclustering = "Coclustering" in modl_path + lines = stdout.split("\n") + lines = filter_empty_lines(lines) + # Pour les test KNI, le stdout contient une ligne avec le nombre de records if is_kni: - lines = stdout.split("\n") - ok = len(lines) == 2 and lines[1] == "" - # Cas special pour LearningTest\TestKNITransfer\SmallInstability\VeryLarge - if not ok: - ok = True - for line in lines: - line = line.strip() - if line == "": - continue - if ( - line.find("Recoded record number:") == -1 - and line.find(" stream ") == -1 - ): - ok = False - break + lines = filter_lines(lines, "Recoded record number:") + # Cas particulier du coclustering en mode debug + if is_coclustering: + lines = filter_lines( + lines, "BEWARE: Optimization level set to 0 in debug mode only!!!" + ) + # Exception egalement pour cas des lancement en mode parallele simule + lines = filter_lines(lines, "Warning : simulated parallel mode") # Exception en mode debug, pour les stats memoire if "Memory stats (number of pointers, and memory space)" in stdout: - lines = stdout.split("\n") ok = True # Parcours des lignes pour voir si ce sont bien des messages de stats, y compris en parallel # En parallele, on a l'id du process entre crochets en tete de chaque ligne for line in lines: ok = ( - line == "" - or (line[0] == "[" and line[-1] == "]") + (line[0] == "[" and line[-1] == "]") or "Memory stats (number of pointers, and memory space)" in line or "Alloc: " in line or "Requested: " in line ) - if not ok: - break - # Cas special pour LearningTest\TestKNITransfer\SmallInstability\VeryLarge - if not ok: - ok = True - for line in lines: - line = line.strip() - if line == "": - continue - if ( - line.find("Recoded record number:") == -1 - and line.find(" stream ") == -1 - ): - ok = False - break - # Exception egalement pour cas des lancement en mode parallele simule - if "Warning : simulated parallel mode" in stdout: - ok = True + else: + ok = len(lines) == 0 if not ok: with open( os.path.join(os.getcwd(), test_dir, "results", "stdout_error.log"),