mirror of
https://github.com/baserow/baserow.git
synced 2026-12-05 08:48:35 +00:00
1.6 KiB
1.6 KiB
Running Tests
Backend
To run backend tests, start and attach to the backend container as described in
running-the-dev-environment.md. Once inside
the container, execute make test or make test-parallel to run the tests.
The tests use the config.settings.tests configuration, which sets base
variables and ignores environment variables in the .env file. The .env file
is intended for production or development mode.
Customize Test Settings
You can customize test settings by creating a .env.testing file in the
backend directory. For example:
# backend/.env.testing
BASEROW_MAX_FIELD_LIMIT=1
Running Tests Outside the Backend Container
To run tests outside the backend container, follow these steps:
- Create a Python virtual environment. See supported to determine the supported version of Python.
- From the backend directory, install the required packages with
pip install requirements/base.txtandpip install requirements/dev.txt. - Set environment variables to connect to the database. Create a
.env.testing-localfile in the backend directory. At a minimum, setDATABASE_HOSTtolocalhostsince the default value ofdbis only valid inside the docker network.
# backend/.env.testing-local
DATABASE_HOST=localhost
- Export the
TEST_ENV_FILEvariable to specify the environment file:
export TEST_ENV_FILE='.env.testing-local'
- Run
make testormake test-parallelfrom your shell outside the containers in the backend directory.