Skip to content

chore: add brief explanations for bootstrap and destroy cmds #1781

chore: add brief explanations for bootstrap and destroy cmds

chore: add brief explanations for bootstrap and destroy cmds #1781

name: Integration Test
on:
pull_request:
merge_group:
workflow_dispatch:
jobs:
startjimm:
name: Test JIMM with Juju controller
runs-on: [self-hosted-linux-amd64-jammy-large]
steps:
- name: Checkout JIMM repo
uses: actions/checkout@v4
- name: Set up Docker Compose
uses: docker/setup-compose-action@v1
- name: Set up Microk8s
run: |
sudo snap install microk8s --classic
sudo usermod -a -G microk8s "$USER"
newgrp microk8s
sudo microk8s enable storage
subnet="$(ip route get 1 | head -n 1 | awk '{print $7}' | awk -F. '{print $1 "." $2 "." $3 ".240/24"}')"
echo "MetalLB subnet: $subnet"
sudo microk8s enable metallb:"$subnet"
echo "Microk8s setup complete"
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: Go vendor to speed up docker build
run: go mod vendor
- name: Start JIMM
uses: ./.github/actions/test-server
id: jaas
with:
jimm-version: dev
juju-channel: "3.6/stable"
ghcr-pat: ${{ secrets.GITHUB_TOKEN }}
# Build the JAAS plugin to test any changes made
# to it instead of using the snap version.
- name: Build JAAS plugin
run: go build ./cmd/jaas/
- name: Run integration tests
run: ./tests/run-tests.sh
env:
BACKING_CONTROLLER_NAME: ${{ steps.jaas.outputs.backing-controller-name }}
JIMM_CONTROLLER_NAME: ${{ steps.jaas.outputs.jimm-controller-name }}
- name: Stop the application container
run: docker stop jimm
- name: Check logs for shutdown message
run: |
APP_CONTAINER=jimm
LOGS=$(docker logs "$APP_CONTAINER" -n 20)
echo "$LOGS"
if echo "$LOGS" | grep -q "jimm shutdown complete"; then
echo "Graceful shutdown confirmed."
else
echo "Graceful shutdown message not found!"
exit 1
fi