mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-01 18:51:14 +06:00
[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
This commit is contained in:
parent
6206f599e1
commit
d0354e5e86
@ -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):
|
|||||||
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",
|
||||||
|
Loading…
Reference in New Issue
Block a user