Skip to content

WIP

WIP #3

name: "E2E tests: JIMM, k8s charm and OIDC"

Check failure on line 1 in .github/workflows/e2e-jimm-k8s-charm-oidc-auth.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/e2e-jimm-k8s-charm-oidc-auth.yml

Invalid workflow file

(Line: 35, Col: 9): There's not enough info to determine what you meant. Add one of these properties: run, shell, uses, with, working-directory, (Line: 39, Col: 9): Unexpected value 'uses', (Line: 40, Col: 9): Unexpected value 'with'
on:
workflow_call:
inputs:
admin-username:
required: false
type: string
description: The username to use when logging in as the admin user.
default: admin
admin-password:
required: false
type: string
description: The password to use when logging in as the admin user.
default: test
permissions: read-all
jobs:
test:
name: Run tests
runs-on: self-hosted-linux-amd64-jammy-large
strategy:
matrix:
node-version: [22.x]
steps:
- name: Checkout Juju Dashboard repo
uses: actions/checkout@v4
- name: Configure action
id: config
uses: ./.github/actions/prepare-action
- name: Start JIMM
id: jimm
uses: ./.github/actions/setup-jimm
- name: Set up Juju Dashboard k8s charm
- name: Get up Docker build dep
run: sudo apt install docker-buildx
shell: bash
uses: ./.github/actions/setup-k8s-charm
with:
charm-channel: ${{ steps.config.outputs.dashboard-charm-channel }}
controller-app: jimm
controller-model: "${{ steps.jimm.outputs.jimm-controller-name }}:jimm"
dashboard-ref: ${{ steps.config.outputs.repo-ref }}
dashboard-resource: ${{ steps.config.outputs.k8s-dashboard-resource }}
- name: Configure JIMM with dashboard address
shell: bash
run: |
juju switch '${{ steps.jimm.outputs.jimm-controller-name }}':jimm
DASHBOARD_ADDRESS=http://$(juju show-unit dashboard/0 | yq .dashboard/0.address):8080
juju config jimm cors-allowed-origins="$DASHBOARD_ADDRESS"
juju config jimm juju-dashboard-location="$DASHBOARD_ADDRESS"/models
- name: Wait for JIMM to finish configuring
uses: nick-fields/retry@v3
with:
timeout_minutes: 1
max_attempts: 5 # Retry the wait-for with a short timeout in case it gets stuck and times out. If it fails after multiple tries it's probably a real error.
command: juju wait-for unit jimm/0 --timeout=1m
- name: Set the CLI admin's password
run: echo ${{ inputs.admin-password }} | juju change-user-password --no-prompt
- name: Run tests
uses: ./.github/actions/run-playwright
with:
setup: false # Playwright was set up in the setup-jimm action.
test-identifier: e2e-jimm-k8s-charm-oidc-auth
env:
JIMM_CONTROLLER_NAME: ${{ steps.jimm.outputs.jimm-controller-name }}
CONTROLLER_NAME: ${{ steps.jimm.outputs.workloads-controller-name }}
AUTH_MODE: oidc
JUJU_ENV: jimm
PROVIDER: microk8s
ADMIN_USERNAME: ${{ inputs.admin-username }}
ADMIN_PASSWORD: ${{ inputs.admin-password }}
- name: Display logs
if: failure()
uses: ./.github/actions/failure-log
with:
juju-env: "jimm"
controller: ${{ steps.jimm.outputs.jimm-controller-name }}
- name: Send notification on failure
if: steps.config.outputs.send-failure-notification && failure()
uses: ./.github/actions/send-notification
with:
webhook-url: ${{ secrets.WEBBOT_URL }}