<commit_before>#!/bin/bash -e

# java.security.egd is needed for low-entropy docker containers
# /dev/./urandom (as opposed to simply /dev/urandom) is needed prior to Java 8
# (see https://docs.oracle.com/javase/8/docs/technotes/guides/security/enhancements-8.html)
#
# NewRatio is to leave as much memory as possible to old gen
surefire_jvm_args="-Xmx256m -XX:NewRatio=20 -Djava.security.egd=file:/dev/./urandom"
java_version=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}')
if [[ "$java_version" < "1.8" ]]
then
  # MaxPermSize bump is needed for running grails plugin tests
  surefire_jvm_args="$surefire_jvm_args -XX:MaxPermSize=128m"
fi
if [[ "$SKIP_SHADING" == "true" ]]
then
  skip_shading_opt=-Dglowroot.shade.skip
fi

test1_excluded_plugin_modules="!:glowroot-agent-cassandra-plugin"
test1_excluded_plugin_modules="$test1_excluded_plugin_modules,!:glowroot-agent-elasticsearch-plugin"
test1_excluded_plugin_modules="$test1_excluded_plugin_modules,!:glowroot-agent-hibernate-plugin"
test1_excluded_plugin_modules="$test1_excluded_plugin_modules,!:glowroot-agent-http-client-plugin"
test1_excluded_plugin_modules="$test1_excluded_plugin_modules,!:glowroot-agent-jdbc-plugin"
test1_excluded_plugin_modules="$test1_excluded_plugin_modules,!:glowroot-agent-jms-plugin"
test1_excluded_plugin_modules="$test1_excluded_plugin_modules,!:glowroot-agent-jsp-plugin"
test1_excluded_plugin_modules="$test1_excluded_plugin_modules,!:glowroot-agent-logger-plugin"
test1_excluded_plugin_modules="$test1_excluded_plugin_modules,!:glowroot-agent-netty-plugin"
test1_excluded_plugin_modules="$test1_excluded_plugin_modules,!:glowroot-agent-play-plugin"
test1_excluded_plugin_modules="$test1_excluded_plugin_modules,!:glowroot-agent-quartz-plugin"
test1_excluded_plugin_modules="$test1_excluded_plugin_modules,!:glowroot-agent-redis-plugin"

# these plugins are not excluded in test1:
#   glowroot-agent-executor-plugin
#   glowroot-agent-grails-plugin
#   glowroot-agent-jaxrs-plugin
#   glowroot-agent-jsf-plugin
#   glowroot-agent-servlet-plugin
#   glowroot-agent-spring-plugin
#   glowroot-agent-struts-plugin

case "$1" in

      "test1") # excluding :glowroot-agent-ui-sandbox and :glowroot-agent since they depend on plugins which are being excluded
               exclude_modules="-pl $test1_excluded_plugin_modules,!:glowroot-agent-ui-sandbox,!:glowroot-agent"
               if [[ "$java_version" > "1.8" ]]
               then
                 # these modules are only part of build under Java 8+
                 exclude_modules="$exclude_modules,!:glowroot-central,!:glowroot-webdriver-tests"
               fi
               mvn clean install $exclude_modules \
                                 $extra_profiles \
                                 -DargLine="$surefire_jvm_args" \
                                 $skip_shading_opt \
                                 -Dglowroot.it.harness=$GLOWROOT_HARNESS \
                                 -B
               ;;

      "test2") mvn clean install -DargLine="$surefire_jvm_args" \
                                 -DskipTests \
                                 $skip_shading_opt \
                                 -Dglowroot.it.harness=$GLOWROOT_HARNESS \
                                 -B

               if [[ "$java_version" > "1.8" && "$SKIP_SHADING" != "true" ]]
               then
                 # elasticsearch and play tests both require Java 8 and shading
                 extra_profiles="-P elasticsearch-5.x,play-2.4.x,play-2.x"
               fi
               mvn clean install -pl ${test1_excluded_plugin_modules//!:/:} \
                                 $extra_profiles \
                                 -DargLine="$surefire_jvm_args" \
                                 $skip_shading_opt \
                                 -Dglowroot.it.harness=$GLOWROOT_HARNESS \
                                 -B
               mvn clean verify -pl :glowroot-agent-jdbc-plugin \
                                -DargLine="$surefire_jvm_args" \
                                $skip_shading_opt \
                                -Dglowroot.it.harness=$GLOWROOT_HARNESS \
                                -Dglowroot.test.jdbcConnectionType=H2 \
                                --no-snapshot-updates \
                                -B
               mvn clean verify -pl :glowroot-agent-jdbc-plugin \
                                -DargLine="$surefire_jvm_args" \
                                $skip_shading_opt \
                                -Dglowroot.it.harness=$GLOWROOT_HARNESS \
                                -Dglowroot.test.jdbcConnectionType=COMMONS_DBCP_WRAPPED \
                                --no-snapshot-updates \
                                -B
               mvn clean verify -pl :glowroot-agent-jdbc-plugin \
                                -DargLine="$surefire_jvm_args" \
                                $skip_shading_opt \
                                -Dglowroot.it.harness=$GLOWROOT_HARNESS \<commit_msg>Run asynchttpclient tests during travis build<commit_after>#!/bin/bash -e

# java.security.egd is needed for low-entropy docker containers
# /dev/./urandom (as opposed to simply /dev/urandom) is needed prior to Java 8
# (see https://docs.oracle.com/javase/8/docs/technotes/guides/security/enhancements-8.html)
#
# NewRatio is to leave as much memory as possible to old gen
surefire_jvm_args="-Xmx256m -XX:NewRatio=20 -Djava.security.egd=file:/dev/./urandom"
java_version=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}')
if [[ "$java_version" < "1.8" ]]
then
  # MaxPermSize bump is needed for running grails plugin tests
  surefire_jvm_args="$surefire_jvm_args -XX:MaxPermSize=128m"
