Skip to content

Commit 4dd0c0c

Browse files
committed
Merge branch 'main' into xegpu_enable_convert_layout
2 parents d8035af + 4bf82ae commit 4dd0c0c

File tree

8,796 files changed

+599651
-306618
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

8,796 files changed

+599651
-306618
lines changed

.ci/generate_test_report_github.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
parser.add_argument("junit_files", help="Paths to JUnit report files.", nargs="*")
1717
args = parser.parse_args()
1818

19-
report, _ = generate_test_report_lib.generate_report_from_files(
20-
args.title, args.return_code, args.junit_files, None
19+
report = generate_test_report_lib.generate_report_from_files(
20+
args.title, args.return_code, args.junit_files
2121
)
2222

2323
print(report)

.ci/generate_test_report_lib.py

Lines changed: 33 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55

66
from junitparser import JUnitXml, Failure
77

8+
SEE_BUILD_FILE_STR = "Download the build's log file to see the details."
9+
UNRELATED_FAILURES_STR = (
10+
"If these failures are unrelated to your changes (for example "
11+
"tests are broken or flaky at HEAD), please open an issue at "
12+
"https://github.com/llvm/llvm-project/issues and add the "
13+
"`infrastructure` label."
14+
)
15+
816

917
# Set size_limit to limit the byte size of the report. The default is 1MB as this
1018
# is the most that can be put into an annotation. If the generated report exceeds
@@ -18,16 +26,7 @@ def generate_report(
1826
junit_objects,
1927
size_limit=1024 * 1024,
2028
list_failures=True,
21-
buildkite_info=None,
2229
):
23-
if not junit_objects:
24-
# Note that we do not post an empty report, therefore we can ignore a
25-
# non-zero return code in situations like this.
26-
#
27-
# If we were going to post a report, then yes, it would be misleading
28-
# to say we succeeded when the final return code was non-zero.
29-
return ("", "success")
30-
3130
failures = {}
3231
tests_run = 0
3332
tests_skipped = 0
@@ -51,16 +50,28 @@ def generate_report(
5150
(test.classname + "/" + test.name, test.result[0].text)
5251
)
5352

54-
if not tests_run:
55-
return ("", None)
56-
57-
style = "success"
58-
# Either tests failed, or all tests passed but something failed to build.
59-
if tests_failed or return_code != 0:
60-
style = "error"
61-
6253
report = [f"# {title}", ""]
6354

55+
if tests_run == 0:
56+
if return_code == 0:
57+
report.extend(
58+
[
59+
"The build succeeded and no tests ran. This is expected in some "
60+
"build configurations."
61+
]
62+
)
63+
else:
64+
report.extend(
65+
[
66+
"The build failed before running any tests.",
67+
"",
68+
SEE_BUILD_FILE_STR,
69+
"",
70+
UNRELATED_FAILURES_STR,
71+
]
72+
)
73+
return "\n".join(report)
74+
6475
tests_passed = tests_run - tests_skipped - tests_failed
6576

6677
def plural(num_tests):
@@ -73,22 +84,12 @@ def plural(num_tests):
7384
if tests_failed:
7485
report.append(f"* {tests_failed} {plural(tests_failed)} failed")
7586

76-
if buildkite_info is not None:
77-
log_url = (
78-
"https://buildkite.com/organizations/{BUILDKITE_ORGANIZATION_SLUG}/"
79-
"pipelines/{BUILDKITE_PIPELINE_SLUG}/builds/{BUILDKITE_BUILD_NUMBER}/"
80-
"jobs/{BUILDKITE_JOB_ID}/download.txt".format(**buildkite_info)
81-
)
82-
download_text = f"[Download]({log_url})"
83-
else:
84-
download_text = "Download"
85-
8687
if not list_failures:
8788
report.extend(
8889
[
8990
"",
9091
"Failed tests and their output was too large to report. "
91-
f"{download_text} the build's log file to see the details.",
92+
+ SEE_BUILD_FILE_STR,
9293
]
9394
)
9495
elif failures:
@@ -118,20 +119,12 @@ def plural(num_tests):
118119
"",
119120
"All tests passed but another part of the build **failed**.",
120121
"",
121-
f"{download_text} the build's log file to see the details.",
122+
SEE_BUILD_FILE_STR,
122123
]
123124
)
124125

