This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/2.1 by this push:
     new 97e10e6192 new ci script (#5586)
97e10e6192 is described below

commit 97e10e61921f9a300e86ce78146074dad38d8c6c
Author: Kevin Rathbun <[email protected]>
AuthorDate: Thu May 29 09:56:01 2025 -0400

    new ci script (#5586)
    
    * new ci script:
    
    Checks for any abstract classes that end in 'IT'
    
    * remove comment from find-startmini-without-stopmini.sh that is no longer 
needed
    
    ---------
    
    Co-authored-by: Christopher Tubbs <[email protected]>
---
 .github/workflows/maven.yaml                       |  2 ++
 src/build/ci/find-startMini-without-stopMini.sh    |  3 ---
 ...stopMini.sh => find-unapproved-abstract-ITs.sh} | 30 ++++++++++------------
 3 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml
index 120e74dad6..9901901609 100644
--- a/.github/workflows/maven.yaml
+++ b/.github/workflows/maven.yaml
@@ -52,6 +52,8 @@ jobs:
       run: src/build/ci/find-unapproved-junit.sh
     - name: Check for unapproved use of startMiniCluster without 
stopMiniCluster
       run: src/build/ci/find-startMini-without-stopMini.sh
+    - name: Check for unapproved use of abstract classes ending in IT
+      run: src/build/ci/find-unapproved-abstract-ITs.sh
     - name: Build with Maven (Fast Build)
       timeout-minutes: 20
       run: mvn -B -V -e -ntp "-Dstyle.color=always" clean package 
dependency:resolve -DskipTests -DskipFormat -DverifyFormat
diff --git a/src/build/ci/find-startMini-without-stopMini.sh 
b/src/build/ci/find-startMini-without-stopMini.sh
index 937909e2fe..fc393c4c37 100755
--- a/src/build/ci/find-startMini-without-stopMini.sh
+++ b/src/build/ci/find-startMini-without-stopMini.sh
@@ -23,9 +23,6 @@
 # with stopMiniCluster.
 NUM_EXPECTED=0
 ALLOWED=(
-  #Uncomment when merging to main
-  
#test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompaction_2_IT.java
-  
#test/src/main/java/org/apache/accumulo/test/compaction/FlakyExternalCompaction2IT.java
 )
 
 ALLOWED_PIPE_SEP=$({ for x in "${ALLOWED[@]}"; do echo "$x"; done; } | paste 
-sd'|')
diff --git a/src/build/ci/find-startMini-without-stopMini.sh 
b/src/build/ci/find-unapproved-abstract-ITs.sh
similarity index 50%
copy from src/build/ci/find-startMini-without-stopMini.sh
copy to src/build/ci/find-unapproved-abstract-ITs.sh
index 937909e2fe..1512407433 100755
--- a/src/build/ci/find-startMini-without-stopMini.sh
+++ b/src/build/ci/find-unapproved-abstract-ITs.sh
@@ -18,37 +18,33 @@
 # under the License.
 #
 
-# The purpose of this ci script is to ensure that a pull request doesn't
-# unintentionally add a test with startMiniCluster without stopping it
-# with stopMiniCluster.
+# The purpose of this ci script is to ensure that a pull request doesn't 
unintentionally add an
+# abstract class ending with 'IT'.
 NUM_EXPECTED=0
 ALLOWED=(
-  #Uncomment when merging to main
-  
#test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompaction_2_IT.java
-  
#test/src/main/java/org/apache/accumulo/test/compaction/FlakyExternalCompaction2IT.java
 )
 
 ALLOWED_PIPE_SEP=$({ for x in "${ALLOWED[@]}"; do echo "$x"; done; } | paste 
-sd'|')
 
-function findallstopminiproblems() {
-  # -F for fixed-string matching, -R for recursive, -l for matching files
-  local opts='-FRL'
+function findallabstractITproblems() {
+  # -R for recursive, -P for perl matching, -l for matching files
+  local opts='-RPl'
   if [[ $1 == 'print' ]]; then
-    # -F for fixed-string matching, -R for recursive, -l for matching files, 
-H for always showing filenames
-    opts='-FRLH'
+    # -R for recursive, -P for perl matching, -l for matching files, -H for 
always showing filenames
+    opts='-RPlH'
   fi
-  # find any new classes using startMiniCluster without using stopMiniCluster, 
except those allowed
-  grep -FRl --include='*.java' startMiniCluster | xargs grep "$opts" 
stopMiniCluster | grep -Pv "^(${ALLOWED_PIPE_SEP//./[.]})\$"
+  # find any abstract classes ending in 'IT', except those allowed
+  grep "$opts" --include='*.java' ' abstract class [^ ]*IT ' | grep -Pv 
"^(${ALLOWED_PIPE_SEP//./[.]})\$"
 }
 
 function comparecounts() {
   local count
-  count=$(findallstopminiproblems | wc -l)
+  count=$(findallabstractITproblems | wc -l)
   if [[ $NUM_EXPECTED -ne $count ]]; then
-    echo "Expected $NUM_EXPECTED, but found $count unapproved classes using 
startMiniCluster without stopMiniCluster:"
-    findallstopminiproblems 'print'
+    echo "Expected $NUM_EXPECTED, but found $count unapproved abstract classes 
ending in 'IT'"
+    findallabstractITproblems 'print'
     return 1
   fi
 }
 
-comparecounts && echo "Found exactly $NUM_EXPECTED unapproved uses of 
startMiniCluster without stopMiniCluster, as expected"
+comparecounts && echo "Found exactly $NUM_EXPECTED unapproved abstract classes 
ending in 'IT', as expected"

Reply via email to