Skip to content

Commit fb6a8db

Browse files
committed
Update database matrix to include MySQL 8.4 and 9, remove 5
1 parent ccd1ec0 commit fb6a8db

File tree

10 files changed

+38
-23
lines changed

10 files changed

+38
-23
lines changed

.github/workflows/boot-integration-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
database: [ 'postgresql-11', 'postgresql-15', 'postgresql-16', 'mysql', 'mysql-8' ]
15+
database: [ 'postgresql-11', 'postgresql-15', 'postgresql-16', 'mysql-8', 'mysql-8.4', 'mysql-9' ]
1616
container:
1717
image: cfidentity/uaa-${{ matrix.database }}
1818
volumes:
1919
- ${{ github.workspace }}:/root/uaa
2020
options: --privileged --tty --interactive --shm-size=1G
2121
steps:
2222
- name: Set env
23-
run: echo "DB=$(echo ${{ matrix.database }} | sed 's/[-0-9]//g')" >> $GITHUB_ENV
23+
run: echo "DB=$(echo ${{ matrix.database }} | sed 's/-[0-9.]*//g')" >> $GITHUB_ENV
2424
- name: Check out repository code
2525
uses: actions/checkout@v5
2626
- name: Integration tests on container

.github/workflows/integration-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
database: [ 'postgresql-11', 'postgresql-15', 'postgresql-16', 'mysql', 'mysql-8' ]
15+
database: [ 'postgresql-11', 'postgresql-15', 'postgresql-16', 'mysql-8', 'mysql-8.4', 'mysql-9' ]
1616
container:
1717
image: cfidentity/uaa-${{ matrix.database }}
1818
volumes:
1919
- ${{ github.workspace }}:/root/uaa
2020
options: --privileged --tty --interactive --shm-size=1G
2121
steps:
2222
- name: Set env
23-
run: echo "DB=$(echo ${{ matrix.database }} | sed 's/[-0-9]//g')" >> $GITHUB_ENV
23+
run: echo "DB=$(echo ${{ matrix.database }} | sed 's/-[0-9.]*//g')" >> $GITHUB_ENV
2424
- name: Check out repository code
2525
uses: actions/checkout@v5
2626
- name: Integration tests on container

.github/workflows/unit-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
database: [ 'postgresql-11', 'postgresql-15', 'postgresql-16', 'mysql', 'mysql-8' ]
15+
database: [ 'postgresql-11', 'postgresql-15', 'postgresql-16', 'mysql-8', 'mysql-8.4', 'mysql-9' ]
1616
container:
1717
image: cfidentity/uaa-${{ matrix.database }}
1818
volumes:
1919
- ${{ github.workspace }}:/root/uaa
2020
options: --privileged --tty --interactive --shm-size=1G
2121
steps:
2222
- name: Set env
23-
run: echo "DB=$(echo ${{ matrix.database }} | sed 's/[-0-9]//g')" >> $GITHUB_ENV
23+
run: echo "DB=$(echo ${{ matrix.database }} | sed 's/-[0-9.]*//g')" >> $GITHUB_ENV
2424
- name: Check out repository code
2525
uses: actions/checkout@v5
2626
- name: JUnit tests on container

remove.me

Whitespace-only changes.

run-integration-tests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ case "${DB}" in
2525
PROFILE_NAME="$DB"
2626
;;
2727

28-
mysql|mysql-8)
29-
DB_IMAGE_NAME=mysql-8
28+
mysql-8|mysql-8.4|mysql-9)
29+
DB_IMAGE_NAME=$1
3030
PROFILE_NAME=mysql
3131
;;
3232

run-unit-tests.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ case "${DB}" in
2727
PROFILE_NAME=postgresql
2828
;;
2929

30-
mysql|mysql-8)
31-
DB_IMAGE_NAME=mysql-8
30+
mysql-8|mysql-8.4|mysql-9)
31+
DB_IMAGE_NAME=$1
3232
DB=mysql
3333
PROFILE_NAME=mysql
3434
;;
3535

36-
mysql-5)
36+
mysql|mysql-5)
3737
DB_IMAGE_NAME=mysql
3838
DB=mysql
3939
PROFILE_NAME=mysql

scripts/integration-tests

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,8 @@ set -eu -o pipefail
33

44
UAA_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
55

6-
"${UAA_DIR}/scripts/gradle" integrationTest "${@}"
6+
if [ "$#" -eq 0 ]; then
7+
"${UAA_DIR}/scripts/gradle" integrationTest
8+
else
9+
"${UAA_DIR}/scripts/gradle" integrationTest "${@}"
10+
fi

scripts/integration-tests.sh

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,11 @@ source $DIR/start_db_helper.sh
3232

3333
TESTENV="$1"
3434
BOOT="${2:-false}"
35-
36-
3735
SKIP_BOOT_RUN="-Dcargo.tests.run=true"
3836
if [[ "${BOOT:-false}" = 'boot' ]]; then
3937
SKIP_BOOT_RUN="-Dcargo.tests.run=false"
4038
fi
4139

42-
4340
cat <<EOF >>/etc/hosts
4441
127.0.0.1 testzone1.localhost
4542
127.0.0.1 testzone2.localhost
@@ -48,14 +45,28 @@ cat <<EOF >>/etc/hosts
4845
127.0.0.1 testzonedoesnotexist.localhost
4946
127.0.0.1 oidcloginit.localhost
5047
127.0.0.1 testzoneinactive.localhost
48+
127.0.0.1 ldap01.example.com
5149
EOF
5250

5351
bootDB "${DB}"
5452

5553
pushd $(dirname $DIR)
56-
/etc/init.d/slapd start
57-
ldapadd -Y EXTERNAL -H ldapi:/// -f ./scripts/ldap/ldap_slapd_schema.ldif
58-
ldapadd -x -D 'cn=admin,dc=test,dc=com' -w password -f ./scripts/ldap/ldap_slapd_data.ldif
54+
if [ -f /etc/init.d/slapd ]; then
55+
# Debian Linux: slapd started via init.d
56+
/etc/init.d/slapd start
57+
sleep 5
58+
ldapadd -Y EXTERNAL -H ldapi:/// -f ./scripts/ldap/ldap_slapd_schema.ldif
59+
ldapadd -x -D 'cn=admin,dc=test,dc=com' -w password -f ./scripts/ldap/ldap_slapd_data.ldif
60+
elif [ -f /usr/local/openldap/libexec/slapd ]; then
61+
# Oracle Linux: slapd started with specific command and TLS enabled
62+
/usr/local/openldap/libexec/slapd -f /usr/local/openldap/etc/openldap/slapd.conf -h "ldap:/// ldaps:///" -u ldap -g ldap &
63+
sleep 5
64+
LDAPTLS_CACERT=/etc/ssl/certs/cacert.pem ldapadd -x -D 'cn=admin,dc=test,dc=com' -w password -H ldaps://ldap01.example.com/ -f ./scripts/ldap/ldap_slapd_schema.ldif
65+
LDAPTLS_CACERT=/etc/ssl/certs/cacert.pem ldapadd -x -D 'cn=admin,dc=test,dc=com' -w password -H ldaps://ldap01.example.com/ -f ./scripts/ldap/ldap_slapd_data.ldif
66+
else
67+
echo "LDAP setup not detected"
68+
exit 1
69+
fi
5970

6071
readonly launchBoot="nohup java -DCLOUDFOUNDRY_CONFIG_PATH=`pwd`/scripts/cargo \
6172
-DSECRETS_DIR=`pwd`/scripts/cargo \

scripts/start_db_helper.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ function createDB() {
1010
true
1111
}
1212

13-
1413
function bootDB {
1514
db=$1
1615

@@ -25,7 +24,6 @@ function bootDB {
2524
psql -c "create database $DATABASE_NAME;" -U postgres;
2625
}
2726

28-
2927
elif [[ "${db}" = "mysql" ]] || [[ "${db}" = "mysql-5" ]]; then
3028
bootLogLocation="/var/log/mysql-boot.log"
3129
launchDB="(MYSQL_DATABASE=uaa MYSQL_ROOT_HOST=127.0.0.1 MYSQL_ROOT_PASSWORD='changeme' bash /entrypoint.sh mysqld &> ${bootLogLocation}) &"
@@ -91,7 +89,6 @@ function bootDB {
9189
fi
9290
done
9391

94-
9592
for db_id in `seq 1 $NUM_OF_DATABASES_TO_CREATE`; do
9693
createDB $db_id
9794
done

scripts/unit-tests

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22
set -eu -o pipefail
33

44
UAA_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
5-
6-
"${UAA_DIR}/scripts/gradle" test "${@}"
5+
if [ "$#" -eq 0 ]; then
6+
"${UAA_DIR}/scripts/gradle" test
7+
else
8+
"${UAA_DIR}/scripts/gradle" test "${@}"
9+
fi

0 commit comments

Comments
 (0)