Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 E2E: Run as github workflow #1771

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/e2e-test-periodic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Periodic E2E Test

on:
schedule:
# Run every day at 02:20 UTC (it is recommended to avoid running at the start of the hour)
- cron: '20 2 * * *'

permissions: {}

jobs:
periodic-e2e-test:
strategy:
fail-fast: false
matrix:
bmc-protocol:
- redfish
- redfish-virtualmedia
- ipmi
uses: ./.github/workflows/e2e-test.yml
with:
bmc-protocol: ${{ matrix.bmc-protocol }}
permissions:
contents: read
32 changes: 32 additions & 0 deletions .github/workflows/e2e-test-pull.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: E2E Test

on:
pull_request:
branches:
- 'main'
- 'release-*'
paths-ignore:
- '**/*.md'
- 'docs/**'
- '.gitignore'
- 'hack/*.sh'
- 'LICENSE'
- 'SECURITY_CONTACTS'
- 'DCO'
- 'OWNERS'

permissions: {}

jobs:
e2e-test:
strategy:
fail-fast: false
matrix:
bmc-protocol:
- redfish-virtualmedia
- ipmi
uses: ./.github/workflows/e2e-test.yml
with:
bmc-protocol: ${{ matrix.bmc-protocol }}
permissions:
contents: read
47 changes: 47 additions & 0 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: E2E Test

on:
workflow_call:
inputs:
bmc-protocol:
required: true
type: string
runner:
type: string
default: "ubuntu-latest-4-cores"

permissions: {}

jobs:
test:
name: e2e test
runs-on: ${{ inputs.runner }}

permissions:
contents: read

steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4

- name: Install libvirt
run: |
sudo apt-get update
sudo apt-get install -y libvirt-daemon-system qemu-kvm virt-manager

- name: Run BMO e2e Tests
env:
BMC_PROTOCOL: ${{ inputs.bmc-protocol }}
# We need a new shell to pick up the new group. That is why we do the sudo -s -u $USER ...
# Remove the pre-installed go version. We install the exact version we need.
run: |
sudo usermod -a -G libvirt $USER
sudo rm /usr/bin/go
sudo -s -u $USER bash ${{ github.workspace }}/hack/ci-e2e.sh

- name: Upload artifacts
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: artifacts-${{ inputs.bmc-protocol }}.tar.gz
path: test/e2e/_artifacts
if-no-files-found: error
overwrite: false
10 changes: 5 additions & 5 deletions hack/ci-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ BMO_E2E_EMULATOR=${BMO_E2E_EMULATOR:-"sushy-tools"}

# Ensure requirements are installed
"${REPO_ROOT}/hack/e2e/ensure_go.sh"
export PATH="${PATH}:/usr/local/go/bin"
export PATH="/usr/local/go/bin:${PATH}"
"${REPO_ROOT}/hack/e2e/ensure_minikube.sh"
"${REPO_ROOT}/hack/e2e/ensure_htpasswd.sh"
# CAPI test framework uses kubectl in the background
Expand Down Expand Up @@ -136,10 +136,10 @@ ssh-keygen -t ed25519 -f "${IMAGE_DIR}/ssh_testkey" -q -N ""
BMO_OVERLAY="${REPO_ROOT}/config/overlays/e2e"
IRONIC_OVERLAY="${REPO_ROOT}/ironic-deployment/overlays/e2e"

IRONIC_USERNAME="$(tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 12 | head -n 1)"
IRONIC_PASSWORD="$(tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 12 | head -n 1)"
IRONIC_INSPECTOR_USERNAME="$(tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 12 | head -n 1)"
IRONIC_INSPECTOR_PASSWORD="$(tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 12 | head -n 1)"
IRONIC_USERNAME="$(uuidgen)"
IRONIC_PASSWORD="$(uuidgen)"
IRONIC_INSPECTOR_USERNAME="$(uuidgen)"
IRONIC_INSPECTOR_PASSWORD="$(uuidgen)"

echo "${IRONIC_USERNAME}" > "${BMO_OVERLAY}/ironic-username"
echo "${IRONIC_PASSWORD}" > "${BMO_OVERLAY}/ironic-password"
Expand Down
2 changes: 1 addition & 1 deletion hack/e2e/ensure_go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ verify_go_version()
echo 'go not found, installing'
curl -sLo "/tmp/${MINIMUM_GO_VERSION}.linux-amd64.tar.gz" "https://go.dev/dl/${MINIMUM_GO_VERSION}.linux-amd64.tar.gz"
sudo tar -C /usr/local -xzf "/tmp/${MINIMUM_GO_VERSION}.linux-amd64.tar.gz"
export PATH=$PATH:/usr/local/go/bin
export PATH=/usr/local/go/bin:$PATH
else
echo "Missing required binary in path: go"
return 2
Expand Down
Loading