Canonical location for the PostgreSQL Imbi DDL.
There is a Dockerfile that creates an image that can be used for testing against Imbi database.
Example use in docker-compose.yaml:
%YAML 1.2
---
Imbi:
image: aweber/imbi-postgres:latest
ports:
- 5432The MANIFEST file contains all of the files that are used to construct the DDL that is used for the Imbi system. It should be edited for any files that are added or removed. The files are ordered properly for dependency in the MANIFEST file and care should be taken to ensure it stays that way.
The Makefile contains all of the glue required to tests against your DDL. All files ending in .sql will be lint checked using sqlint.
Tests are written using pgTap and all testing requirements are contained in the PostgreSQL container specified in the docker-compose.yaml.
The plpgsql_check extension is installed and should be used as part of your pgTAP tests. For example, the following example checks to ensure the function exists and that there are no linting errors:
BEGIN;
SELECT plan( 2 );
SELECT has_function('v1'::NAME, 'project_score'::NAME);
SELECT is_empty(
$$SELECT * FROM plpgsql_check_function('v1.project_score(INTEGER)');$$,
'v1.project_score/1 has no plpgsql_check errors');
SELECT * FROM finish();
ROLLBACK;To ensure your environment is ready for running tests run make bootstrap and then run make test. Test output will be sent to the console and recorded in JUnit output in the reports/junit_output.xml file.
.gitkeep files can and should be removed once you add a file to an empty directory.