125126
if failures or return_code != 0:
126-
report.extend(
127-
[
128-
"",
129-
"If these failures are unrelated to your changes (for example "
130-
"tests are broken or flaky at HEAD), please open an issue at "
131-
"https://github.com/llvm/llvm-project/issues and add the "
132-
"`infrastructure` label.",
133-
]
134-
)
127+
report.extend(["", UNRELATED_FAILURES_STR])
135128

136129
report = "\n".join(report)
137130
if len(report.encode("utf-8")) > size_limit:
@@ -141,16 +134,14 @@ def plural(num_tests):
141134
junit_objects,
142135
size_limit,
143136
list_failures=False,
144-
buildkite_info=buildkite_info,
145137
)
146138

147-
return report, style
139+
return report
148140

149141

150-
def generate_report_from_files(title, return_code, junit_files, buildkite_info):
142+
def generate_report_from_files(title, return_code, junit_files):
151143
return generate_report(
152144
title,
153145
return_code,
154146
[JUnitXml.fromfile(p) for p in junit_files],
155-
buildkite_info=buildkite_info,
156147
)

.ci/generate_test_report_lib_test.py

Lines changed: 42 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,28 @@ def junit_from_xml(xml):
2121
class TestReports(unittest.TestCase):
2222
def test_title_only(self):
2323
self.assertEqual(
24-
generate_test_report_lib.generate_report("Foo", 0, []), ("", "success")
24+
generate_test_report_lib.generate_report("Foo", 0, []),
25+
dedent(
26+
"""\
27+
# Foo
28+
29+
The build succeeded and no tests ran. This is expected in some build configurations."""
30+
),
31+
)
32+
33+
def test_title_only_failure(self):
34+
self.assertEqual(
35+
generate_test_report_lib.generate_report("Foo", 1, []),
36+
dedent(
37+
"""\
38+
# Foo
39+
40+
The build failed before running any tests.
41+
42+
Download the build's log file to see the details.
43+
44+
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
45+
),
2546
)
2647

2748
def test_no_tests_in_testsuite(self):
@@ -42,7 +63,16 @@ def test_no_tests_in_testsuite(self):
4263
)
4364
],
4465
),
45-
("", None),
66+
dedent(
67+
"""\
68+
# Foo
69+
70+
The build failed before running any tests.
71+
72+
Download the build's log file to see the details.
73+
74+
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
75+
),
4676
)
4777

