Skip to content

Commit

Permalink
Always raise an exception when a design fails in the CI (The-OpenROAD…
Browse files Browse the repository at this point in the history
…-Project#1879)

An exit code of 2 is bypassed. It seems that an exit code that is not 2 is a failure of the python script itself not OpenLane flow. This exception is raised and propagated to the CI. However an exit code of 2 should be propagated as well after a reproducible is made. The CI flow shouldn't attempt to run benchmark when the flow failed.
  • Loading branch information
kareefardi authored Jul 6, 2023
1 parent a0c0945 commit 5998726
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/scripts/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,15 @@

print(f"Running {shlex.join(docker_command)} in {os.getenv('PWD')}…")

run_return_code = 0
run_exception = Exception
try:
subprocess.run(docker_command, check=True)
except subprocess.CalledProcessError as e:
if e.returncode != 2:
print("subprocess error code", e.returncode)
run_exception = e
run_return_code = e.returncode
if run_return_code != 2:
raise e


Expand All @@ -98,6 +103,10 @@ def cat(x):
)
print("Created ./reproducible.tar.gz.")

if run_return_code != 0:
print("Run failed")
raise run_exception

difference_reports = glob.glob(os.path.join(results_folder, f"{test_name}*.rpt"))
if len(difference_reports):
print("Verbose differences within the benchmark:")
Expand Down

0 comments on commit 5998726

Please sign in to comment.