Skip to content

Commit

Permalink
Use CircleCI store_test_results (huggingface#26223)
Browse files Browse the repository at this point in the history
store_test_results

Co-authored-by: ydshieh <[email protected]>
  • Loading branch information
2 people authored and EduardoPach committed Nov 18, 2023
1 parent 0e5caff commit d5f8f60
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .circleci/create_circleci_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d5f8f60

Please sign in to comment.