Repository navigation
Keep full-flow steps when generating metadata without QoR checks #4683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
vvbandeira
merged 2 commits into
The-OpenROAD-Project:master
from
vvbandeira:dashboard-qor-target
Oct 15, 2026
+101
−1
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| """Run the real flow helper against a disposable Makefile.""" | ||
|
|
||
| import os | ||
| from pathlib import Path | ||
| import shutil | ||
| import subprocess | ||
| import tempfile | ||
| import unittest | ||
|
|
||
| HELPER = Path(__file__).with_name("test_helper.sh") | ||
|
|
||
|
|
||
| class TestHelper(unittest.TestCase): | ||
| def run_helper(self, target, fail_target=""): | ||
| with tempfile.TemporaryDirectory() as directory: | ||
| flow = Path(directory) | ||
| (flow / "test").mkdir() | ||
| helper = flow / "test/test_helper.sh" | ||
| shutil.copyfile(HELPER, helper) | ||
| (flow / "Makefile").write_text( | ||
| ".PHONY: clean_all clean_metadata finish metadata metadata-generate " | ||
| "metadata-check final_report_issue simulate power\n" | ||
| "metadata: finish metadata-generate metadata-check\n" | ||
| "print-LOG_DIR:\n\t@echo logs/nangate45/gcd/base\n" | ||
| "clean_all clean_metadata finish metadata-generate metadata-check " | ||
| "final_report_issue simulate power:\n" | ||
| "\t@echo $@ >> targets\n" | ||
| f"\t@test '$@' != '{fail_target}'\n" | ||
| ) | ||
| env = dict( | ||
| os.environ, | ||
| TARGET=target, | ||
| MAKE_ISSUE="1", | ||
| PRIVATE_DIR=str(flow / "private"), | ||
| ) | ||
| result = subprocess.run( | ||
| ["bash", str(helper), "gcd", "nangate45"], | ||
| cwd=flow, | ||
| env=env, | ||
| capture_output=True, | ||
| text=True, | ||
| ) | ||
| return result, (flow / "targets").read_text().splitlines() | ||
|
|
||
| def test_metadata_generation_keeps_follow_up_steps(self): | ||
| result, targets = self.run_helper("finish metadata-generate") | ||
| self.assertEqual(result.returncode, 0, result.stderr) | ||
| self.assertEqual( | ||
| targets, | ||
| [ | ||
| "clean_all", | ||
| "clean_metadata", | ||
| "finish", | ||
| "metadata-generate", | ||
| "final_report_issue", | ||
| "simulate", | ||
| "power", | ||
| ], | ||
| ) | ||
|
|
||
| def test_default_target_still_checks_qor(self): | ||
| result, targets = self.run_helper("finish metadata") | ||
| self.assertEqual(result.returncode, 0, result.stderr) | ||
| self.assertIn("metadata-check", targets) | ||
| self.assertEqual(targets[-3:], ["final_report_issue", "simulate", "power"]) | ||
|
|
||
| def test_custom_target_still_stops_after_that_target(self): | ||
| result, targets = self.run_helper("finish") | ||
| self.assertEqual(result.returncode, 0, result.stderr) | ||
| self.assertEqual(targets, ["clean_all", "clean_metadata", "finish"]) | ||
|
|
||
| def test_failed_generation_is_not_a_pass(self): | ||
| result, targets = self.run_helper( | ||
| "finish metadata-generate", "metadata-generate" | ||
| ) | ||
| self.assertNotEqual(result.returncode, 0) | ||
| self.assertNotIn("simulate", targets) | ||
| self.assertNotIn("power", targets) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| unittest.main() | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inheriting the entire
os.environwithout filtering can make the test non-hermetic and prone to flakiness if variables likeWORK_HOME,FLOW_VARIANT, or other flow-related environment variables are set in the host environment. Filtering these out ensures the test runs in a clean, controlled environment.