martin-g commented on code in PR #2686: URL: https://github.com/apache/datafusion-comet/pull/2686#discussion_r2509122654
########## fuzz-testing/run.sh: ########## @@ -0,0 +1,73 @@ +#!/bin/bash +# +# 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. +# + +set -eux + +DIR="$(cd "$(dirname "$0")" && pwd)" +PARENT_DIR="${DIR}/.." +SPARK_MASTER="${SPARK_MASTER:-local[*]}" +PROJECT_VERSION="$(mvn -q help:evaluate -Dexpression=project.version -DforceStdout)" Review Comment: use `mvn -f ...` here too for stability. ########## fuzz-testing/run.sh: ########## @@ -0,0 +1,73 @@ +#!/bin/bash +# +# 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. +# + +set -eux + +DIR="$(cd "$(dirname "$0")" && pwd)" +PARENT_DIR="${DIR}/.." +SPARK_MASTER="${SPARK_MASTER:-local[*]}" +PROJECT_VERSION="$(mvn -q help:evaluate -Dexpression=project.version -DforceStdout)" +COMET_SPARK_ARTIFACT_ID="$(mvn -f ${PARENT_DIR}/spark/pom.xml -q help:evaluate -Dexpression=project.artifactId -DforceStdout)" +COMET_SPARK_JAR="${PARENT_DIR}/spark/target/${COMET_SPARK_ARTIFACT_ID}-${PROJECT_VERSION}.jar" +COMET_FUZZ_ARTIFACT_ID="$(mvn -f ${DIR}/pom.xml -q help:evaluate -Dexpression=project.artifactId -DforceStdout)" +COMET_FUZZ_JAR="${DIR}/target/${COMET_FUZZ_ARTIFACT_ID}-${PROJECT_VERSION}-jar-with-dependencies.jar" +NUM_FILES="${NUM_FILES:-2}" +NUM_ROWS="${NUM_ROWS:-200}" +NUM_QUERIES="${NUM_QUERIES:-500}" + +if [ ! -f "${COMET_SPARK_JAR}" ]; then + echo "Building Comet Spark jar..." + make -f "${PARENT_DIR}/Makefile" +else + echo "Building Fuzz testing jar..." + mvn package -DskipTests Review Comment: Also IMO it would be good to always build the Fuzz testing jar. Since the user runs this script (s)he wants the latest version of the fuzz jar. Just let Maven decide whether it needs to re-compile it. ########## fuzz-testing/run.sh: ########## @@ -0,0 +1,73 @@ +#!/bin/bash +# +# 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. +# + +set -eux + +DIR="$(cd "$(dirname "$0")" && pwd)" +PARENT_DIR="${DIR}/.." +SPARK_MASTER="${SPARK_MASTER:-local[*]}" +PROJECT_VERSION="$(mvn -q help:evaluate -Dexpression=project.version -DforceStdout)" +COMET_SPARK_ARTIFACT_ID="$(mvn -f ${PARENT_DIR}/spark/pom.xml -q help:evaluate -Dexpression=project.artifactId -DforceStdout)" +COMET_SPARK_JAR="${PARENT_DIR}/spark/target/${COMET_SPARK_ARTIFACT_ID}-${PROJECT_VERSION}.jar" +COMET_FUZZ_ARTIFACT_ID="$(mvn -f ${DIR}/pom.xml -q help:evaluate -Dexpression=project.artifactId -DforceStdout)" Review Comment: ```suggestion COMET_FUZZ_ARTIFACT_ID="$(mvn -f \"${DIR}/pom.xml\" -q help:evaluate -Dexpression=project.artifactId -DforceStdout)" || { echo "Error: Failed to retrieve the Fuzz project artifactId from Maven" >&2 exit 1 } ``` ########## fuzz-testing/run.sh: ########## @@ -0,0 +1,73 @@ +#!/bin/bash +# +# 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. +# + +set -eux + +DIR="$(cd "$(dirname "$0")" && pwd)" +PARENT_DIR="${DIR}/.." +SPARK_MASTER="${SPARK_MASTER:-local[*]}" +PROJECT_VERSION="$(mvn -q help:evaluate -Dexpression=project.version -DforceStdout)" Review Comment: Also use `${PARENT_DIR}/mvnw` instead of `mvn` to not require globally installed Maven. ########## fuzz-testing/run.sh: ########## @@ -0,0 +1,73 @@ +#!/bin/bash +# +# 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. +# + +set -eux + +DIR="$(cd "$(dirname "$0")" && pwd)" +PARENT_DIR="${DIR}/.." +SPARK_MASTER="${SPARK_MASTER:-local[*]}" +PROJECT_VERSION="$(mvn -q help:evaluate -Dexpression=project.version -DforceStdout)" Review Comment: ```suggestion PROJECT_VERSION="$(mvn -q help:evaluate -Dexpression=project.version -DforceStdout)" || { echo "Error: Failed to retrieve the project version from Maven" >&2 exit 1 } ``` ########## fuzz-testing/run.sh: ########## @@ -0,0 +1,73 @@ +#!/bin/bash +# +# 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. +# + +set -eux + +DIR="$(cd "$(dirname "$0")" && pwd)" +PARENT_DIR="${DIR}/.." +SPARK_MASTER="${SPARK_MASTER:-local[*]}" +PROJECT_VERSION="$(mvn -q help:evaluate -Dexpression=project.version -DforceStdout)" +COMET_SPARK_ARTIFACT_ID="$(mvn -f ${PARENT_DIR}/spark/pom.xml -q help:evaluate -Dexpression=project.artifactId -DforceStdout)" +COMET_SPARK_JAR="${PARENT_DIR}/spark/target/${COMET_SPARK_ARTIFACT_ID}-${PROJECT_VERSION}.jar" +COMET_FUZZ_ARTIFACT_ID="$(mvn -f ${DIR}/pom.xml -q help:evaluate -Dexpression=project.artifactId -DforceStdout)" +COMET_FUZZ_JAR="${DIR}/target/${COMET_FUZZ_ARTIFACT_ID}-${PROJECT_VERSION}-jar-with-dependencies.jar" +NUM_FILES="${NUM_FILES:-2}" +NUM_ROWS="${NUM_ROWS:-200}" +NUM_QUERIES="${NUM_QUERIES:-500}" + +if [ ! -f "${COMET_SPARK_JAR}" ]; then + echo "Building Comet Spark jar..." + make -f "${PARENT_DIR}/Makefile" +else + echo "Building Fuzz testing jar..." + mvn package -DskipTests Review Comment: This may fail to find the pom.xml if the script is executed from a directory different than $DIR. Better use `mvn -f ...` here too ########## fuzz-testing/run.sh: ########## @@ -0,0 +1,73 @@ +#!/bin/bash +# +# 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. +# + +set -eux + +DIR="$(cd "$(dirname "$0")" && pwd)" +PARENT_DIR="${DIR}/.." +SPARK_MASTER="${SPARK_MASTER:-local[*]}" +PROJECT_VERSION="$(mvn -q help:evaluate -Dexpression=project.version -DforceStdout)" +COMET_SPARK_ARTIFACT_ID="$(mvn -f ${PARENT_DIR}/spark/pom.xml -q help:evaluate -Dexpression=project.artifactId -DforceStdout)" +COMET_SPARK_JAR="${PARENT_DIR}/spark/target/${COMET_SPARK_ARTIFACT_ID}-${PROJECT_VERSION}.jar" +COMET_FUZZ_ARTIFACT_ID="$(mvn -f ${DIR}/pom.xml -q help:evaluate -Dexpression=project.artifactId -DforceStdout)" +COMET_FUZZ_JAR="${DIR}/target/${COMET_FUZZ_ARTIFACT_ID}-${PROJECT_VERSION}-jar-with-dependencies.jar" +NUM_FILES="${NUM_FILES:-2}" +NUM_ROWS="${NUM_ROWS:-200}" +NUM_QUERIES="${NUM_QUERIES:-500}" + +if [ ! -f "${COMET_SPARK_JAR}" ]; then + echo "Building Comet Spark jar..." + make -f "${PARENT_DIR}/Makefile" Review Comment: ```suggestion pushd "${PARENT_DIR}" make popd ``` I think you need to change the current working directory for `make` ########## fuzz-testing/run.sh: ########## @@ -0,0 +1,73 @@ +#!/bin/bash +# +# 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. +# + +set -eux + +DIR="$(cd "$(dirname "$0")" && pwd)" +PARENT_DIR="${DIR}/.." +SPARK_MASTER="${SPARK_MASTER:-local[*]}" +PROJECT_VERSION="$(mvn -q help:evaluate -Dexpression=project.version -DforceStdout)" +COMET_SPARK_ARTIFACT_ID="$(mvn -f ${PARENT_DIR}/spark/pom.xml -q help:evaluate -Dexpression=project.artifactId -DforceStdout)" Review Comment: ```suggestion COMET_SPARK_ARTIFACT_ID="$(mvn -f \"${PARENT_DIR}/spark/pom.xml\" -q help:evaluate -Dexpression=project.artifactId -DforceStdout)" || { echo "Error: Failed to retrieve the Spark project artifactId from Maven" >&2 exit 1 } ``` -- 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]
