From 06ee91aebc3f498a96402a96f2242b5cd3fd627e Mon Sep 17 00:00:00 2001 From: Yih-Dar <2521628+ydshieh@users.noreply.github.com> Date: Fri, 22 Sep 2023 08:56:54 +0200 Subject: [PATCH] Use CircleCI `store_test_results` (#26223) store_test_results Co-authored-by: ydshieh --- .circleci/create_circleci_config.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.circleci/create_circleci_config.py b/.circleci/create_circleci_config.py index ef8e09741f..44fcd02963 100644 --- a/.circleci/create_circleci_config.py +++ b/.circleci/create_circleci_config.py @@ -151,10 +151,13 @@ class CircleCIJob: pytest_flags.append( f"--make-reports={self.name}" if "examples" in self.name else f"--make-reports=tests_{self.name}" ) + + steps.append({"run": {"name": "Create `test-results` directory", "command": "mkdir test-results"}}) + test_command = "" if self.command_timeout: test_command = f"timeout {self.command_timeout} " - test_command += f"python -m pytest -n {self.pytest_num_workers} " + " ".join(pytest_flags) + test_command += f"python -m pytest --junitxml=test-results/junit.xml -n {self.pytest_num_workers} " + " ".join(pytest_flags) if self.parallelism == 1: if self.tests_to_run is None: @@ -256,6 +259,8 @@ class CircleCIJob: steps.append({"run": {"name": "Check test results", "command": check_test_command}}) + steps.append({"store_test_results": {"path": "test-results"}}) + steps.append({"store_artifacts": {"path": "~/transformers/tests_output.txt"}}) steps.append({"store_artifacts": {"path": "~/transformers/reports"}}) job["steps"] = steps