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

chore: add e2e tests for cloud distros #1259

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
4 changes: 2 additions & 2 deletions .github/bundles/aks/uds-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ packages:
ref: 0.35.0
# x-release-please-end
# https://github.com/defenseunicorns/uds-core/issues/1222
# optionalComponents:
# - istio-ambient
#optionalComponents:
#- istio-ambient
overrides:
istio-admin-gateway:
gateway:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test-aks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- tasks/iac.yaml
- .github/bundles/aks/*
- .github/test-infra/azure/aks/*
- .github/workflows/test-aks.yaml

permissions:
id-token: write
Expand Down Expand Up @@ -90,6 +91,9 @@ jobs:
run: uds deploy .github/bundles/aks/uds-bundle-uds-core-aks-nightly-*.tar.zst --confirm
timeout-minutes: 30

- name: Test UDS Core
run: uds run -f tasks/test.yaml uds-core-non-k3d --set EXCLUDED_PACKAGES="metrics-server"

- name: Debug Output
if: ${{ always() }}
uses: ./.github/actions/debug-output
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test-eks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- tasks/iac.yaml
- .github/bundles/eks/*
- .github/test-infra/aws/eks/*
- .github/workflows/test-eks.yaml

permissions:
id-token: write
Expand Down Expand Up @@ -95,6 +96,9 @@ jobs:
run: uds deploy .github/bundles/eks/uds-bundle-uds-core-eks-nightly-*.tar.zst --confirm
timeout-minutes: 30

- name: Test UDS Core
run: uds run -f tasks/test.yaml uds-core-non-k3d --set EXCLUDED_PACKAGES="metrics-server"

- name: Debug Output
if: ${{ always() }}
uses: ./.github/actions/debug-output
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test-rke2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- tasks/iac.yaml
- .github/bundles/rke2/*
- .github/test-infra/aws/rke2/*
- .github/workflows/test-rke2.yaml

permissions:
id-token: write
Expand Down Expand Up @@ -99,6 +100,9 @@ jobs:
run: uds deploy .github/bundles/rke2/uds-bundle-uds-core-rke2-nightly-*.tar.zst --confirm
timeout-minutes: 30

- name: Test UDS Core
run: uds run -f tasks/test.yaml uds-core-non-k3d

- name: Debug Output
if: ${{ always() }}
uses: ./.github/actions/debug-output
Expand Down
2 changes: 1 addition & 1 deletion src/istio/tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ tasks:
inputs:
validate_passthrough:
description: Whether to validate the passthrough gateway
default: "true"
default: "false"
actions:
- description: Validate the Istio Admin Gateway
wait:
Expand Down
18 changes: 16 additions & 2 deletions tasks/test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Copyright 2024 Defense Unicorns
# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial

variables:
- name: EXCLUDED_PACKAGES
description: A comma separated string of packages to be excluded from validation and e2e tests.
default: ""

includes:
- create: ./create.yaml
- setup: ./setup.yaml
Expand Down Expand Up @@ -56,8 +61,10 @@ tasks:
# loop through each src/* package and run the validate.yaml task
actions:
- cmd: |
for package in src/*; do
uds run -f ${package}/tasks.yaml validate --no-progress
for package in $(ls src); do
if [ ! $(echo ${EXCLUDED_PACKAGES} | grep ${package}) ]; then
uds run -f src/${package}/tasks.yaml validate --no-progress
fi
done
set +e

Expand Down Expand Up @@ -114,6 +121,13 @@ tasks:
- task: uds-core
- task: e2e-tests

- name: uds-core-non-k3d
description: "Validate and Test UDS Core deployment on a non K3D Cluster"
actions:
- task: util:setup-hosts
- task: validate-packages
- task: e2e-tests

- name: uds-core-ha
description: "Build and test UDS Core"
actions:
Expand Down
27 changes: 27 additions & 0 deletions tasks/utils.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,30 @@ tasks:
--from-literal=password=${PASSWORD} \
-n keycloak
fi

- name: setup-hosts
actions:
- description: Fetch Admin Gateway IP Address
cmd: |
IP_ADDR=$(uds zarf tools kubectl get service -n istio-admin-gateway admin-ingressgateway -o=jsonpath='{.status.loadBalancer.ingress[0].ip}' 2>/dev/null)
if [ -z $IP_ADDR ]; then
HOSTNAME=$(uds zarf tools kubectl get service -n istio-admin-gateway admin-ingressgateway -o=jsonpath='{.status.loadBalancer.ingress[0].hostname}' 2>/dev/null)
IP_ADDR=$(curl -isS $HOSTNAME --output /dev/null -w '%{remote_ip}')
fi; echo $IP_ADDR
mute: true
setVariables:
- name: ADMIN_GW_IP
- description: Fetch Tenant Gateway IP Address
cmd: |
IP_ADDR=$(uds zarf tools kubectl get service -n istio-tenant-gateway tenant-ingressgateway -o=jsonpath='{.status.loadBalancer.ingress[0].ip}' 2>/dev/null)
if [ -z $IP_ADDR ]; then
HOSTNAME=$(uds zarf tools kubectl get service -n istio-tenant-gateway tenant-ingressgateway -o=jsonpath='{.status.loadBalancer.ingress[0].hostname}' 2>/dev/null)
IP_ADDR=$(curl -isS $HOSTNAME --output /dev/null -w '%{remote_ip}')
fi; echo $IP_ADDR
mute: true
setVariables:
- name: TENANT_GW_IP
- description: Adds Cluster LoadBalancer IP Addresses to match appropriate hosts names in /etc/hosts
mute: true
cmd: |
echo "$ADMIN_GW_IP keycloak.admin.uds.dev neuvector.admin.uds.dev grafana.admin.uds.dev demo.admin.uds.dev\n$TENANT_GW_IP sso.uds.dev demo-8080.uds.dev demo-8081.uds.dev protected.uds.dev" | sudo tee --append /etc/hosts
Loading