[ASTERIXDB-3569][TEST] Reorganize and clean tests

Details:
-Move surefire/failsafe into pluginManagement and only bring
either into a module build when that module contains tests of
that type.

-Clean up CI profiles so that the build will only be passed
if tests are missing due to a clear and explicit wholesale
exclusion of either unit or integration tests, and only for
either type respectively.

Ext-ref: MB-58891

Change-Id: I9ba2ce7afc54ddd08f5e522627c56e22f51c21d1
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/19452
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Ian Maxon <imaxon@apache.org>
Reviewed-by: Michael Blow <mblow@apache.org>
diff --git a/hyracks-fullstack/pom.xml b/hyracks-fullstack/pom.xml
index 66b4ebb..91abbec 100644
--- a/hyracks-fullstack/pom.xml
+++ b/hyracks-fullstack/pom.xml
@@ -542,38 +542,6 @@
       </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <configuration>
-          <failIfNoTests>false</failIfNoTests>
-          <forkCount>1</forkCount>
-          <reuseForks>false</reuseForks>
-          <argLine>-enableassertions -Xmx2048m -Dfile.encoding=UTF-8 -Xdebug
-            -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n ${coverageArgLine}
-            --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED
-          </argLine>
-          <systemPropertyVariables>
-            <log4j.configurationFile>${testLog4jConfigFile}</log4j.configurationFile>
-          </systemPropertyVariables>
-          <includes>
-            <include>${test.includes}</include>
-          </includes>
-          <excludes combine.children="append">
-            <exclude>${test.excludes}</exclude>
-          </excludes>
-          <skipTests>${skip.surefire.tests}</skipTests>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-failsafe-plugin</artifactId>
-        <configuration>
-          <systemPropertyVariables>
-            <log4j.configurationFile>${testLog4jConfigFile}</log4j.configurationFile>
-          </systemPropertyVariables>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
         <configuration>
           <compilerArgument>-Xlint:${javac.xlint.value}</compilerArgument>
@@ -862,11 +830,35 @@
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-surefire-plugin</artifactId>
           <version>2.21.0</version>
+          <configuration>
+            <failIfNoTests>false</failIfNoTests>
+            <forkCount>1</forkCount>
+            <reuseForks>false</reuseForks>
+            <argLine>-enableassertions -Xmx2048m -Dfile.encoding=UTF-8 -Xdebug
+              -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n ${coverageArgLine}
+              --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED
+            </argLine>
+            <systemPropertyVariables>
+              <log4j.configurationFile>${testLog4jConfigFile}</log4j.configurationFile>
+            </systemPropertyVariables>
+            <includes>
+              <include>${test.includes}</include>
+            </includes>
+            <excludes combine.children="append">
+              <exclude>${test.excludes}</exclude>
+            </excludes>
+            <skipTests>${skip.surefire.tests}</skipTests>
+          </configuration>
         </plugin>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-failsafe-plugin</artifactId>
           <version>2.21.0</version>
+          <configuration>
+            <systemPropertyVariables>
+              <log4j.configurationFile>${testLog4jConfigFile}</log4j.configurationFile>
+            </systemPropertyVariables>
+          </configuration>
         </plugin>
         <plugin>
           <groupId>org.apache.hyracks</groupId>