martin-g commented on code in PR #2686: URL: https://github.com/apache/datafusion-comet/pull/2686#discussion_r2494852066
########## fuzz-testing/run.sh: ########## @@ -0,0 +1,71 @@ +#!/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 -eu + +SPARK_MASTER="${SPARK_MASTER:-local[*]}" +PROJECT_VERSION="$(mvn -q help:evaluate -Dexpression=project.version -DforceStdout)" +COMET_SPARK_JAR="../spark/target/$(mvn -f ../spark/pom.xml -q help:evaluate -Dexpression=project.artifactId -DforceStdout)-${PROJECT_VERSION}.jar" Review Comment: It would be cleaner and easier to debug (with `set -x`) if you extract the sub-shell commands and assign their results to their own variables. E.g. ``` SPARK_ARTIFACT_ID="$(mvn -f ../spark/pom.xml -q help:evaluate -Dexpression=project.artifactId -DforceStdout)" FUZZ_ARTIFACT_ID="$(mvn -q help:evaluate -Dexpression=project.artifactId -DforceStdout)" COMET_SPARK_JAR="../spark/target/${SPARK_ARTIFACT_ID}-${PROJECT_VERSION}.jar" COMET_FUZZ_JAR="target/${FUZZ_ARTIFACT_ID}-${PROJECT_VERSION}-jar-with-dependencies.jar" ``` ########## fuzz-testing/run.sh: ########## @@ -0,0 +1,71 @@ +#!/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 -eu + Review Comment: You may want to add some logic to detect the current working directory. At the moment this script assumes that it is called with `./run.sh` but some user may try to run it from the parent folder with `./fuzz-testing/run.sh`. ########## fuzz-testing/run.sh: ########## @@ -0,0 +1,71 @@ +#!/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 -eu + +SPARK_MASTER="${SPARK_MASTER:-local[*]}" +PROJECT_VERSION="$(mvn -q help:evaluate -Dexpression=project.version -DforceStdout)" +COMET_SPARK_JAR="../spark/target/$(mvn -f ../spark/pom.xml -q help:evaluate -Dexpression=project.artifactId -DforceStdout)-${PROJECT_VERSION}.jar" +COMET_FUZZ_JAR="target/$(mvn -q help:evaluate -Dexpression=project.artifactId -DforceStdout)-${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..." + cd .. + mvn install -DskipTests + cd fuzz-testing Review Comment: I think you can avoid navigating the folders with `cd` by using `mvn -f ../pom.xml ...` -- 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]
