Servers and Tests
Start development servers
Backend
The backend needs a built ui. Run
$ (cd ui && yarn build)Start the server in development mode.
$ go run .UI
Start the UI development server.
Commands must be executed inside the ui directory.
$ yarn startOpen http://localhost:3000 inside your favorite browser.
The UI requires a Gotify server running on localhost:80. This can be adjusted inside ui/src/index.tsx.
Update Swagger spec
The gotify/server REST-API is documented via Swagger. The Swagger definition is generated via source code comments (example comment).
After changing such a source code comment, you can run the following command to update the Swagger definition.
$ make update-swaggerTests
Execute Backend Tests
Run tests with parallelism
$ go test ./...Run Tests with Coverage
$ make test-coverage
$ go tool cover -html=coverage.txt # get a HTML coverage reportRun Tests with Race Detector
$ make test-raceExecute UI (end2end) Tests
Build the ui because the end2end test should be run against the production build. (This needs to be done on every change in the UI)
$ (cd ui && yarn build)Now execute the tests with yarn
$ (cd ui && yarn test)Execute Static Checks
The following command checks the formatting and executes some linters like tslint and govet.
$ make check