diff --git a/.github/workflows/build-charm.yaml b/.github/workflows/build-charm.yaml index ce1fdeb..9f55425 100644 --- a/.github/workflows/build-charm.yaml +++ b/.github/workflows/build-charm.yaml @@ -29,3 +29,43 @@ jobs: run: | cd vm_operator tox -e unit + + functional-test: + name: Functional tests + runs-on: ubuntu-latest + needs: + - unit-test + - lint + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install dependencies + run: python -m pip install tox + - name: Setup LXD + uses: canonical/setup-lxd@4e959f8e0d9c5feb27d44c5e4d9a330a782edee0 + - name: Run tests + run: | + cd vm_operator + tox -e functional + + integration-test: + name: Integration tests + runs-on: ubuntu-22.04 + needs: + - lint + - unit-test + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup hosts for tests + run: | + echo "10.64.140.43 testing-ratings.foo.bar" | sudo tee -a /etc/hosts + - name: Setup operator environment + uses: charmed-kubernetes/actions-operator@main + with: + provider: lxd + juju-channel: 3.2/stable + - name: Run integration tests + run: | + cd vm_operator + tox -e integration -- --model=testing diff --git a/snap/README.md b/snap/README.md new file mode 100644 index 0000000..5c966cd --- /dev/null +++ b/snap/README.md @@ -0,0 +1,35 @@ +# App Center Ratings Snap + +This directory contains files used to build the App Center Ratings snap. + +## Installation + +The snap provides a wrapper used to collect environment variables via `snapctl` in order for them to be configurable post the snap being built. + +You can install the App Center Ratings snap manually like so: + +```bash +# Install the snap +$ sudo snap install ratings --channel stable + +# Update an environment variable +sudo snap set ratings app-log-level=debug + +# Restart the service to reload environment variables into the service +sudo snap restart ratings +``` + +## Configuration + +This Snap is intended to run within a charm where certain configuration settings are unknown until the charm installs the snap and establishes relations to a database. + +The list of config options are: + +| Name | Options | Default | Description | +|:----------------------------|:--------------------------------|:---------------------------------------------------------------|:------------------------| +| `app-jwt-secret` | Any string | `randomized` | JWT secret | +| `app-log-level` | `error`, `warn`, `info`, `debug` | `info` | Log level | +| `app-postgres-uri` | Any string | `` | Service connection | +| `app-migration-postgres-uri`| Any string | `` | Migrator connection | + +Config options can be set using: `sudo snap set ratings