Code directorymage_ai/server/

Style guide


Install flake8 in your IDE to lint the Python code.

To run the linter locally, execute this script:



Unit tests

Add unit tests for the feature in mage_ai/tests directory.

To run the tests locally, execute this script:


It is also possible to run unit tests directly in a live docker instance, as given in the following steps.

  1. Find out the backend server container name, with the command docker container ls in a terminal:
 % docker container ls

CONTAINER ID   IMAGE       COMMAND                  CREATED      STATUS          PORTS                    NAMES
8dbcfbe41755   mage/data   "./scripts/install_a…"   5 days ago   Up 38 minutes>3000/tcp   mage-ai-app-1
b9d811e1e3e8   mage/data   "python mage_ai/serv…"   5 days ago   Up 38 minutes>6789/tcp   mage-ai-server-1
  1. Start an interactive bash session with the backend server container:
% docker exec -it mage-ai-server-1 /bin/bash
  1. Run unit tests with the following command:
root@b9d811e1e3e8:/home/src# python3 -m unittest discover -s mage_ai.tests --failfast



Data integrations

Streaming pipelines