This guide assumes you have the commands
go (>= 1.13),
GoAlert is built and tested against Postgres 11. Version 9.6 should still work as of this writing, but is not recomended as future versions may begin using newer features.
The easiest way to setup Postgres for development is to run
This will start a docker container with the correct configuration for the dev environment.
If you already have Postgres running locally you can create the
CREATE ROLE goalert WITH LOGIN SUPERUSER;
Currently the dev user must be a superuser to enable
make regendbto migrate and add test data into the DB. This includes adding an admin user
make bin/goalert BUNDLE=1.
To run automated browser tests, you can start Cypress in one of the following modes:
make cy-wideWidescreen format, in dev mode.
make cy-mobileMobile format, in dev mode.
make cy-wide-prodWidescreen format, production build.
make cy-mobile-prodMobile format, production build.
The Cypress UI should start automatically.
More information about browser tests can be found here.
A suite of functional/behavioral tests are maintained for the backend code. These test various APIs and behaviors of the GoAlert server component.
Run the full suite with
More information about smoketests can be found here.
All unit tests can be run with
UI Unit tests are found under the directory of the file being tested, with the same file name, appended with
.test.js. They can be run independently of the Go unit tests with
make jest. Watch mode can be enabled with
make jest JEST_ARGS=--watch.