petersomogyi commented on code in PR #5076: URL: https://github.com/apache/hbase/pull/5076#discussion_r1131050020
########## dev-support/code-coverage/run-coverage.sh: ########## @@ -0,0 +1,87 @@ +#!/usr/bin/env 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. +# + +usage() { + echo + echo "Options:" + echo " -h Display help" + echo " -u SonarQube Host URL" + echo " -l SonarQube Login Credentials" + echo " -k SonarQube Project Key" + echo " -n SonarQube Project Name" + echo " -t Number of threads (example: 1 or 2C)." + echo + echo "Important:" + echo " The required parameters for publishing the coverage results to SonarQube are:" + echo " - Host URL" + echo " - Login Credentials" + echo " - Project Key" + echo +} + +execute() { + SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" + MAIN_POM="${SCRIPT_DIR}/../../pom.xml" + + # Check the syntax for the thread variable + if [[ "$THREAD_COUNT" =~ ^[0-9]+([.][0-9]+)?$ ]] || [[ "$THREAD_COUNT" =~ ^[0-9]+([.][0-9]+)+[C]?$ ]]; then + THREADS="${THREAD_COUNT}" + else + THREADS=1 + fi Review Comment: The Surefire fork count is already specified in the pom. I'd prefer it if this script does not set the `-T` parameter for the mvn command when the THREAD_COUNT is not set. -- 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]