4878
def test_no_failures(self):
@@ -70,8 +100,7 @@ def test_no_failures(self):
70100
# Foo
71101
72102
* 1 test passed"""
73-
),
74-
"success",
103+
)
75104
),
76105
)
77106

@@ -93,12 +122,6 @@ def test_no_failures_build_failed(self):
93122
)
94123
)
95124
],
96-
buildkite_info={
97-
"BUILDKITE_ORGANIZATION_SLUG": "organization_slug",
98-
"BUILDKITE_PIPELINE_SLUG": "pipeline_slug",
99-
"BUILDKITE_BUILD_NUMBER": "build_number",
100-
"BUILDKITE_JOB_ID": "job_id",
101-
},
102125
),
103126
(
104127
dedent(
@@ -109,11 +132,10 @@ def test_no_failures_build_failed(self):
109132
110133
All tests passed but another part of the build **failed**.
111134
112-
[Download](https://buildkite.com/organizations/organization_slug/pipelines/pipeline_slug/builds/build_number/jobs/job_id/download.txt) the build's log file to see the details.
135+
Download the build's log file to see the details.
113136
114137
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
115-
),
116-
"error",
138+
)
117139
),
118140
)
119141

@@ -174,14 +196,12 @@ def test_report_single_file_single_testsuite(self):
174196
</details>
175197
176198
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
177-
),
178-
"error",
199+
)
179200
),
180201
)
181202

182-
MULTI_SUITE_OUTPUT = (
183-
dedent(
184-
"""\
203+
MULTI_SUITE_OUTPUT = dedent(
204+
"""\
185205
# ABC and DEF
186206
187207
* 1 test passed
@@ -210,8 +230,6 @@ def test_report_single_file_single_testsuite(self):
210230
</details>
211231
212232
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
213-
),
214-
"error",
215233
)
216234

217235
def test_report_single_file_multiple_testsuites(self):
@@ -320,8 +338,7 @@ def test_report_dont_list_failures(self):
320338
Failed tests and their output was too large to report. Download the build's log file to see the details.
321339
322340
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
323-
),
324-
"error",
341+
)
325342
),
326343
)
327344

@@ -346,12 +363,6 @@ def test_report_dont_list_failures_link_to_log(self):
346363
)
347364
],
348365
list_failures=False,
349-
buildkite_info={
350-
"BUILDKITE_ORGANIZATION_SLUG": "organization_slug",
351-
"BUILDKITE_PIPELINE_SLUG": "pipeline_slug",
352-
"BUILDKITE_BUILD_NUMBER": "build_number",
353-
"BUILDKITE_JOB_ID": "job_id",
354-
},
355366
),
356367
(
357368
dedent(
@@ -360,11 +371,10 @@ def test_report_dont_list_failures_link_to_log(self):
360371
361372
* 1 test failed
362373
363-
Failed tests and their output was too large to report. [Download](https://buildkite.com/organizations/organization_slug/pipelines/pipeline_slug/builds/build_number/jobs/job_id/download.txt) the build's log file to see the details.
374+
Failed tests and their output was too large to report. Download the build's log file to see the details.
364375
365376
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
366-
),
367-
"error",
377+
)
368378
),
369379
)
370380

@@ -403,7 +413,6 @@ def test_report_size_limit(self):
403413
Failed tests and their output was too large to report. Download the build's log file to see the details.
404414
405415
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
406-
),
407-
"error",
416+
)
408417
),
409418
)

.ci/monolithic-linux.sh

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@ rm -rf "${BUILD_DIR}"
2323

2424
ccache --zero-stats
2525

26-
if [[ -n "${CLEAR_CACHE:-}" ]]; then
27-
echo "clearing cache"
28-
ccache --clear
29-
fi
30-
3126
mkdir -p artifacts/reproducers
3227

3328
# Make sure any clang reproducers will end up as artifacts.
@@ -56,7 +51,7 @@ runtime_targets_needs_reconfig="${5}"
5651

5752
lit_args="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-output-file-name --timeout=1200 --time-tests"
5853

59-
echo "--- cmake"
54+
echo "::group::cmake"
6055
export PIP_BREAK_SYSTEM_PACKAGES=1
6156
pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt
6257

@@ -85,38 +80,49 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
8580
-D LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS=ON \
8681
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
8782

88-
echo "--- ninja"
83+
echo "::endgroup::"
84+
echo "::group::ninja"
85+
8986
# Targets are not escaped as they are passed as separate arguments.
9087
ninja -C "${BUILD_DIR}" -k 0 ${targets}
9188

89+
echo "::endgroup::"
90+
9291
if [[ "${runtime_targets}" != "" ]]; then
93-
echo "--- ninja runtimes"
92+
echo "::group::ninja runtimes"
9493

9594
ninja -C "${BUILD_DIR}" ${runtime_targets}
95+
96+
echo "::endgroup::"
9697
fi
9798

9899
# Compiling runtimes with just-built Clang and running their tests
99100
# as an additional testing for Clang.
100101
if [[ "${runtime_targets_needs_reconfig}" != "" ]]; then
101-
echo "--- cmake runtimes C++26"
102+
echo "::group::cmake runtimes C++26"
102103

103104
cmake \
104105
-D LIBCXX_TEST_PARAMS="std=c++26" \
105106
-D LIBCXXABI_TEST_PARAMS="std=c++26" \
106107
"${BUILD_DIR}"
107108

108-
echo "--- ninja runtimes C++26"
109+
echo "::endgroup::"
110+
echo "::group::ninja runtimes C++26"
109111

110112
ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig}
111113

112-
echo "--- cmake runtimes clang modules"
114+
echo "::endgroup::"
115+
echo "::group::cmake runtimes clang modules"
113116

114117
cmake \
115118
-D LIBCXX_TEST_PARAMS="enable_modules=clang" \
116119
-D LIBCXXABI_TEST_PARAMS="enable_modules=clang" \
117120
"${BUILD_DIR}"
118121

119-
echo "--- ninja runtimes clang modules"
122+
echo "::endgroup::"
123+
echo "::group::ninja runtimes clang modules"
120124

121125
ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig}
126+
127+
echo "::endgroup::"
122128
fi

0 commit comments

Comments
 (0)