Skip to content

Commit

Permalink
Merge pull request #256 from rhusar/ci-jdk17
Browse files Browse the repository at this point in the history
ci: Use JDK 17 for runtime + add maven options suitable for CI + replace removing mono step
  • Loading branch information
jajik authored Jul 18, 2024
2 parents 9b2307c + b5d68ea commit b7e92f2
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 36 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,18 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
# this occupies 8084 port on Ubuntu 20.04 and we don't use it.
- name: Remove mono blocking 8084 port
run: sudo kill -9 $(sudo lsof -t -i:8084)
- name: Stop Mono and XSP
# These occupy port 8084 unnecessarily
run: |
sudo systemctl stop mono-xsp4.service || true
sudo systemctl disable mono-xsp4.service || true
sudo killall mono || true
sudo killall xsp4 || true
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Setup dependencies
run: |
sudo apt-get update -y
Expand Down
54 changes: 27 additions & 27 deletions test/JBCS-1236/testit.sh → test/MODCLUSTER-736/testit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

httpd_all_clean
tomcat_all_remove
MPC_NAME=JBCS-1236 httpd_run
MPC_NAME=MODCLUSTER-736 httpd_run

# Start a bunch ($1, or 6 if no argument is given) of tomcat
# containers, then test them and stop them
Expand Down Expand Up @@ -195,9 +195,9 @@ cyclestomcats() {
done
}

