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

Make postgres_cluster and config_psql_dos fixtures configurable #6254

Merged

Commits on Jan 31, 2024

  1. Make postgres_cluster and config_psql_dos fixtures configurable

    The `postgres_cluster` and `config_psql_dos` fixtures are made available
    publicly in order to help plugin packages with unit testing.
    Particularly, these fixtures should make it easy to generate test
    profiles using the `core.psql_dos` storage plugin, generating the
    postgres database in a test cluster that is created on-the-fly.
    
    The problem was that the interface did not actually allow to configure
    anything, such as the database name, but this was hardcoded. This would
    work fine in case it was used just once, but the fixtures could not be
    used to create a second profile, as the database name would already
    exist.
    
    The `postgres_cluster` fixture is turned into a factory, allowing the
    database name, username and password to be customized. The unbound
    method `create_database` is added to the `PGTest` instance that it
    returns to easily create a new database.
    
    The `config_psql_dos` fixture now actually forwards the relevant part of
    the `custom_configuration` to the `postgres_cluster.create_database`
    call.
    
    Finally, the `aiida_profile_factory` fixture factory now makes the
    `custom_configuration` argument actually optional, as originally was
    intended.
    sphuber committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    ac89e08 View commit details
    Browse the repository at this point in the history