Skip to content

Changes to build & release workflow to support E2E tests as release gate and fix some release issues #807

Changes to build & release workflow to support E2E tests as release gate and fix some release issues

Changes to build & release workflow to support E2E tests as release gate and fix some release issues #807

Workflow file for this run

name: E2E Test # this test is based on this tutorial: https://docs.otterize.com/quick-tutorials/k8s-network-mapper
on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
- labeled
push:
branches:
- main
jobs:
test-chart-deployment:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Helm
uses: azure/[email protected]
- name: Start minikube
uses: medyagh/setup-minikube@master
with:
start-args: "--network-plugin=cni --cni=calico"
- name: Wait for Calico startup
run: |-
kubectl wait pods -n kube-system -l k8s-app=calico-kube-controllers --for condition=Ready --timeout=90s
kubectl wait pods -n kube-system -l k8s-app=calico-node --for condition=Ready --timeout=90s
kubectl wait pods -n kube-system -l k8s-app=calico-kube-controllers --for condition=Ready --timeout=90s
- name: Deploy Otterize
run: |-
helm dep up ./otterize-kubernetes
# schema validation using kubectl dry run
kubectl create namespace otterize-system # required for dry-run
helm template otterize ./otterize-kubernetes -n otterize-system --set global.telemetry.enabled=false | kubectl apply --dry-run=server -f -
kubectl delete namespace otterize-system # clean up
# installation
helm install otterize ./otterize-kubernetes -n otterize-system --wait --create-namespace --set global.telemetry.enabled=false
test-database-integrations:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Start minikube
uses: medyagh/setup-minikube@master
- name: Set up Helm
uses: azure/[email protected]
- name: Set up gotestfmt
uses: GoTestTools/gotestfmt-action@v2
with:
# Optional: pass GITHUB_TOKEN to avoid rate limiting.
token: ${{ secrets.GITHUB_TOKEN }}
- name: Helm dependency update
run: helm dep up ./otterize-kubernetes
- name: Run E2E tests - database integrations
run: |
cd tests
go test -v -json ./databases/... | tee gotest.log | gotestfmt
test-azure-integration:
if: contains(github.event.pull_request.labels.*.name, 'run-azure-e2e-tests') || (github.event_name == 'push' && github.ref == 'refs/heads/main')
timeout-minutes: 5
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }} # do not allow concurrent runs of this job
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in with Azure
uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Azure CLI script
uses: azure/CLI@v2
with:
inlineScript: |
az account show
- name: Set AKS context
uses: azure/aks-set-context@v4
with:
resource-group: 'otterizeGitHubActionsResourceGroup'
cluster-name: 'otterizeAzureIAME2EAKSCluster'
- name: Setup kubectl
uses: azure/setup-kubectl@v4
- name: Set up Helm
uses: azure/[email protected]
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: 1.22.1
cache-dependency-path: tests/go.sum
- name: Set up gotestfmt
uses: GoTestTools/gotestfmt-action@v2
with:
# Optional: pass GITHUB_TOKEN to avoid rate limiting.
token: ${{ secrets.GITHUB_TOKEN }}
- name: Helm dependency update
run: helm dep up ./otterize-kubernetes
- name: Cleanup test namespaces
run: |
kubectl delete namespace otterize-tutorial-azure-iam --ignore-not-found=true --wait
kubectl delete namespace otterize-system --ignore-not-found=true --wait
- name: Run E2E tests - azure integrations
run: |
cd tests
go test -v -json ./azureiam/... | tee gotest.log | gotestfmt