mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-18 15:33:02 +00:00
Merge pull request #4233 from minrk/ci-db-versions
ci: update database image versions
This commit is contained in:
@@ -22,7 +22,7 @@ if [[ "$DB" == "mysql" ]]; then
|
|||||||
# ref server: https://hub.docker.com/_/mysql/
|
# ref server: https://hub.docker.com/_/mysql/
|
||||||
# ref client: https://dev.mysql.com/doc/refman/5.7/en/setting-environment-variables.html
|
# ref client: https://dev.mysql.com/doc/refman/5.7/en/setting-environment-variables.html
|
||||||
#
|
#
|
||||||
DOCKER_RUN_ARGS="-p 3306:3306 --env MYSQL_ALLOW_EMPTY_PASSWORD=1 mysql:5.7"
|
DOCKER_RUN_ARGS="-p 3306:3306 --env MYSQL_ALLOW_EMPTY_PASSWORD=1 mysql:8.0"
|
||||||
READINESS_CHECK="mysql --user root --execute \q"
|
READINESS_CHECK="mysql --user root --execute \q"
|
||||||
elif [[ "$DB" == "postgres" ]]; then
|
elif [[ "$DB" == "postgres" ]]; then
|
||||||
# Environment variables can influence both the postgresql server in the
|
# Environment variables can influence both the postgresql server in the
|
||||||
@@ -36,7 +36,7 @@ elif [[ "$DB" == "postgres" ]]; then
|
|||||||
# used by the postgresql client psql, so we configure the user based on how
|
# used by the postgresql client psql, so we configure the user based on how
|
||||||
# we want to connect.
|
# we want to connect.
|
||||||
#
|
#
|
||||||
DOCKER_RUN_ARGS="-p 5432:5432 --env "POSTGRES_USER=${PGUSER}" --env "POSTGRES_PASSWORD=${PGPASSWORD}" postgres:9.5"
|
DOCKER_RUN_ARGS="-p 5432:5432 --env "POSTGRES_USER=${PGUSER}" --env "POSTGRES_PASSWORD=${PGPASSWORD}" postgres:15.1"
|
||||||
READINESS_CHECK="psql --command \q"
|
READINESS_CHECK="psql --command \q"
|
||||||
else
|
else
|
||||||
echo '$DB must be mysql or postgres'
|
echo '$DB must be mysql or postgres'
|
||||||
|
@@ -19,8 +19,9 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Configure a set of databases in the database server for upgrade tests
|
# Configure a set of databases in the database server for upgrade tests
|
||||||
|
# this list must be in sync with versions in test_db.py:test_upgrade
|
||||||
set -x
|
set -x
|
||||||
for SUFFIX in '' _upgrade_100 _upgrade_122 _upgrade_130 _upgrade_150 _upgrade_211; do
|
for SUFFIX in '' _upgrade_110 _upgrade_122 _upgrade_130 _upgrade_150 _upgrade_211; do
|
||||||
$SQL_CLIENT "DROP DATABASE jupyterhub${SUFFIX};" 2>/dev/null || true
|
$SQL_CLIENT "DROP DATABASE jupyterhub${SUFFIX};" 2>/dev/null || true
|
||||||
$SQL_CLIENT "CREATE DATABASE jupyterhub${SUFFIX} ${EXTRA_CREATE_DATABASE_ARGS:-};"
|
$SQL_CLIENT "CREATE DATABASE jupyterhub${SUFFIX} ${EXTRA_CREATE_DATABASE_ARGS:-};"
|
||||||
done
|
done
|
||||||
|
@@ -35,7 +35,9 @@ def generate_old_db(env_dir, hub_version, db_url):
|
|||||||
check_call([env_py, populate_db, db_url])
|
check_call([env_py, populate_db, db_url])
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('hub_version', ['1.0.0', "1.2.2", "1.3.0", "1.5.0", "2.1.1"])
|
# changes to this version list must also be reflected
|
||||||
|
# in ci/init-db.sh
|
||||||
|
@pytest.mark.parametrize('hub_version', ["1.1.0", "1.2.2", "1.3.0", "1.5.0", "2.1.1"])
|
||||||
async def test_upgrade(tmpdir, hub_version):
|
async def test_upgrade(tmpdir, hub_version):
|
||||||
db_url = os.getenv('JUPYTERHUB_TEST_DB_URL')
|
db_url = os.getenv('JUPYTERHUB_TEST_DB_URL')
|
||||||
if db_url:
|
if db_url:
|
||||||
|
Reference in New Issue
Block a user