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

Add option to save commit hash in report #917

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 10 additions & 3 deletions run_conformance_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,13 @@ def handle_args(argv):
help='Skip build step and perform only testing for already compiled tests.',
required=False,
action='store_true')
parser.add_argument('--commit-hash',
help='Original SYCL-CTS commit hash used for the run',
type=str,
required=False)
args = parser.parse_args(argv)

commit_hash = args.commit_hash if args.commit_hash else 'Not specified'
full_conformance = 'OFF' if args.fast else 'ON'
test_deprecated_features = 'OFF' if args.disable_deprecated_features else 'ON'
full_feature_set = 'OFF' if args.reduced_feature_set else 'ON'
Expand All @@ -103,7 +108,7 @@ def handle_args(argv):
full_conformance, test_deprecated_features, args.exclude_categories,
args.implementation_name, args.additional_cmake_args, args.device,
args.additional_ctest_args, args.build_only, args.run_only,
full_feature_set)
commit_hash, full_feature_set)


def split_additional_args(additional_args):
Expand Down Expand Up @@ -247,7 +252,7 @@ def get_xml_test_results():
def update_xml_attribs(info_json, implementation_name, test_xml_root,
full_conformance, cmake_call, build_system_name,
build_system_call, ctest_call, test_deprecated_features,
full_feature_set):
commit_hash, full_feature_set):
"""
Adds attributes to the root of the xml trees json required by the
conformance report.
Expand All @@ -274,6 +279,7 @@ def update_xml_attribs(info_json, implementation_name, test_xml_root,
test_xml_root.attrib["DeviceFP64"] = info_json['device-fp64']

# Set Build Information attribs
test_xml_root.attrib["CommitHash"] = commit_hash
test_xml_root.attrib["FullConformanceMode"] = full_conformance
test_xml_root.attrib["CMakeInput"] = ' '.join(cmake_call)
test_xml_root.attrib["BuildSystemGenerator"] = build_system_name
Expand All @@ -291,7 +297,7 @@ def main(argv=sys.argv[1:]):
(cmake_exe, build_system_name, build_system_call, full_conformance,
test_deprecated_features, exclude_categories, implementation_name,
additional_cmake_args, device, additional_ctest_args,
build_only, run_only, full_feature_set) = handle_args(argv)
build_only, run_only, commit_hash, full_feature_set) = handle_args(argv)

# Generate a cmake call in a form accepted by subprocess.call()
cmake_call = generate_cmake_call(cmake_exe, build_system_name,
Expand Down Expand Up @@ -326,6 +332,7 @@ def main(argv=sys.argv[1:]):
cmake_call, build_system_name,
build_system_call, ctest_call,
test_deprecated_features,
commit_hash,
full_feature_set)

# Get the xml report stylesheet and add it to the results.
Expand Down
1 change: 1 addition & 0 deletions tools/stylesheet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
<tr><td>Half Precision Floating Point</td><td><xsl:value-of select="./@DeviceFP16" /></td></tr>
<tr><td>Double Precision Floating Point</td><td><xsl:value-of select="./@DeviceFP64" /></td></tr>
<tr><td class="site-header" colspan="2">Build Information</td></tr>
<tr><td>SYCL-CTS commit hash</td><td><xsl:value-of select="./@CommitHash"/></td></tr>
<tr><td>Full Conformance Mode</td><td><xsl:value-of select="./@FullConformanceMode" /></td></tr>
<tr><td>CMake Input</td><td><xsl:value-of select="./@CMakeInput" /></td></tr>
<tr><td>Build System Generator</td><td><xsl:value-of select="./@BuildSystemGenerator" /></td></tr>
Expand Down
Loading