Skip to content

Commit 37fde13

Browse files
committed
external: limit Tomcat and Derby to startup verification (issue #7243)
Default run (no arg) performs a lightweight startup probe. Full upstream test suite is preserved behind --testtarget full and disabled via #7243. - tomcat: ant build + catalina.sh start + curl :8080 - derby: ant build + java -jar derbyrun.jar sysinfo Re-enable full suite: remove <disables> block from playlist entry.
1 parent 37148a3 commit 37fde13

5 files changed

Lines changed: 81 additions & 42 deletions

File tree

external/derby/playlist.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515
<playlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../TKG/resources/playlist.xsd">
1616
<test>
1717
<testCaseName>derby_test_junit_all</testCaseName>
18-
<command> $(TEST_ROOT)$(D)external$(D)external.sh --run --tag "${DOCKERIMAGE_TAG}" --dir derby --reportdst $(REPORTDIR) --docker_args "$(EXTRA_DOCKER_ARGS)" ; \
18+
<disables>
19+
<disable>
20+
<comment>https://github.com/adoptium/aqa-tests/issues/7243</comment>
21+
</disable>
22+
</disables>
23+
<command> $(TEST_ROOT)$(D)external$(D)external.sh --run --tag "${DOCKERIMAGE_TAG}" --dir derby --testtarget full --reportdst $(REPORTDIR) --docker_args "$(EXTRA_DOCKER_ARGS)" ; \
1924
$(TEST_STATUS); \
2025
$(TEST_ROOT)$(D)external$(D)external.sh --clean --tag "${DOCKERIMAGE_TAG}" --dir derby
2126
</command>

external/derby/test.sh

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,23 @@
1515
source $(dirname "$0")/test_base_functions.sh
1616
#Set up Java to be used by the derby test
1717
echo_setup
18-
#clean previous build artifacts
18+
#clean previous build artifacts
1919
ant -f build.xml clobber
2020
#build all
2121
ant -f build.xml all
2222
#create jars
2323
ant -f build.xml buildjars
2424

25-
export jardir ${TEST_HOME}/jars/sane
26-
export tstjardir ${TEST_HOME}/tools/java
27-
export CLASSPATH "${jardir}/derbyrun.jar:${jardir}/derbyTesting.jar:${tstjardir}/junit.jar"
28-
java -jar ${TEST_HOME}/jars/sane/derbyrun.jar sysinfo
25+
export jardir="${TEST_HOME}/jars/sane"
26+
export tstjardir="${TEST_HOME}/tools/java"
27+
export CLASSPATH="${jardir}/derbyrun.jar:${jardir}/derbyTesting.jar:${tstjardir}/junit.jar"
2928

30-
set -e
31-
#Run all tests
32-
ant -Dderby.tests.basePort=1690 -Dderby.system.durability=test -DderbyTesting.oldReleasePath=${TEST_HOME}/jars junit-all
33-
set +e
34-
#Run only derbylang suite
35-
#java -Dverbose=true -cp ${jardir}/derbyrun.jar:${jardir}/derbyTesting.jar:$tstjardir/junit.jar org.apache.derbyTesting.functionTests.harness.RunSuite #derbylang
29+
TEST_TARGET="${1:-smoke}"
3630

31+
set -e
32+
if [ "$TEST_TARGET" = "full" ]; then
33+
#Run all tests
34+
ant -Dderby.tests.basePort=1690 -Dderby.system.durability=test -DderbyTesting.oldReleasePath=${TEST_HOME}/jars junit-all
35+
else
36+
java -jar "${TEST_HOME}/jars/sane/derbyrun.jar" sysinfo
37+
fi

external/tomcat/playlist.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515
<playlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../TKG/resources/playlist.xsd">
1616
<test>
1717
<testCaseName>tomcat_test</testCaseName>
18-
<command> $(TEST_ROOT)$(D)external$(D)external.sh --run --tag "${DOCKERIMAGE_TAG}" --dir tomcat --reportdst $(REPORTDIR) --docker_args "$(EXTRA_DOCKER_ARGS)" ; \
18+
<disables>
19+
<disable>
20+
<comment>https://github.com/adoptium/aqa-tests/issues/7243</comment>
21+
</disable>
22+
</disables>
23+
<command> $(TEST_ROOT)$(D)external$(D)external.sh --run --tag "${DOCKERIMAGE_TAG}" --dir tomcat --testtarget full --reportdst $(REPORTDIR) --docker_args "$(EXTRA_DOCKER_ARGS)" ; \
1924
$(TEST_STATUS); \
2025
$(TEST_ROOT)$(D)external$(D)external.sh --clean --tag "${DOCKERIMAGE_TAG}" --dir tomcat
2126
</command>

external/tomcat/test.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
github_url="https://github.com/apache/tomcat.git"
22
tag_version="10.0.7"
3-
generic_packages="openssl make gcc perl automake autoconf subversion git wget tar"
3+
generic_packages="openssl make gcc perl automake autoconf subversion git wget tar curl"
44
ubuntu_packages="ant-optional linux-libc-dev libc6-dev build-essential libssl-dev libtool-bin"
55
fedora_packages="glibc glibc-devel openssl-devel libtool"
66
(fedora|ubi|rhel|centos)_packages=make automake gcc gcc-c++ kernel-devel

external/tomcat/test.sh

Lines changed: 56 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,34 +16,62 @@ source $(dirname "$0")/test_base_functions.sh
1616
#Set up Java to be used by the tomcat test
1717
echo_setup
1818

19-
git clone -q -b 1.6.x --single-branch https://github.com/apache/apr.git $TEST_HOME/tmp/apr
20-
cd $TEST_HOME/tmp/apr
21-
./buildconf
22-
./configure --prefix=$TEST_HOME/tmp/apr-build
23-
make
24-
make install
25-
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$TEST_HOME/tmp/apr-build/lib"
26-
27-
git clone -q https://github.com/apache/tomcat-native.git $TEST_HOME/tmp/tomcat-native
28-
cd $TEST_HOME/tmp/tomcat-native/native
29-
sh buildconf --with-apr=$TEST_HOME/tmp/apr
30-
./configure --with-apr=$TEST_HOME/tmp/apr --with-java-home=$JAVA_HOME --with-ssl=yes --prefix=$TEST_HOME/tmp/tomcat-native-build
31-
make
32-
make install
33-
cd $TEST_HOME
34-
yes | cp build.properties.default build.properties
35-
echo >> build.properties
36-
echo "test.threads=4" >> build.properties
37-
echo "test.relaxTiming=true" >> build.properties
38-
echo "test.excludePerformance=true" >> build.properties
39-
echo "test.openssl.path=/dev/null/openssl" >> build.properties
40-
echo "test.apr.loc=$TEST_HOME/tmp/tomcat-native-build/lib" >> build.properties
19+
TEST_TARGET="${1:-smoke}"
4120

4221
set -e
43-
echo "Building tomcat" && \
44-
ant && \
22+
if [ "$TEST_TARGET" = "full" ]; then
23+
git clone -q -b 1.6.x --single-branch https://github.com/apache/apr.git $TEST_HOME/tmp/apr
24+
cd $TEST_HOME/tmp/apr
25+
./buildconf
26+
./configure --prefix=$TEST_HOME/tmp/apr-build
27+
make
28+
make install
29+
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$TEST_HOME/tmp/apr-build/lib"
4530

46-
echo "Running tomcat tests"
47-
#Run tests
48-
ant test
49-
set +e
31+
git clone -q https://github.com/apache/tomcat-native.git $TEST_HOME/tmp/tomcat-native
32+
cd $TEST_HOME/tmp/tomcat-native/native
33+
sh buildconf --with-apr=$TEST_HOME/tmp/apr
34+
./configure --with-apr=$TEST_HOME/tmp/apr --with-java-home=$JAVA_HOME --with-ssl=yes --prefix=$TEST_HOME/tmp/tomcat-native-build
35+
make
36+
make install
37+
cd $TEST_HOME
38+
yes | cp build.properties.default build.properties
39+
echo >> build.properties
40+
echo "test.threads=4" >> build.properties
41+
echo "test.relaxTiming=true" >> build.properties
42+
echo "test.excludePerformance=true" >> build.properties
43+
echo "test.openssl.path=/dev/null/openssl" >> build.properties
44+
echo "test.apr.loc=$TEST_HOME/tmp/tomcat-native-build/lib" >> build.properties
45+
46+
echo "Building tomcat" && \
47+
ant && \
48+
49+
echo "Running tomcat tests"
50+
#Run tests
51+
ant test
52+
else
53+
echo "Building tomcat" && \
54+
ant
55+
set +e
56+
57+
TOMCAT_BUILD_DIR="${TEST_HOME}/output/build"
58+
59+
cleanup() {
60+
"${TOMCAT_BUILD_DIR}/bin/catalina.sh" stop || true
61+
}
62+
trap cleanup EXIT
63+
64+
echo "Starting Tomcat"
65+
cd "${TOMCAT_BUILD_DIR}"
66+
bin/catalina.sh start
67+
68+
echo "Waiting for Tomcat to respond at ${TOMCAT_URL:-http://localhost:8080/}"
69+
if timeout "${STARTUP_TIMEOUT:-120}" bash -c "until curl -sf '${TOMCAT_URL:-http://localhost:8080/}' >/dev/null; do sleep 2; done"; then
70+
echo "Tomcat startup verification PASSED"
71+
exit 0
72+
else
73+
echo "Tomcat startup verification FAILED"
74+
tail -n 200 logs/catalina.out || true
75+
exit 1
76+
fi
77+
fi

0 commit comments

Comments
 (0)