Skip to content
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

test: Enable to run CI with custom CPU templates for testing / debugging purpose #4944

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: Enable to test custom CPU templates w/o python code modification
Previously to test custom CPU templates for temporary testing purpose in
development, we needed to modify Python code (especially
tests/framework/utils_cpu_templates.py) manually. That is very
cumbersome and slows down our development / test / debug cycle, since it
requires us to make a commit and push it manually.

With this change, we become able to inject custom CPU templates into
test (not only from local but also from buildkite) without modifying
python code.

Signed-off-by: Takahiro Itazuri <[email protected]>
zulinx86 committed Dec 5, 2024
commit 1e4002f77ac34d4e5ad7c956b162d0c329df3709
Empty file.
9 changes: 9 additions & 0 deletions tests/framework/utils_cpu_templates.py
Original file line number Diff line number Diff line change
@@ -64,13 +64,22 @@ def get_supported_custom_cpu_templates():

def custom_cpu_templates_params():
"""Return Custom CPU templates as pytest parameters"""
# Return custom CPU templates that are equivalent to the supported static CPU templates.
for name in sorted(get_supported_custom_cpu_templates()):
tmpl = Path(f"./data/static_cpu_templates/{name.lower()}.json")
yield pytest.param(
{"name": name, "template": json.loads(tmpl.read_text("utf-8"))},
id="custom_" + name,
)

# Return custom CPU templates for temporary testing purpose.
for tmpl in Path("./data/custom_cpu_templates").glob("*.json"):
name = tmpl.stem
yield pytest.param(
{"name": name, "template": json.loads(tmpl.read_text("utf-8"))},
id="custom_" + name,
)


def static_cpu_templates_params():
"""Return Static CPU templates as pytest parameters"""