Skip to content

Commit 4f7fb22

Browse files
committed
Limit Derby external test to startup verification
Replace full junit-all test suite with startup-only verification using Derby's built-in sysinfo tool. The sysinfo command exercises JVM launch, Derby class loading, and runtime reflection without running Derby's own application-level unit tests. Also fix pre-existing bash syntax bug: 'export var value' (without =) does not assign the variable in bash; corrected to 'export var=value'. - external/derby/test.sh: remove ant junit-all; fix export syntax; run java -jar derbyrun.jar sysinfo as the startup signal - external/derby/playlist.xml: add derby_startup_test at extended level; demote derby_test_junit_all to special level (on-demand only)
1 parent a179181 commit 4f7fb22

4 files changed

Lines changed: 56 additions & 62 deletions

File tree

external/derby/playlist.xml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
-->
1515
<playlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../TKG/resources/playlist.xsd">
1616
<test>
17-
<testCaseName>derby_test_junit_all</testCaseName>
17+
<testCaseName>derby_startup_test</testCaseName>
1818
<command> $(TEST_ROOT)$(D)external$(D)external.sh --run --tag "${DOCKERIMAGE_TAG}" --dir derby --reportdst $(REPORTDIR) --docker_args "$(EXTRA_DOCKER_ARGS)" ; \
1919
$(TEST_STATUS); \
2020
$(TEST_ROOT)$(D)external$(D)external.sh --clean --tag "${DOCKERIMAGE_TAG}" --dir derby
@@ -29,4 +29,25 @@
2929
<group>external</group>
3030
</groups>
3131
</test>
32+
<test>
33+
<testCaseName>derby_test_junit_all</testCaseName>
34+
<disables>
35+
<disable>
36+
<comment>https://github.com/adoptium/aqa-tests/issues/7243</comment>
37+
</disable>
38+
</disables>
39+
<command> $(TEST_ROOT)$(D)external$(D)external.sh --run --tag "${DOCKERIMAGE_TAG}" --dir derby --reportdst $(REPORTDIR) --docker_args "$(EXTRA_DOCKER_ARGS)" ; \
40+
$(TEST_STATUS); \
41+
$(TEST_ROOT)$(D)external$(D)external.sh --clean --tag "${DOCKERIMAGE_TAG}" --dir derby
42+
</command>
43+
<levels>
44+
<level>special</level>
45+
</levels>
46+
<versions>
47+
<version>9+</version>
48+
</versions>
49+
<groups>
50+
<group>external</group>
51+
</groups>
52+
</test>
3253
</playlist>

external/derby/test.sh

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,16 @@
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

3029
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
36-
30+
java -jar "${TEST_HOME}/jars/sane/derbyrun.jar" sysinfo

external/tomcat/playlist.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@
2828
</test>
2929
<test>
3030
<testCaseName>tomcat_test</testCaseName>
31-
<command> $(TEST_ROOT)$(D)external$(D)external.sh --run --tag "${DOCKERIMAGE_TAG}" --dir tomcat --reportdst $(REPORTDIR) --docker_args "$(EXTRA_DOCKER_ARGS)" ; \
31+
<disables>
32+
<disable>
33+
<comment>https://github.com/adoptium/aqa-tests/issues/7243</comment>
34+
</disable>
35+
</disables>
36+
<command> export STARTUP_ONLY=false; \
37+
$(TEST_ROOT)$(D)external$(D)external.sh --run --tag "${DOCKERIMAGE_TAG}" --dir tomcat --reportdst $(REPORTDIR) --docker_args "$(EXTRA_DOCKER_ARGS)" ; \
3238
$(TEST_STATUS); \
3339
$(TEST_ROOT)$(D)external$(D)external.sh --clean --tag "${DOCKERIMAGE_TAG}" --dir tomcat
3440
</command>

external/tomcat/test.sh

Lines changed: 22 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -13,60 +13,33 @@
1313
#
1414

1515
source $(dirname "$0")/test_base_functions.sh
16-
#Set up Java to be used by the tomcat test
1716
echo_setup
1817

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
41-
4218
set -e
4319
echo "Building tomcat"
4420
ant
4521

46-
STARTUP_TIMEOUT="${STARTUP_TIMEOUT:-120}"
47-
TOMCAT_URL="${TOMCAT_URL:-http://localhost:8080/}"
48-
TOMCAT_BUILD_DIR="${TEST_HOME}/output/build"
49-
50-
cleanup() {
51-
echo "Stopping Tomcat"
52-
"${TOMCAT_BUILD_DIR}/bin/catalina.sh" stop || true
53-
}
54-
trap cleanup EXIT
55-
56-
echo "Starting Tomcat from ${TOMCAT_BUILD_DIR}"
57-
cd "${TOMCAT_BUILD_DIR}"
58-
bin/catalina.sh start
59-
60-
echo "Waiting for Tomcat to respond at ${TOMCAT_URL}"
61-
if timeout "${STARTUP_TIMEOUT}" bash -c "until curl -sf '${TOMCAT_URL}' >/dev/null; do sleep 2; done"; then
62-
echo "Tomcat startup verification PASSED"
63-
exit 0
22+
if [ "${STARTUP_ONLY:-true}" = "false" ]; then
23+
ant test
6424
else
65-
echo "Tomcat startup verification FAILED"
66-
echo "Tomcat did not respond within ${STARTUP_TIMEOUT} seconds"
67-
echo "==== catalina.out ===="
68-
tail -n 200 logs/catalina.out || true
69-
echo "==== Tomcat logs directory ===="
70-
ls -la logs || true
71-
exit 1
25+
TOMCAT_BUILD_DIR="${TEST_HOME}/output/build"
26+
27+
cleanup() {
28+
"${TOMCAT_BUILD_DIR}/bin/catalina.sh" stop || true
29+
}
30+
trap cleanup EXIT
31+
32+
echo "Starting Tomcat"
33+
cd "${TOMCAT_BUILD_DIR}"
34+
bin/catalina.sh start
35+
36+
echo "Waiting for Tomcat to respond at ${TOMCAT_URL:-http://localhost:8080/}"
37+
if timeout "${STARTUP_TIMEOUT:-120}" bash -c "until curl -sf '${TOMCAT_URL:-http://localhost:8080/}' >/dev/null; do sleep 2; done"; then
38+
echo "Tomcat startup verification PASSED"
39+
exit 0
40+
else
41+
echo "Tomcat startup verification FAILED"
42+
tail -n 200 logs/catalina.out || true
43+
exit 1
44+
fi
7245
fi

0 commit comments

Comments
 (0)