Observes unit tests
To develop a unit test, add it to the correspongin environment folder,
for example, observes/etl/gitlab/tests
:
-
Entering the testing environment:
To access the testing environment, navigate to the Observes directory in the
Universe
repository. Within this directory, you will find various subdirectories corresponding to different archtecture components and products. Observes is responsible for Extract, Transform, Load (ETL) processes, which involve data tranpsportation. Inside theetl
directory you’ll find several bash scripts. Since these scripts are not written in Python, there is no linting process invovled.Once your test is ready, format your code by running this command within the
universe
repository:Subproducts of Observes, such as
etl
,singer
, contain separate Python packages. Each subproduct can be imported independently and has its own isolated environment.To enter the environment, navigate to the desired subproduct directory, for example
/observes/singer/tap-delighted
Ensure you have
direnv
installed and executedirenv allow
to activate the environment. You can verify the Python interpreter being used with the commandwhich python
. This Python interpreter is unique to each product and includes all necesary dependencies and libraries. -
Running tests:
Our unit test run in our CI/CD pipeline, every time a developer pushes changes to our repository.
Tests are located in the test directory of each subproduct. While there is a test job in the CI pipleine located at
observes/singer/tap-delighted/check/tests
, you can also run tests manually with the command:Each environment’s test are distinguished by the path of each subproduct. For example, when in the GitLab environment, tests specific to that environment are automatically detected.
Note: Unit tests must be reproducible and pass consistently. If tests fail, the package build process will not execute properly, as the tests are integrated into the build.