Cross-controller integration testing for opensearch #124
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Integration tests | |
on: | |
pull_request: | |
workflow_call: | |
jobs: | |
integration-test-microk8s: | |
name: Integration tests (microk8s) | |
strategy: | |
fail-fast: false | |
matrix: | |
tox-environments: | |
- integration-charm | |
- integration-scaling | |
- integration-upgrades | |
- integration-policy | |
- integration-usersync | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup operator environment | |
uses: charmed-kubernetes/actions-operator@main | |
with: | |
juju-channel: 3.1/stable | |
provider: microk8s | |
microk8s-addons: "ingress storage dns rbac registry" | |
channel: 1.25-strict/stable | |
- name: Run integration tests | |
run: tox -e ${{ matrix.tox-environments }} | |
integration-test-cross-controller: | |
name: Integration tests (microk8s & lxd) | |
strategy: | |
matrix: | |
tox-environments: | |
- integration-opensearch | |
runs-on: ["self-hosted", "linux", "X64", "jammy", "xlarge"] | |
timeout-minutes: 120 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get prefsrc | |
run: | | |
echo "IPADDR=$(ip -4 -j route get 2.2.2.2 | jq -r '.[] | .prefsrc')" >> $GITHUB_ENV | |
- name: Setup K8s environment | |
uses: charmed-kubernetes/actions-operator@main | |
with: | |
juju-channel: 3.1/stable | |
provider: microk8s | |
microk8s-addons: "hostpath-storage dns metallb:${{ env.IPADDR }}-${{ env.IPADDR }}" | |
channel: 1.26-strict/stable | |
- name: Save K8s controller name | |
id: k8s-controller | |
run: echo "name=$CONTROLLER_NAME" >> $GITHUB_OUTPUT | |
- name: Setup LXD environment | |
uses: charmed-kubernetes/actions-operator@main | |
with: | |
juju-channel: 3.1/stable | |
provider: lxd | |
- name: Save LXD controller name | |
id: lxd-controller | |
run: echo "name=$CONTROLLER_NAME" >> $GITHUB_OUTPUT | |
- name: Run integration tests | |
run: tox -e ${{ matrix.tox-environments }} | |
env: | |
K8S_CONTROLLER: ${{ steps.k8s-controller.outputs.name }} | |
LXD_CONTROLLER: ${{ steps.lxd-controller.outputs.name }} | |
- name: Dump debug log | |
if: failure() | |
run: for ctl in $(juju controllers --format json | jq -r '.controllers | keys[]'); do for mdl in $(juju models --format json | jq -r '.models[].name' | grep -v "admin/controller"); do juju debug-log -m $ctl:$mdl --replay --ms --no-tail; done; done || true | |
shell: bash |