# run test for https://issues.redhat.com/browse/JBCS-1236
# run test for https://issues.redhat.com/browse/MODCLUSTER-736
# basically start and stop random tomcats...
runjbcs1236() {
runmodcluster736() {
# start 3 tomcats
tomcat_start 2
tomcat_start 3
Expand All @@ -213,64 +213,64 @@ runjbcs1236() {
tomcat_test_app 4 || exit 1

# start a bunch of tomcats, test, shutdown, remove and try in a loop.
runjbcs1236=0
runmodcluster736=0
while true
do
runjbcs1236=$(expr $runjbcs1236 + 1)
if [ $runjbcs1236 -gt 2 ]; then
echo "Looks OK, runjbcs1236 stopping!"
runmodcluster736=$(expr $runmodcluster736 + 1)
if [ $runmodcluster736 -gt 2 ]; then
echo "Looks OK, runmodcluster736 stopping!"
break
fi
# cycle the tomcats
runtomcatbatch

if [ $? -ne 0 ]; then
echo "runtomcatbatch: runjbcs1236 Failed!"
echo "runtomcatbatch: runmodcluster736 Failed!"
exit 1
fi
tomcat_shutdown 2

tomcat_wait_for_n_nodes 2
if [ $? -ne 0 ]; then
echo "tomcat_wait_for_n_nodes 2: runjbcs1236 Failed!"
echo "tomcat_wait_for_n_nodes 2: runmodcluster736 Failed!"
exit 1
fi
tomcat_remove 2
tomcat_start 5

tomcat_wait_for_n_nodes 3
if [ $? -ne 0 ]; then
echo "tomcat_wait_for_n_nodes 3: runjbcs1236 Failed!"
echo "tomcat_wait_for_n_nodes 3: runmodcluster736 Failed!"
exit 1
fi
tomcat_start_webapp 5
if [ $? -ne 0 ]; then
echo "tomcat_start_webapp 5: runjbcs1236 Failed!"
echo "tomcat_start_webapp 5: runmodcluster736 Failed!"
exit 1
fi
sleep 20
tomcat_test_app 5
if [ $? -ne 0 ]; then
echo "tomcat_test_app 5: runjbcs1236 Failed!"
echo "tomcat_test_app 5: runmodcluster736 Failed!"
exit 1
fi
# we have 5 3 4 in shared memory
# read 2
tomcat_start 2
tomcat_wait_for_n_nodes 4
if [ $? -ne 0 ]; then
echo "tomcat_wait_for_n_nodes 4: runjbcs1236 Failed!"
echo "tomcat_wait_for_n_nodes 4: runmodcluster736 Failed!"
exit 1
fi
tomcat_start_webapp 2
if [ $? -ne 0 ]; then
echo "tomcat_start_webapp 2: runjbcs1236 Failed!"
echo "tomcat_start_webapp 2: runmodcluster736 Failed!"
exit 1
fi
sleep 20
tomcat_test_app 2
if [ $? -ne 0 ]; then
echo "tomcat_test_app 2: runjbcs1236 Failed!"
echo "tomcat_test_app 2: runmodcluster736 Failed!"
exit 1
fi

Expand All @@ -282,29 +282,29 @@ runjbcs1236() {

tomcat_wait_for_n_nodes 3
if [ $? -ne 0 ]; then
echo "tomcat_wait_for_n_nodes 3: runjbcs1236 Failed!"
echo "tomcat_wait_for_n_nodes 3: runmodcluster736 Failed!"
exit 1
fi
tomcat_remove 5

tomcat_test_app 2
if [ $? -ne 0 ]; then
echo "tomcat_test_app 2: runjbcs1236 Failed!"
echo "tomcat_test_app 2: runmodcluster736 Failed!"
exit 1
fi

tomcat_test_app 3
if [ $? -ne 0 ]; then
echo "tomcat_test_app 3: runjbcs1236 Failed!"
echo "tomcat_test_app 3: runmodcluster736 Failed!"
exit 1
fi

tomcat_test_app 4
if [ $? -ne 0 ]; then
echo "tomcat_test_app 4: runjbcs1236 Failed!"
echo "tomcat_test_app 4: runmodcluster736 Failed!"
exit 1
fi
echo "runjbcs1236 loop: $runjbcs1236 DONE"
echo "runmodcluster736 loop: $runmodcluster736 DONE"
done

# cleanup
Expand All @@ -317,25 +317,25 @@ runjbcs1236() {
tomcat_remove 4
}

# JBCS-1236
echo "Testing JBCS-1236"
# MODCLUSTER-736
echo "Testing MODCLUSTER-736"
cyclestomcats ${TOMCAT_CYCLE_COUNT:-10}
if [ $? -ne 0 ]; then
echo "JBCS-1236 cyclestomcats 100 FAILED!"
echo "MODCLUSTER-736 cyclestomcats 100 FAILED!"
exit 1
fi
echo "cycletomcats DONE"
forevertomcat
if [ $? -ne 0 ]; then
echo "JBCS-1236 forevertomcat FAILED!"
echo "MODCLUSTER-736 forevertomcat FAILED!"
exit 1
fi
echo "forevertomcat DONE"
runjbcs1236
runmodcluster736
if [ $? -ne 0 ]; then
echo "JBCS-1236 runjbcs1236 FAILED!"
echo "MODCLUSTER-736 runmodcluster736 FAILED!"
exit 1
fi
echo "runjbcs1236 DONE"
echo "runmodcluster736 DONE"

tomcat_all_remove
8 changes: 4 additions & 4 deletions test/setup-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if [ ! -d httpd_websocket-testsuite ]; then
fi
cd httpd_websocket-testsuite
git pull --rebase
mvn install || exit 1
mvn --batch-mode --no-transfer-progress install || exit 1
cp target/websocket-hello-0.0.1.war $TEST_DIR/websocket/
cd ..

Expand All @@ -45,11 +45,11 @@ if [ ! -d mod_cluster-testsuite ]; then
fi
cd mod_cluster-testsuite
git pull --rebase
mvn install || exit 2
mvn --batch-mode --no-transfer-progress install || exit 2
cd $TEST_DIR

# prepare jars
mvn install
mvn --batch-mode --no-transfer-progress install

# prepare tomcat test apps
mvn -f includes/pom-groovy.xml install
mvn --batch-mode --no-transfer-progress -f includes/pom-groovy.xml install
4 changes: 2 additions & 2 deletions test/testsuite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ run_test maintests.sh "Main tests"
res=$(expr $res + $?)
run_test websocket/basic.sh "Websocket tests"
res=$(expr $res + $?)
run_test JBCS-1236/testit.sh "JBCS-1236"
res=$(expr $res + $?)
run_test MODCLUSTER-640/testit.sh "MODCLUSTER-640"
res=$(expr $res + $?)
run_test MODCLUSTER-734/testit.sh "MODCLUSTER-734"
res=$(expr $res + $?)
run_test MODCLUSTER-736/testit.sh "MODCLUSTER-736"
res=$(expr $res + $?)
run_test MODCLUSTER-755/testit.sh "MODCLUSTER-755"
res=$(expr $res + $?)
run_test MODCLUSTER-785/testit.sh "MODCLUSTER-785"
Expand Down

0 comments on commit b7e92f2

Please sign in to comment.