Skip to content

Commit 68c1d33

Browse files
authored
build: Check that all Scala test suites run in PR builds (#2304) (#2366)
1 parent d9014fc commit 68c1d33

File tree

3 files changed

+90
-0
lines changed

3 files changed

+90
-0
lines changed

.github/workflows/pr_build_macos.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ jobs:
112112
org.apache.spark.sql.comet.CometTaskMetricsSuite
113113
org.apache.comet.CometBitwiseExpressionSuite
114114
org.apache.comet.CometMapExpressionSuite
115+
org.apache.comet.objectstore.NativeConfigSuite
115116
fail-fast: false
116117
name: ${{ matrix.os }}/${{ matrix.profile.name }} [${{ matrix.suite.name }}]
117118
runs-on: ${{ matrix.os }}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: Check that all test suites are added to PR workflows
19+
20+
on:
21+
pull_request:
22+
types: [opened, edited, reopened]
23+
24+
jobs:
25+
check-missing-suites:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v5
29+
- name: Check Missing Suites
30+
run: python3 dev/ci/check-suites.py

dev/ci/check-suites.py

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
import sys
19+
from pathlib import Path
20+
21+
def file_to_class_name(path: Path) -> str | None:
22+
parts = path.parts
23+
if "org" not in parts or "apache" not in parts:
24+
return None
25+
org_index = parts.index("org")
26+
package_parts = parts[org_index:]
27+
class_name = ".".join(package_parts)
28+
class_name = class_name.replace(".scala", "")
29+
return class_name
30+
31+
if __name__ == "__main__":
32+
33+
# ignore traits, abstract classes, and intentionally skipped test suites
34+
ignore_list = [
35+
"org.apache.comet.parquet.ParquetReadSuite", # abstract
36+
"org.apache.comet.parquet.ParquetReadFromS3Suite", # manual test suite
37+
"org.apache.spark.sql.comet.CometPlanStabilitySuite", # abstract
38+
"org.apache.spark.sql.comet.ParquetDatetimeRebaseSuite", # abstract
39+
"org.apache.comet.exec.CometColumnarShuffleSuite", # abstract
40+
# TODO add CometToPrettyStringSuite to PR worklows
41+
# https://github.com/apache/datafusion-comet/issues/2307
42+
"org.apache.spark.sql.CometToPrettyStringSuite"
43+
]
44+
45+
for workflow_filename in [".github/workflows/pr_build_linux.yml", ".github/workflows/pr_build_macos.yml"]:
46+
workflow = open(workflow_filename, encoding="utf-8").read()
47+
48+
root = Path(".")
49+
for path in root.rglob("*Suite.scala"):
50+
class_name = file_to_class_name(path)
51+
if class_name:
52+
if "Shim" in class_name:
53+
continue
54+
if class_name in ignore_list:
55+
continue
56+
if class_name not in workflow:
57+
print(f"Suite not found in workflow {workflow_filename}: {class_name}")
58+
sys.exit(-1)
59+
print(f"Found {class_name} in {workflow_filename}")

0 commit comments

Comments
 (0)