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

MySQL tests fail after multiple runs #50

Open
amoeba opened this issue Feb 28, 2023 · 0 comments · May be fixed by #51
Open

MySQL tests fail after multiple runs #50

amoeba opened this issue Feb 28, 2023 · 0 comments · May be fixed by #51

Comments

@amoeba
Copy link

amoeba commented Feb 28, 2023

I noticed while running the tests locally that the MySQL tests started failing with an error (complete summary at the bottom):

MySQLdb.IntegrityError: (1062, "Duplicate entry '1' for key 'vendors.PRIMARY'")

I compared the setup blocks for MySQL and PostgreSQL and I see one difference is that the PostgreSQL block drops databases during setup while the MySQL block does not. @simonw do you test locally and have a setup that works for you? I'll submit a PR linked to this issue for how I worked around it.

Btw: I followed the README closely. I see that the tests on CI pass which I assume is because the databases are wiped on reach run.

Environment:

  • OS: macos (arm64)
  • Python: 3.11
  • db-to-sqlite version: v1.5 (b7c95fc)
pytest output summary
rs.PRIMARY'")
ERROR tests/test_docs.py::test_readme_contains_latest_help - MySQLdb.IntegrityError: (1062, "Duplicate entry '1' for key 'vendors.PRIMARY'")
ERROR tests/test_fixtures.py::test_fixture_mysql - MySQLdb.IntegrityError: (1062, "Duplicate entry '1' for key 'vendors.PRIMARY'")
ERROR tests/test_fixtures.py::test_fixture_postgresql - MySQLdb.IntegrityError: (1062, "Duplicate entry '1' for key 'vendors.PRIMARY'")
ERROR tests/test_redact.py::test_redact[mysql://root@127.0.0.1:3306/test_db_to_sqlite] - MySQLdb.IntegrityError: (1062, "Duplicate entry '1' for key 'vendors.PRIMARY'")
ERROR tests/test_redact.py::test_redact[postgresql://localhost/test_db_to_sqlite] - MySQLdb.IntegrityError: (1062, "Duplicate entry '1' for key 'vendors.PRIMARY'")
ERROR tests/test_redact.py::test_redact[postgres://localhost/test_db_to_sqlite] - MySQLdb.IntegrityError: (1062, "Duplicate entry '1' for key 'vendors.PRIMARY'")
=========================================================== 19 errors in 0.13s ============================================================
amoeba added a commit to amoeba/db-to-sqlite that referenced this issue Feb 28, 2023
@amoeba amoeba linked a pull request Feb 28, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant