|
| 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