From 2561be475d258f9d5a41acf6d3fd74557a531881 Mon Sep 17 00:00:00 2001 From: Dan Cardin Date: Fri, 3 Dec 2021 11:23:15 -0500 Subject: [PATCH] fix: Broken MySQL container startup. MYSQL_USER for root user can no longer be supplied to container. --- CHANGELOG.md | 60 ++++++++------------ Makefile | 2 +- pyproject.toml | 2 +- src/pytest_mock_resources/container/mysql.py | 5 +- 4 files changed, 30 insertions(+), 39 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98bc5d18..50194ef8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,102 +1,92 @@ # Changelog +## [Unreleased](https://github.com/schireson/schireson-pytest-mock-resources/compare/v2.1.7...HEAD) (2021-12-03) + +### Fixes + +- Broken MySQL container startup. MYSQL_USER for root user can no longer be supplied to container. + ### [v2.1.7](https://github.com/schireson/schireson-pytest-mock-resources/compare/v2.1.6...v2.1.7) (2021-12-01) #### Fixes -* breaking changes required to support pymongo 4.0. - +- breaking changes required to support pymongo 4.0. 8e9a079 ### [v2.1.6](https://github.com/schireson/schireson-pytest-mock-resources/compare/v2.1.5...v2.1.6) (2021-11-22) #### Fixes -* Preempt socket warnings produced by the client not being closed manually. 4b3d9e0 -* readthedocs poetry error. 6369064 - +- Preempt socket warnings produced by the client not being closed manually. 4b3d9e0 +- readthedocs poetry error. 6369064 ### [v2.1.5](https://github.com/schireson/schireson-pytest-mock-resources/compare/v2.1.3...v2.1.5) (2021-11-22) #### Features -* Add ability to change image when running pmr c8679ec -* Use sqlalchemy's event system to apply redshift behavior. 2455620 +- Add ability to change image when running pmr c8679ec +- Use sqlalchemy's event system to apply redshift behavior. 2455620 #### Fixes -* Create pytest markers for all resources 1c7c449 -* Avoid mocking all of psycopg2 in the name of redshift. 6f38823 - +- Create pytest markers for all resources 1c7c449 +- Avoid mocking all of psycopg2 in the name of redshift. 6f38823 ### [v2.1.3](https://github.com/schireson/schireson-pytest-mock-resources/compare/v2.1.2...v2.1.3) (2021-09-20) #### Fixes -* Avoid deprecated sqlalchemy URL constructor. 3fa64d3 - +- Avoid deprecated sqlalchemy URL constructor. 3fa64d3 ### [v2.1.2](https://github.com/schireson/schireson-pytest-mock-resources/compare/v2.1.1...v2.1.2) (2021-08-24) #### Fixes -* support for sqlalchemy 1.3. 7fa4fda -* Use the proper MYSQL_USER env var for the mysql fixture. 648a0b1 -* Resolve linting issues related to changing linter versions. 59a983f -* Address poor handling of SQL statement parsing for redshift. d0d7685 - +- support for sqlalchemy 1.3. 7fa4fda +- Use the proper MYSQL_USER env var for the mysql fixture. 648a0b1 +- Resolve linting issues related to changing linter versions. 59a983f +- Address poor handling of SQL statement parsing for redshift. d0d7685 ### [v2.1.1](https://github.com/schireson/schireson-pytest-mock-resources/compare/v2.1.0...v2.1.1) (2021-08-17) #### Fixes -* Resolve linting issues related to changing linter versions. 7aebc6a -* Address poor handling of SQL statement parsing for redshift. 11c4b97 - +- Resolve linting issues related to changing linter versions. 7aebc6a +- Address poor handling of SQL statement parsing for redshift. 11c4b97 ## [v2.1.0](https://github.com/schireson/schireson-pytest-mock-resources/compare/v2.0.0...v2.1.0) (2021-06-29) ### Features -* Add async support (postgres) f45b078 - +- Add async support (postgres) f45b078 ## [v2.0.0](https://github.com/schireson/schireson-pytest-mock-resources/compare/v1.5.0...v2.0.0) (2021-06-02) - ## [v1.5.0](https://github.com/schireson/schireson-pytest-mock-resources/compare/v1.4.1...v1.5.0) (2021-02-17) - ### [v1.4.1](https://github.com/schireson/schireson-pytest-mock-resources/compare/v1.4.0...v1.4.1) (2020-10-08) #### Fixes -* Support breaking changes in pytest 6. d6dba02 - +- Support breaking changes in pytest 6. d6dba02 ## [v1.4.0](https://github.com/schireson/schireson-pytest-mock-resources/compare/v1.3.2...v1.4.0) (2020-08-25) ### Features -* Allow globbing table names to select subsets of tables. 55a8aaf - +- Allow globbing table names to select subsets of tables. 55a8aaf ### [v1.3.2](https://github.com/schireson/schireson-pytest-mock-resources/compare/v1.2.2...v1.3.2) (2020-05-28) #### Features -* Add mysql support 4a79ca6 +- Add mysql support 4a79ca6 #### Fixes -* Change user from 'user' to 'root' in mysql fixture method d1e193b - +- Change user from 'user' to 'root' in mysql fixture method d1e193b ### [v1.2.2](https://github.com/schireson/schireson-pytest-mock-resources/compare/v1.2.1...v1.2.2) (2020-04-02) - ### [v1.2.1](https://github.com/schireson/schireson-pytest-mock-resources/compare/v1.0.0...v1.2.1) (2020-03-26) - ## v1.0.0 (2020-01-23) - - diff --git a/Makefile b/Makefile index 22731ae8..ac59291e 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ build-package: poetry build build-docs: - pip install -r docs/requirments.txt + pip install -r docs/requirements.txt make -C docs html build: build-package build-docs diff --git a/pyproject.toml b/pyproject.toml index af039b65..81903625 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pytest-mock-resources" -version = "2.1.7" +version = "2.1.8" description = "A pytest plugin for easily instantiating reproducible mock resources." authors = [ "Omar Khan ", diff --git a/src/pytest_mock_resources/container/mysql.py b/src/pytest_mock_resources/container/mysql.py index ca83e108..6afdf1c7 100644 --- a/src/pytest_mock_resources/container/mysql.py +++ b/src/pytest_mock_resources/container/mysql.py @@ -1,7 +1,7 @@ import pytest import sqlalchemy -from pytest_mock_resources import compat +from pytest_mock_resources import compat from pytest_mock_resources.config import DockerContainerConfig, fallback from pytest_mock_resources.container.base import ContainerCheckFailed, get_container @@ -32,6 +32,8 @@ class MysqlConfig(DockerContainerConfig): "image": "mysql:5.6", "port": 3406, "ci_port": 3306, + # XXX: For now, username is disabled/ignored. We need root access for PMR + # internals. "username": "root", "password": "password", "root_database": "dev", @@ -96,7 +98,6 @@ def _mysql_container(pmr_mysql_config): {3306: pmr_mysql_config.port}, { "MYSQL_DATABASE": pmr_mysql_config.root_database, - "MYSQL_USER": pmr_mysql_config.username, "MYSQL_ROOT_PASSWORD": pmr_mysql_config.password, }, check_mysql_fn,