Skip to content

Commit

Permalink
Enable MySQL 8 CI jobs (apache#11247)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaxil authored Oct 4, 2020
1 parent 1b9e59c commit 6dce7a6
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 8 deletions.
4 changes: 2 additions & 2 deletions BREEZE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1669,7 +1669,7 @@ This is the current syntax for `./breeze <./breeze>`_:
--mysql-version MYSQL_VERSION
Mysql version used. One of:
5.7
5.7 8
-v, --verbose
Show verbose information about executed docker, kind, kubectl, helm commands. Useful for
Expand Down Expand Up @@ -2035,7 +2035,7 @@ This is the current syntax for `./breeze <./breeze>`_:
--mysql-version MYSQL_VERSION
Mysql version used. One of:
5.7
5.7 8
****************************************************************************************************
Enable production image
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Apache Airflow is tested with:
| ------------ | ------------------------- | ------------------------ |
| Python | 3.6, 3.7, 3.8 | 2.7, 3.5, 3.6, 3.7, 3.8 |
| PostgreSQL | 9.6, 10 | 9.6, 10 |
| MySQL | 5.7 | 5.6, 5.7 |
| MySQL | 5.7, 8 | 5.6, 5.7 |
| SQLite | latest stable | latest stable |
| Kubernetes | 1.16.2, 1.17.0 | 1.16.2, 1.17.0 |

Expand Down
2 changes: 1 addition & 1 deletion breeze-complete
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ _breeze_allowed_kubernetes_modes="image"
_breeze_allowed_kubernetes_versions="v1.18.6 v1.17.5 v1.16.9"
_breeze_allowed_helm_versions="v3.2.4"
_breeze_allowed_kind_versions="v0.8.0"
_breeze_allowed_mysql_versions="5.7"
_breeze_allowed_mysql_versions="5.7 8"
_breeze_allowed_postgres_versions="9.6 10"
_breeze_allowed_kind_operations="start stop restart status deploy test shell"

Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/libraries/_initialization.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function initialization::initialize_base_variables() {
export CURRENT_POSTGRES_VERSIONS

# Currently supported versions of MySQL
CURRENT_MYSQL_VERSIONS+=("5.7")
CURRENT_MYSQL_VERSIONS+=("5.7" "8")
export CURRENT_MYSQL_VERSIONS

# Default Postgres versions
Expand Down
4 changes: 3 additions & 1 deletion scripts/ci/mysql/conf.d/airflow.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@


[mysqld]
explicit_defaults_for_timestamp=1
explicit_defaults_for_timestamp = 1
secure_file_priv = ""
local_infile = 1
4 changes: 2 additions & 2 deletions scripts/docker/install_mysql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ declare -a packages
if [[ "${1}" == "dev" ]]; then
packages=("libmysqlclient-dev" "mysql-client")
elif [[ "${1}" == "prod" ]]; then
packages=("libmysqlclient20" "mysql-client")
packages=("libmysqlclient21" "mysql-client")
else
echo
echo "Specify either prod or dev"
Expand Down Expand Up @@ -50,7 +50,7 @@ if [[ ${INSTALL_MYSQL_CLIENT:="true"} == "true" ]]; then
gpgconf --kill all
rm -rf "${GNUPGHOME}"
apt-key list > /dev/null
echo "deb http://repo.mysql.com/apt/debian/ stretch mysql-5.7" | tee -a /etc/apt/sources.list.d/mysql.list
echo "deb http://repo.mysql.com/apt/debian/ buster mysql-8.0" | tee -a /etc/apt/sources.list.d/mysql.list
apt-get update
apt-get install --no-install-recommends -y "${packages[@]}"
apt-get autoremove -yqq --purge
Expand Down
8 changes: 8 additions & 0 deletions tests/providers/mysql/hooks/test_mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,12 @@ def tearDown(self):
("mysql-connector-python",),
]
)
@mock.patch.dict(
'os.environ',
{
'AIRFLOW_CONN_AIRFLOW_DB': 'mysql://root@mysql/airflow?charset=utf8mb4&local_infile=1',
},
)
def test_mysql_hook_test_bulk_load(self, client):
with MySqlContext(client):
records = ("foo", "bar", "baz")
Expand Down Expand Up @@ -395,6 +401,8 @@ def test_mysql_hook_test_bulk_dump(self, client):
if priv and priv[0]:
# Confirm that no error occurs
hook.bulk_dump("INFORMATION_SCHEMA.TABLES", os.path.join(priv[0], "TABLES_{}".format(client)))
elif priv == ("",):
hook.bulk_dump("INFORMATION_SCHEMA.TABLES", "TABLES_{}".format(client))
else:
self.skipTest("Skip test_mysql_hook_test_bulk_load " "since file output is not permitted")

Expand Down

0 comments on commit 6dce7a6

Please sign in to comment.