Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Latest commit

 

History

History
54 lines (38 loc) · 1.59 KB

CONTRIBUTING.md

File metadata and controls

54 lines (38 loc) · 1.59 KB

Contributing

To make contributions to this charm, you'll need a working development setup.

You can use the environments created by tox for development:

tox --notest -e unit
source .tox/unit/bin/activate

Testing

This project uses tox for managing test environments. There are some pre-configured environments that can be used for linting and formatting code when you're preparing contributions to the charm:

tox -e fmt           # update your code according to linting rules
tox -e lint          # code style
tox -e unit          # unit tests
tox                  # runs 'lint', 'unit', 'static' and 'code-coverage' environments

Integration tests

To run the integration tests locally, you'll need to build the flask image first and load it into docker.
the following assume that you are running microk8s locally with the registry plugin.

cd sample_rock/
rockcraft pack
rockfile="$(find . -name "*.rock" -printf "%f")"
IFS=_ read -r image_name version _ <<< "$(echo "$rockfile")"
/snap/rockcraft/current/bin/skopeo --insecure-policy copy "oci-archive:$rockfile" "docker-daemon:$image_name:$version"
docker tag $image_name:$version localhost:32000/$image_name:$version
docker push localhost:32000/$image_name:$version

Then you can run the integration tests.

tox -e integration -- --flask-app-image localhost:32000/$image_name:$version

Build the charm

Build the charm in this git repository using:

charmcraft pack