Servers and Tests
Start development servers
Backend
The backend embeds the built UI, so build it first.
$ (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:5173 inside your favorite browser.
The UI development server proxies API requests to a Gotify server running on localhost:80. Create a gotify-server.env in the gotify/server repository containing GOTIFY_SERVER_PORT=8080 to change the port.
Update Swagger spec
The gotify/server REST-API is documented via Swagger. The Swagger definition is generated from source code comments (example comment).
After changing such a comment, run the following command to update the Swagger definition.
$ make update-swaggerTests
Execute Backend Tests
Run tests
$ go test ./...Run Tests with Coverage
$ make test-coverage
$ go tool cover -html=coverage.txt # get a HTML coverage reportExecute UI (end2end) Tests
Build the UI because the end2end tests run against the production build. (This needs to be done after 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, runs linters like golangci-lint and eslint, and verifies that the Swagger spec is up to date.
$ make check