Skip to content

Latest commit

 

History

History
62 lines (52 loc) · 1.55 KB

CONTRIBUTING.md

File metadata and controls

62 lines (52 loc) · 1.55 KB

Contributing

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

Prerequisites

Install Charmcraft and LXD:

sudo snap install --classic charmcraft
sudo snap install lxd
sudo adduser $USER lxd
newgrp lxd
lxd init --auto

Install MicroK8s:

sudo snap install microk8s --channel=1.27-strict/stable
sudo usermod -a -G snap_microk8s $USER
newgrp snap_microk8s
sudo microk8s enable hostpath-storage

Enable the Multus MicroK8s addon:

sudo microk8s addons repo add community https://github.com/canonical/microk8s-community-addons --reference feat/strict-fix-multus
sudo microk8s enable multus

Install pip and tox:

sudo apt install python3-pip
python3 -m pip install "tox>=4.0.0"

Development

Activate the virtual environment 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 lint                                             # code style
tox -e static                                           # static analysis
tox -e unit                                             # unit tests
tox -e integration -- --charm_path=PATH_TO_BUILD_CHARM  # integration tests
Integration tests require the charm to be built with `charmcraft pack` first.

Build

Go to the charm directory and run:

charmcraft pack