fi
if [[ "$SKIP_SHADING" == "true" ]]
then
  skip_shading_opt=-Dglowroot.shade.skip
fi

test1_excluded_plugin_modules="!:glowroot-agent-cassandra-plugin"
test1_excluded_plugin_modules="$test1_excluded_plugin_modules,!:glowroot-agent-elasticsearch-plugin"
test1_excluded_plugin_modules="$test1_excluded_plugin_modules,!:glowroot-agent-hibernate-plugin"
test1_excluded_plugin_modules="$test1_excluded_plugin_modules,!:glowroot-agent-http-client-plugin"
test1_excluded_plugin_modules="$test1_excluded_plugin_modules,!:glowroot-agent-jdbc-plugin"
test1_excluded_plugin_modules="$test1_excluded_plugin_modules,!:glowroot-agent-jms-plugin"
test1_excluded_plugin_modules="$test1_excluded_plugin_modules,!:glowroot-agent-jsp-plugin"
test1_excluded_plugin_modules="$test1_excluded_plugin_modules,!:glowroot-agent-logger-plugin"
test1_excluded_plugin_modules="$test1_excluded_plugin_modules,!:glowroot-agent-netty-plugin"
test1_excluded_plugin_modules="$test1_excluded_plugin_modules,!:glowroot-agent-play-plugin"
test1_excluded_plugin_modules="$test1_excluded_plugin_modules,!:glowroot-agent-quartz-plugin"
test1_excluded_plugin_modules="$test1_excluded_plugin_modules,!:glowroot-agent-redis-plugin"

# these plugins are not excluded in test1:
#   glowroot-agent-executor-plugin
#   glowroot-agent-grails-plugin
#   glowroot-agent-jaxrs-plugin
#   glowroot-agent-jsf-plugin
#   glowroot-agent-servlet-plugin
#   glowroot-agent-spring-plugin
#   glowroot-agent-struts-plugin

case "$1" in

      "test1") # excluding :glowroot-agent-ui-sandbox and :glowroot-agent since they depend on plugins which are being excluded
               exclude_modules="-pl $test1_excluded_plugin_modules,!:glowroot-agent-ui-sandbox,!:glowroot-agent"
               if [[ "$java_version" > "1.8" ]]
               then
                 # these modules are only part of build under Java 8+
                 exclude_modules="$exclude_modules,!:glowroot-central,!:glowroot-webdriver-tests"
               fi
               mvn clean install $exclude_modules \
                                 $extra_profiles \
                                 -DargLine="$surefire_jvm_args" \
                                 $skip_shading_opt \
                                 -Dglowroot.it.harness=$GLOWROOT_HARNESS \
                                 -B
               ;;

      "test2") mvn clean install -DargLine="$surefire_jvm_args" \
                                 -DskipTests \
                                 $skip_shading_opt \
                                 -Dglowroot.it.harness=$GLOWROOT_HARNESS \
                                 -B

               if [[ "$java_version" > "1.8" && "$SKIP_SHADING" != "true" ]]
               then
                 # async-http-client, elasticsearch and play tests all require Java 8 and shading
                 extra_profiles="-P async-http-client-2.x,elasticsearch-5.x,play-2.4.x,play-2.x"
               fi
               mvn clean install -pl ${test1_excluded_plugin_modules//!:/:} \
                                 $extra_profiles \
                                 -DargLine="$surefire_jvm_args" \
                                 $skip_shading_opt \
                                 -Dglowroot.it.harness=$GLOWROOT_HARNESS \
                                 -B
               mvn clean verify -pl :glowroot-agent-jdbc-plugin \
                                -DargLine="$surefire_jvm_args" \
                                $skip_shading_opt \
                                -Dglowroot.it.harness=$GLOWROOT_HARNESS \
                                -Dglowroot.test.jdbcConnectionType=H2 \
                                --no-snapshot-updates \
                                -B
               mvn clean verify -pl :glowroot-agent-jdbc-plugin \
                                -DargLine="$surefire_jvm_args" \
                                $skip_shading_opt \
                                -Dglowroot.it.harness=$GLOWROOT_HARNESS \
                                -Dglowroot.test.jdbcConnectionType=COMMONS_DBCP_WRAPPED \
                                --no-snapshot-updates \
                                -B
               mvn clean verify -pl :glowroot-agent-jdbc-plugin \
                                -DargLine="$surefire_jvm_args" \
                                $skip_shading_opt \
                                -Dglowroot.it.harness=$GLOWROOT_HARNESS \
{'fraction_non_alphanumeric': 0.0993259318001586, 'fraction_numerical': 0.01120142743854084, 'mean_word_length': 1.9116883116883117, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 22, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3708855', 'n_tokens_mistral': 3154, 'n_tokens_neox': 3061, 'n_words': 418}