Copilot commented on code in PR #13224:
URL: https://github.com/apache/gluten/pull/13224#discussion_r4249595850
##########
backends-velox/pom.xml:
##########
@@ -581,6 +632,114 @@
<scope>test</scope>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>compile-iceberg-coverage-listener</id>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <phase>process-test-classes</phase>
+ <configuration>
+ <target>
+ <!-- Compile only the observer and its tests, without
copied upstream classes. -->
+ <mkdir dir="${iceberg.upstream.test.classes}"/>
+ <!-- Some upstream tests resolve classpath fixtures as
filesystem paths. -->
+ <unzip dest="${iceberg.upstream.test.classes}">
+ <restrict>
+ <path refid="maven.test.classpath"/>
+ <name name="**/org/apache/iceberg/*-tests.jar"/>
+ </restrict>
+ <patternset
excludes="**/*.class,META-INF/**,LICENSE,NOTICE,iceberg-build.properties"/>
+ </unzip>
+ <javac destdir="${iceberg.upstream.test.classes}"
encoding="UTF-8" includeantruntime="false" release="17">
+ <src
path="${project.basedir}/src-iceberg-upstream/test/java"/>
+ <src
path="${project.basedir}/../gluten-ut/src-iceberg-upstream/test/java"/>
+ <classpath refid="maven.test.classpath"/>
+ </javac>
+ <copy todir="${iceberg.upstream.test.classes}">
+ <fileset
dir="${project.basedir}/src-iceberg-upstream/test/resources"/>
+ </copy>
+ </target>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>iceberg-upstream</id>
+ <configuration>
+ <!-- Only the coverage listener is shared with the unchanged
upstream tests. -->
+
<testClassesDirectory>${iceberg.upstream.test.classes}</testClassesDirectory>
+ <classpathDependencyExcludes>
+
<classpathDependencyExclude>org.apache.iceberg:iceberg-spark-runtime-*</classpathDependencyExclude>
+
<classpathDependencyExclude>org.apache.avro:avro</classpathDependencyExclude>
+
<classpathDependencyExclude>org.apache.parquet:*</classpathDependencyExclude>
+
<classpathDependencyExclude>org.apache.datasketches:*</classpathDependencyExclude>
+
<classpathDependencyExclude>org.apache.orc:orc-core</classpathDependencyExclude>
+
<classpathDependencyExclude>org.apache.orc:orc-shims</classpathDependencyExclude>
+
<classpathDependencyExclude>org.mockito:*</classpathDependencyExclude>
+
<classpathDependencyExclude>net.bytebuddy:*</classpathDependencyExclude>
+
<classpathDependencyExclude>org.objenesis:*</classpathDependencyExclude>
+ </classpathDependencyExcludes>
+ <!-- Use Iceberg's Avro, Parquet, DataSketches and nohive
ORC runtime. -->
+ <additionalClasspathDependencies>
+ <dependency>
+ <groupId>org.apache.iceberg</groupId>
+
<artifactId>iceberg-spark-${sparkbundle.version}_${scala.binary.version}</artifactId>
+ <version>${iceberg.version}</version>
+ </dependency>
+ <!-- Iceberg 1.10/1.11 use Mockito 4.11, including static
mocks. -->
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-inline</artifactId>
+ <version>4.11.0</version>
+ </dependency>
+ </additionalClasspathDependencies>
Review Comment:
Maven Surefire does not consistently support an
`additionalClasspathDependencies` configuration element; unknown elements are
typically ignored, which would prevent `mockito-inline` (and any other deps
here) from being added to the test runtime classpath and can cause upstream
tests to fail at runtime. Prefer declaring these as normal `<dependency>`
entries (e.g., add `mockito-inline` to the `iceberg-upstream-test` profile
`<dependencies>`) and remove this block, or switch to a supported Surefire
mechanism (like `additionalClasspathElements`) if you need plugin-level
classpath injection.
##########
.github/workflows/util/iceberg-upstream/summarize.py:
##########
@@ -0,0 +1,223 @@
+#!/usr/bin/env python3
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Join execution evidence with JUnit outcomes; missing evidence is never a
native pass."""
+
+import collections
+import csv
+import json
+import os
+from pathlib import Path
+import sys
+import xml.etree.ElementTree as ET
+
+STATUSES = (
+ "PASSED_NATIVE",
+ "PASSED_FALLBACK",
+ "FAILED",
+ "NO_ICEBERG_EXECUTION",
+ "PASSED_UNVERIFIED",
+ "SKIPPED",
+ "COVERAGE_ERROR",
+)
+REPORT_VERSION = 2
+
+
+def native_proven(row):
+ return (
+ row.get("body_started") is True
+ and bool(row.get("native"))
+ and not row.get("fallback")
+ and not row.get("unverified")
+ and not row.get("failed_queries")
+ and not row.get("expected_exception")
+ and all(
+ any(value > 0 for value in entry.get("metrics", {}).values())
+ for entry in row.get("native_metrics", [])
+ )
+ and set(row["native"])
+ <= {entry.get("node") for entry in row.get("native_metrics", [])}
+ )
+
+
+def classify(directory):
+ evidence = {}
+ for path in sorted(directory.glob("coverage-*.jsonl")):
+ for line in path.read_text().splitlines():
+ row = json.loads(line)
+ # Surefire drops empty parentheses for ordinary @Test methods, but
retains the
+ # signature and invocation index for parameterized/template tests.
+ name = row["name"]
+ key = (row["class"], name[:-2] if name.endswith("()") else name)
+ if key in evidence:
+ raise ValueError(f"Duplicate execution coverage for {key}")
+ evidence[key] = row
+
+ results, seen = [], set()
+ for path in sorted(directory.glob("TEST-*.xml")):
+ for test in ET.parse(path).getroot().iter("testcase"):
+ key = (test.get("classname", ""), test.get("name", ""))
+ if not key[0].startswith("org.apache.iceberg."):
+ continue
+ if key in seen:
+ raise ValueError(f"Duplicate JUnit result: {key}")
+ seen.add(key)
+ row = dict(evidence.get(key, {}), **{"class": key[0], "name":
key[1]})
+ failure = test.find("failure")
+ if failure is None:
+ failure = test.find("error")
+ if failure is not None:
+ row.update(
+ status="FAILED",
+ failure=failure.get("message", ""),
+ failure_type=failure.get("type", ""),
+ )
+ if key not in evidence:
+ row["coverage_error"] = (
+ "Failure before per-test observation; check test setup
or fork logs"
+ )
+ elif test.find("skipped") is not None:
+ row["status"] = "SKIPPED"
+ elif row.get("coverage_error") or row.get("status") not in (
+ "PASSED_NATIVE",
+ "PASSED_FALLBACK",
+ "NO_ICEBERG_EXECUTION",
+ "PASSED_UNVERIFIED",
+ ):
+ row["coverage_error"] = (
+ row.get("coverage_error")
+ or "Missing or inconsistent execution evidence"
+ )
+ elif row["status"] == "PASSED_NATIVE" and not native_proven(row):
+ row["coverage_error"] = (
+ "Native label without successful test-body executor
evidence"
+ )
+ if row.get("coverage_error"):
+ row["status"] = "COVERAGE_ERROR"
+ results.append(row)
+ if not results:
+ raise ValueError("No upstream Iceberg JUnit results found")
+ if evidence.keys() - seen:
+ raise ValueError(
+ f"Execution evidence without JUnit result: {sorted(evidence.keys()
- seen)}"
+ )
+ return results
+
+
+def write_reports(directory, results, label="Iceberg execution coverage"):
+ counts = collections.Counter(row["status"] for row in results)
+ summary = {status: counts[status] for status in STATUSES}
+ (directory / "execution-coverage.json").write_text(
+ json.dumps(
+ {
+ "version": REPORT_VERSION,
+ "scope": "test-body Iceberg I/O",
+ "counts": summary,
+ "tests": results,
+ },
+ indent=2,
+ )
+ + "\n"
+ )
+ columns = (
+ "status",
+ "class",
+ "test",
+ "parameters",
+ "parameter_values",
Review Comment:
The CSV header names don’t align with the values written later: the 4th
value written is `display_name` (line 179) but the header is `parameters`,
while actual `row.get('parameters', {})` is written under `parameter_values`.
This makes the exported CSVs confusing for downstream consumers. Rename/reorder
the `columns` tuple so each header matches the actual value written (e.g., use
`display_name` for the current 4th column and `parameters` for the JSON-encoded
dict).
##########
.github/workflows/velox_native_build.yml:
##########
@@ -0,0 +1,87 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name: Velox native build
+
+on:
+ workflow_call:
+ inputs:
+ revision:
+ required: true
+ type: string
+ artifact:
+ required: true
+ type: string
+ image:
+ type: string
+ default: apache/gluten:vcpkg-almalinux-8-gcc13
+ save-cache:
+ type: boolean
+ default: false
+
+jobs:
+ build:
+ # A cache miss must be able to finish, using the same timeout allowance as
main.
+ runs-on: ubuntu-22.04
+ container: ${{ inputs.image }}
+ env:
+ ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
+ CCACHE_DIR: '${{ github.workspace }}/.ccache'
+ steps:
+ - name: Install CI tools (temporary - until image is rebuilt with
gh/jq/bison/python3.9)
+ run: |
+ dnf install -y jq bison tzdata
+ dnf module -y install python39 && alternatives --set python3
/usr/bin/python3.9
+ dnf config-manager --add-repo
https://cli.github.com/packages/rpm/gh-cli.repo
+ dnf install -y gh --setopt=gpgcheck=0
Review Comment:
Disabling RPM GPG verification (`--setopt=gpgcheck=0`) weakens supply-chain
integrity for the `gh` installation step. Prefer keeping signature verification
enabled (import the repository signing key / use a trusted base image that
already contains `gh`), or pin to a verified package source to avoid installing
unsigned artifacts during CI.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]