[accumulo] branch main updated: Run shfmt and shellcheck on scripts (#2677)

2022-05-09 Thread ctubbsii
This is an automated email from the ASF dual-hosted git repository.

ctubbsii pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/main by this push:
 new e223e7997a Run shfmt and shellcheck on scripts (#2677)
e223e7997a is described below

commit e223e7997a574c80388f3c707c142e5498bec98f
Author: Christopher Tubbs 
AuthorDate: Mon May 9 15:12:22 2022 -0400

Run shfmt and shellcheck on scripts (#2677)

* Run shfmt to format scripts
* Run shellcheck to check all scripts for bugs
* Add automated check for shfmt and shellcheck during CI
---
 .github/workflows/scripts.yaml |  58 ++
 assemble/bin/accumulo  |  21 ++-
 assemble/bin/accumulo-cluster  |  53 +++---
 assemble/bin/accumulo-service  |  51 ++---
 assemble/bin/accumulo-util |  72 +++
 assemble/build.sh  | 209 +
 assemble/conf/accumulo-env.sh  |  29 ++-
 assemble/src/main/scripts/create-jshell.sh |  19 +-
 contrib/ci/find-unapproved-chars.sh|   4 +-
 contrib/ci/find-unapproved-junit.sh|   5 +-
 .../ci/install-shfmt.sh|  12 +-
 contrib/ci/it-matrix.sh|   3 +-
 .../ci/run-shellcheck.sh   |  10 +-
 .../generate-thrift.sh => contrib/ci/run-shfmt.sh  |   9 +-
 core/src/main/scripts/generate-thrift.sh   |  50 ++---
 server/base/src/main/scripts/generate-protobuf.sh  |  17 +-
 start/src/test/shell/makeHelloWorldJars.sh |  18 +-
 start/src/test/shell/makeTestJars.sh   |  19 +-
 test/src/main/scripts/generate-thrift.sh   |   2 +-
 test/src/test/scripts/run-test.sh  |  21 +--
 20 files changed, 405 insertions(+), 277 deletions(-)

diff --git a/.github/workflows/scripts.yaml b/.github/workflows/scripts.yaml
new file mode 100644
index 00..6f78957c31
--- /dev/null
+++ b/.github/workflows/scripts.yaml
@@ -0,0 +1,58 @@
+#
+# 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.
+#
+
+# This workflow will build a Java project with Maven
+# See also:
+#   
https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
+
+name: ScriptQA
+
+on:
+  push:
+branches: [ '*' ]
+  pull_request:
+branches: [ '*' ]
+
+jobs:
+  shfmt:
+name: shfmt
+timeout-minutes: 3
+runs-on: ubuntu-latest
+steps:
+- uses: actions/checkout@v3
+- name: Show the first log message
+  run: git log -n1
+- name: Install shfmt
+  run: contrib/ci/install-shfmt.sh
+- name: Checking formatting of all scripts
+  run: contrib/ci/run-shfmt.sh
+
+  shellcheck:
+name: ShellCheck
+timeout-minutes: 3
+runs-on: ubuntu-latest
+steps:
+- uses: actions/checkout@v3
+- name: Show the first log message
+  run: git log -n1
+- name: Install shfmt
+  run: contrib/ci/install-shfmt.sh
+- name: Running shellcheck on all scripts
+  run: contrib/ci/run-shellcheck.sh
+
diff --git a/assemble/bin/accumulo b/assemble/bin/accumulo
index f82f848b19..dc20572406 100755
--- a/assemble/bin/accumulo
+++ b/assemble/bin/accumulo
@@ -21,14 +21,16 @@
 function main() {
 
   SOURCE="${BASH_SOURCE[0]}"
-  while [[ -h "${SOURCE}" ]]; do
- bin="$( cd -P "$( dirname "${SOURCE}" )" && pwd )"
- SOURCE="$(readlink "${SOURCE}")"
- [[ "${SOURCE}" != /* ]] && SOURCE="${bin}/${SOURCE}"
+  while [[ -L ${SOURCE} ]]; do
+bin="$(cd -P "$(dirname "${SOURCE}")" && pwd)"
+SOURCE="$(readlink "${SOURCE}")"
+[[ ${SOURCE} != /* ]] && SOURCE="${bin}/${SOURCE}"
   done
   # Set up variables needed by accumulo-env.sh
-  bin="$( cd -P "$( dirname "${SOURCE}" )" && pwd )"; export bin
-  basedir=$( cd -P "${bin}"/.. && pwd ); export basedir
+  bin="$(cd -P "$(dirname "${SOURCE}")" && pwd)"
+  export bin
+  basedir=$(cd -P "${bin}"/.. && pwd)
+  export basedir
   export conf="${ACCUMULO_CONF_DIR:-${basedir}/conf}"
   export lib="${basedir}/lib"
   export cmd="$1"
@@ -41,6 +43,7 @@ function main() {
 echo 

[accumulo-testing] branch main updated: Drop Replication concurrent RW test and IT (#205)

2022-05-09 Thread mmiller
This is an automated email from the ASF dual-hosted git repository.

mmiller pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo-testing.git


The following commit(s) were added to refs/heads/main by this push:
 new 8d87c67  Drop Replication concurrent RW test and IT (#205)
8d87c67 is described below

commit 8d87c676c558ffe8fe38062a95c49d2e501942c3
Author: Mike Miller 
AuthorDate: Mon May 9 14:00:03 2022 -0400

Drop Replication concurrent RW test and IT (#205)

* Closes #171
---
 .../testing/randomwalk/concurrent/Replication.java | 204 -
 .../randomwalk/ReplicationRandomWalkIT.java|  58 --
 2 files changed, 262 deletions(-)

diff --git 
a/src/main/java/org/apache/accumulo/testing/randomwalk/concurrent/Replication.java
 
b/src/main/java/org/apache/accumulo/testing/randomwalk/concurrent/Replication.java
deleted file mode 100644
index 444d000..000
--- 
a/src/main/java/org/apache/accumulo/testing/randomwalk/concurrent/Replication.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * 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.
- */
-package org.apache.accumulo.testing.randomwalk.concurrent;
-
-import static 
com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
-import static 
org.apache.accumulo.core.conf.Property.MANAGER_REPLICATION_SCAN_INTERVAL;
-import static org.apache.accumulo.core.conf.Property.REPLICATION_NAME;
-import static org.apache.accumulo.core.conf.Property.REPLICATION_PEERS;
-import static org.apache.accumulo.core.conf.Property.REPLICATION_PEER_PASSWORD;
-import static org.apache.accumulo.core.conf.Property.REPLICATION_PEER_USER;
-import static 
org.apache.accumulo.core.conf.Property.REPLICATION_WORK_ASSIGNMENT_SLEEP;
-import static 
org.apache.accumulo.core.conf.Property.REPLICATION_WORK_PROCESSOR_DELAY;
-import static 
org.apache.accumulo.core.conf.Property.REPLICATION_WORK_PROCESSOR_PERIOD;
-import static org.apache.accumulo.core.conf.Property.TABLE_REPLICATION;
-import static org.apache.accumulo.core.conf.Property.TABLE_REPLICATION_TARGET;
-
-import java.util.Map.Entry;
-import java.util.Properties;
-import java.util.Random;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
-import java.util.UUID;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.accumulo.core.client.AccumuloClient;
-import org.apache.accumulo.core.client.BatchWriter;
-import org.apache.accumulo.core.client.Scanner;
-import org.apache.accumulo.core.client.admin.InstanceOperations;
-import org.apache.accumulo.core.client.admin.TableOperations;
-import org.apache.accumulo.core.conf.ClientProperty;
-import org.apache.accumulo.core.data.Key;
-import org.apache.accumulo.core.data.Mutation;
-import org.apache.accumulo.core.data.Value;
-import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.testing.TestProps;
-import org.apache.accumulo.testing.randomwalk.RandWalkEnv;
-import org.apache.accumulo.testing.randomwalk.State;
-import org.apache.accumulo.testing.randomwalk.Test;
-import org.apache.hadoop.io.Text;
-
-@Deprecated
-public class Replication extends Test {
-
-  final int ROWS = 1000;
-  final int COLS = 50;
-
-  @Override
-  public void visit(State state, RandWalkEnv env, Properties props) throws 
Exception {
-final AccumuloClient c = env.getAccumuloClient();
-final String instName = 
ClientProperty.INSTANCE_NAME.getValue(c.properties());
-final String zookeepers = 
ClientProperty.INSTANCE_ZOOKEEPERS.getValue(c.properties());
-final InstanceOperations iOps = c.instanceOperations();
-final TableOperations tOps = c.tableOperations();
-
-// Replicate to ourselves
-iOps.setProperty(REPLICATION_NAME.getKey(), instName);
-iOps.setProperty(REPLICATION_PEERS.getKey() + instName,
-"org.apache.accumulo.tserver.replication.AccumuloReplicaSystem," + 
instName + ","
-+ zookeepers);
-iOps.setProperty(REPLICATION_PEER_USER.getKey() + instName, 
env.getAccumuloUserName());
-iOps.setProperty(REPLICATION_PEER_PASSWORD.getKey() + instName, 
env.getAccumuloPassword());
-// Tweak some replication parameters to make the replication go faster
-