Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify test structure #502

Conversation

heehehe
Copy link
Contributor

@heehehe heehehe commented Oct 3, 2023

Resolve #499

Overview

As we add test for MySQL 8 in #484,
we need to create an additional class to test everything against MySQL 8.

So instead of creating a class based on the database, we'd like to change the test structure,
so that we only need to parameterize which database we want to test against and the entire list of tests will be triggered.

Changes

  • We added database setting information to pymysqlreplication/tests/config.json.
  • In order to get parameter in pytest, we added pymysqlreplication/tests/conftest.py
    and use --db parameter when running pytest.
  • With this --db parameter, we set up PyMySQLReplicationTestCase
    based on the entered target database to be tested.
  • Thus we could run tests for multiple databases without db-dependent classes
    : PyMySQLReplicationMariaDbTestCase, PyMySQLReplicationVersion8TestCase

Result

image

Collaborated with @mjs1995 @mikaniz @starcat37

@julien-duponchelle julien-duponchelle merged commit 8d003d2 into julien-duponchelle:main Oct 4, 2023
5 checks passed
@julien-duponchelle julien-duponchelle deleted the feature/change-test-structure branch October 4, 2023 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modify test structure
6 participants