From d0354e5e86842b757cec1ecb7de314a1f2421c1e Mon Sep 17 00:00:00 2001 From: Arthur <48595927+ArthurZucker@users.noreply.github.com> Date: Tue, 5 Sep 2023 20:16:00 +0200 Subject: [PATCH] [`CI`] Fix red CI and ERROR failed should show (#25995) * start with error too * fix ? * start with nit * one more path * use `job_name` * mark pipeline test as slow --- .circleci/create_circleci_config.py | 8 ++++---- .../test_pipelines_automatic_speech_recognition.py | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.circleci/create_circleci_config.py b/.circleci/create_circleci_config.py index 9a19cc0ead..0429b0bce3 100644 --- a/.circleci/create_circleci_config.py +++ b/.circleci/create_circleci_config.py @@ -226,16 +226,16 @@ class CircleCIJob: test_command += " || true" steps.append({"run": {"name": "Run tests", "command": test_command}}) - check_test_command = f'if [ -s reports/tests_{self.name}/failures_short.txt ]; ' + check_test_command = f'if [ -s reports/{self.job_name}/failures_short.txt ]; ' check_test_command += 'then echo "Some test failed!"; echo ""; ' - check_test_command += f'cat reports/tests_{self.name}/failures_short.txt; ' + check_test_command += f'cat reports/{self.job_name}/failures_short.txt; ' check_test_command += 'echo ""; echo ""; ' - py_command = f'import os; fp = open("reports/tests_{self.name}/summary_short.txt"); failed = os.linesep.join([x for x in fp.read().split(os.linesep) if x.startswith("FAILED ")]); fp.close(); fp = open("summary_short.txt", "w"); fp.write(failed); fp.close()' + py_command = f'import os; fp = open("reports/{self.job_name}/summary_short.txt"); failed = os.linesep.join([x for x in fp.read().split(os.linesep) if x.startswith("FAILED ", "ERROR ")]); fp.close(); fp = open("summary_short.txt", "w"); fp.write(failed); fp.close()' check_test_command += f"$(python3 -c '{py_command}'); " check_test_command += f'cat summary_short.txt; echo ""; exit -1; ' - check_test_command += f'elif [ -s reports/tests_{self.name}/stats.txt ]; then echo "All tests pass!"; ' + check_test_command += f'elif [ -s reports/{self.job_name}/stats.txt ]; then echo "All tests pass!"; ' # return code `124` means the previous (pytest run) step is timeout if self.name == "pr_documentation_tests": diff --git a/tests/pipelines/test_pipelines_automatic_speech_recognition.py b/tests/pipelines/test_pipelines_automatic_speech_recognition.py index 9ff171e867..0a90f3e5e3 100644 --- a/tests/pipelines/test_pipelines_automatic_speech_recognition.py +++ b/tests/pipelines/test_pipelines_automatic_speech_recognition.py @@ -300,6 +300,7 @@ class AutomaticSpeechRecognitionPipelineTests(unittest.TestCase): self.assertEqual(output, {"text": "A MAN SAID TO THE UNIVERSE SIR I EXIST"}) @require_torch + @slow def test_return_timestamps_in_preprocess(self): pipe = pipeline( task="automatic-speech-recognition",