diff --git a/.circleci/create_circleci_config.py b/.circleci/create_circleci_config.py index ef8e09741f1274..44fcd029633ba3 100644 --- a/.circleci/create_circleci_config.py +++ b/.circleci/create_circleci_config.py @@ -151,10 +151,13 @@ def to_dict(self): 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 @@ def to_dict(self): 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