Skip to content

Latest commit

 

History

History
119 lines (85 loc) · 3.57 KB

File metadata and controls

119 lines (85 loc) · 3.57 KB

Local Environment Setup

This document describes how to set up your local environment for TestGen development.

Prerequisites

Clone repository

Login to your GitHub account.

Fork the dataops-testgen repository, following GitHub's guide.

Clone your forked repository locally.

git clone https://github.com/YOUR-USERNAME/dataops-testgen

Set up virtual environment

We recommend using a Python virtual environment to avoid any dependency conflicts with other applications installed on your machine. The venv module, which is part of the Python standard library, or other third-party tools, like virtualenv or conda, can be used.

From the root of your local repository, create and activate a virtual environment with a TestGen-compatible version of Python (>=3.12). The steps may vary based on your operating system and Python installation - the Python packaging user guide is a useful reference.

On Linux/Mac

python3.12 -m venv venv
source venv/bin/activate

On Windows

py -3.12 -m venv venv
venv\Scripts\activate

Install dependencies

Install the Python dependencies in editable mode.

On Linux

pip install -e .[dev]

On Mac/Windows

pip install -e ".[dev]"

On Mac, you can optionally install watchdog for better performance of the file watcher used for local development.

xcode-select --install
pip install watchdog

Set environment variables

Create a local.env file with the following environment variables, replacing the <value> placeholders with appropriate values. Refer to the TestGen Configuration document for other supported values.

export TESTGEN_DEBUG=yes
export TESTGEN_LOG_TO_FILE=no
export TG_ANALYTICS=no
export TG_JWT_HASHING_KEY=<base64_key>
export TESTGEN_USERNAME=<username>
export TESTGEN_PASSWORD=<password>
export TG_DECRYPT_SALT=<decrypt_salt>
export TG_DECRYPT_PASSWORD=<decrypt_password>

Source the file to apply the environment variables.

source local.env

For the Windows equivalent, refer to this guide.

Set up Postgres instance

Run a PostgreSQL instance as a Docker container.

docker compose -f docker-compose.local.yml up -d

Initialize the application database for TestGen.

testgen setup-system-db --yes

Seed the demo data.

testgen quick-start

Run the Application

TestGen has two modules that have to be running: The web user interface (UI) and the Scheduler. The scheduler starts jobs (profiling, test execution, ...) at their scheduled times.

The following command starts both modules, each in their own process:

testgen run-app

Alternatively, you can run each individually:

testgen run-app ui
testgen run-app scheduler