20#ifndef ORES_TESTING_TEST_DATABASE_MANAGER_HPP
21#define ORES_TESTING_TEST_DATABASE_MANAGER_HPP
24#include "ores.utility/log/make_logger.hpp"
25#include "ores.database/domain/context.hpp"
26#include "ores.database/domain/database_options.hpp"
42 inline static std::string_view logger_name =
43 "ores.testing.test_database_manager";
46 static auto instance = ores::utility::log::make_logger(logger_name);
Testing infrastructure common to all test projects.
Definition database_helper.hpp:27
Context for the operations on a postgres database.
Definition context.hpp:30
Configuration for database connection.
Definition database_options.hpp:33
Manages isolated test databases for parallel test execution.
Definition test_database_manager.hpp:40
static void set_test_database_env(const std::string &db_name)
Sets the TEST_ORES_DB_DATABASE environment variable.
Definition test_database_manager.cpp:201
static void drop_test_database(const std::string &db_name)
Drops the test database.
Definition test_database_manager.cpp:149
static void create_test_database(const std::string &db_name)
Creates a test database from the oresdb_template.
Definition test_database_manager.cpp:113
static database::database_options make_database_options()
Creates database options from environment variables.
Definition test_database_manager.cpp:77
static std::string generate_test_database_name()
Generates a unique database name for this test process.
Definition test_database_manager.cpp:92
static database::context make_context()
Creates a database context from environment variables.
Definition test_database_manager.cpp:63