Unverified Commit d0354e5e authored by Arthur's avatar Arthur Committed by GitHub
Browse files

[`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
parent 6206f599
...@@ -226,16 +226,16 @@ class CircleCIJob: ...@@ -226,16 +226,16 @@ class CircleCIJob:
test_command += " || true" test_command += " || true"
steps.append({"run": {"name": "Run tests", "command": test_command}}) 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 += '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 ""; ' 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"$(python3 -c '{py_command}'); "
check_test_command += f'cat summary_short.txt; echo ""; exit -1; ' 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 # return code `124` means the previous (pytest run) step is timeout
if self.name == "pr_documentation_tests": if self.name == "pr_documentation_tests":
......
...@@ -300,6 +300,7 @@ class AutomaticSpeechRecognitionPipelineTests(unittest.TestCase): ...@@ -300,6 +300,7 @@ class AutomaticSpeechRecognitionPipelineTests(unittest.TestCase):
self.assertEqual(output, {"text": "A MAN SAID TO THE UNIVERSE SIR I EXIST"}) self.assertEqual(output, {"text": "A MAN SAID TO THE UNIVERSE SIR I EXIST"})
@require_torch @require_torch
@slow
def test_return_timestamps_in_preprocess(self): def test_return_timestamps_in_preprocess(self):
pipe = pipeline( pipe = pipeline(
task="automatic-speech-recognition", task="automatic-speech-recognition",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment