Install TestGen with pip¶
As an alternative to the Docker Compose installation, you can install TestGen as a Python package via pip. This mode requires you to provision your own PostgreSQL instance for the application database and manage Python dependencies directly.
Tip
For most users, the Docker-based installation (Mac/Linux or Windows) is recommended. Docker encapsulates all dependencies and does not require a separate PostgreSQL setup.
Prerequisites¶
Install the following prerequisites, and verify that their versions are supported.
| Software | Supported versions | Command to check version |
|---|---|---|
| Python 3 Most Linux and macOS systems have Python pre-installed. On Windows, you will need to download and install. |
3.12 | python3 --version |
| PostgreSQL A running PostgreSQL instance for the TestGen application database. The connection user must have privileges to create roles, databases, and schemas. |
14, 15, 16 | psql --version |
How to install TestGen¶
-
Create and activate a Python virtual environment with Python 3.12 or later.
On Linux/Mac:
On Windows:
-
Install the TestGen package.
-
Verify that the
testgenCLI is available.
How to configure the application database¶
-
Create a file named
local.envwith the following environment variables. Replace the<value>placeholders with values for your environment.# PostgreSQL connection export TG_METADATA_DB_HOST=<postgres_hostname> export TG_METADATA_DB_PORT=<postgres_port> export TG_METADATA_DB_USER=<postgres_username> export TG_METADATA_DB_PASSWORD=<postgres_password> # Encryption key for secrets stored in the application database export TG_DECRYPT_PASSWORD=<encryption_password> export TG_DECRYPT_SALT=<encryption_salt> # Default admin user credentials export TESTGEN_USERNAME=<username> export TESTGEN_PASSWORD=<password> # Signing key for authentication tokens (base64-encoded) export TG_JWT_HASHING_KEY=<base64_key> # Log file path export TESTGEN_LOG_FILE_PATH=<path_for_logs>For the full list of supported configuration options, see Configuration.
-
Source the file to apply the environment variables.
On Windows, set each variable using
setor$env:— see this guide for details. -
Initialize the application database.
How to run TestGen¶
Start the application. The UI opens at http://localhost:8501.
Log in with the TESTGEN_USERNAME and TESTGEN_PASSWORD values you configured above.
How to set up demo data¶
To explore TestGen with sample data, run the quick-start command:
Tip
To upgrade an instance of TestGen to the latest released version, see Upgrade TestGen. For other post-install tasks, see Administer TestGen.