Skip to content

Development

Testing

To run the tests, run the following command:

go test ./...

or use the make command:

make test

To run the tests with verbose output, run the following command:

go test -v ./...

To run a specific test suite, run the following command:

go test -v ./test_suite.go

To run a specific test, run the following command:

go test -v ./test_suite.go -run TestName

Running Hide locally

To run Hide locally, run the following command:

go run ./cmd/hide

or use the make command:

make run

This will start a local server at http://127.0.0.1:8080/.

Release

To release a new version of Hide, follow these steps:

  1. Create a new release using the GitHub UI or the command line. For example, to create a new release with the command line, run the following command:

    gh release create vX.Y.Z --title "Hide vX.Y.Z" --generate-notes
    

    Replace X.Y.Z with the version number of the new release following the semantic versioning convention.

    For additional options and for UI instructions, refer to the GitHub documentation.

  2. Update the version in the hide brew formula:

  3. Copy the URL of the new release (tar.gz file) from the GitHub UI or the command line.
  4. Get the SHA256 checksum of the new release (tar.gz file) using the command line:

    sha256sum vX.Y.Z.tar.gz
    
  5. Update the url and the sha256 fields in the hide-brew.rb file to the new release URL and checksum.

Documentation

The documentation is built using MkDocs. To build the documentation, install MkDocs

pip install mkdocs

and then run the following command:

mkdocs build

The documentation will be built in the site directory.

To serve the documentation locally, run the following command:

mkdocs serve

This will start a local server at http://127.0.0.1:8000/.

OpenAPI

The OpenAPI specification is defined in the openapi.yaml file. To run the Swagger Editor and visualize the OpenAPI specification, run the following command:

docker run -p 8081:8080 -v $(pwd):/tmp -e SWAGGER_FILE=/tmp/openapi.yaml swaggerapi/swagger-editor

This will start a local server at http://127.0.0.1:8081/.