Skip to content

[BUG] Missing database dependencies when running the test suite #498

@marbru

Description

@marbru

Bug description

When installing the test requirements for the project, as such:

pip install -r tests/requirements/requirements_base.txt

I got a pg_config executable not found error (on Ubuntu) because I was missing a postgres-related libpq-dev package.

Proposed solution

For the usecase of running the test suite locally, SQLite is used rather than postgres, so technically there should be no need to install packages for other databases.

A proposed solution by @fsbraun would be to split requirements_base.txt into two files:

  • requirements_dev.txt for local development, contaning all packages except the database drivers
  • requirements_base.txt, building upon `requirements_dev, including the DB packages

Eg, requirements_base.txt would now look like this:

-r requirements_dev.txt
mysqlclient
psycopg3

And to run the test suite locally you would only install requirements_dev.txt

pip install -r tests/requirements/requirements_dev.txt

Documentation on testing would need updating too to reflect this change: https://github.com/django-cms/djangocms-versioning?tab=readme-ov-file#testing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions