Skip to content

update tree with propagate logic and tests #1166

update tree with propagate logic and tests

update tree with propagate logic and tests #1166

Workflow file for this run

name: CI-E2E
on:
push:
branches:
- main
- "release-*"
- "ci_*"
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
pull_request_target:
branches:
- main
- "release-*"
workflow_dispatch:
inputs:
ginkgoParallel:
description: Run tests in parallel
default: false
type: boolean
ginkgoDryRun:
description: Run tests with dry run
default: false
type: boolean
ginkgoFlags:
description: Flags to pass directly to the ginkgo command
default: "-v"
type: string
merge_group:
types: [checks_requested]
env:
TEST_NAMESPACE: e2e-test
GINKGO_PARALLEL: ${{ inputs.ginkgoParallel || 'false' }}
GINKGO_DRYRUN: ${{ inputs.ginkgoDryRun || 'false' }}
GINKGO_FLAGS: ${{ inputs.ginkgoFlags || '-v' }}
jobs:
e2e_test_suite:
name: E2E Test Suite
needs: is_path_ignore
if: ${{ needs.is_path_ignore.outputs.should_ignore != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- uses: actions/setup-go@v5
with:
go-version: v1.22.x
cache: false
- name: Create AWS provider configuration
run: |
make local-setup-aws-clean local-setup-aws-generate AWS_ACCESS_KEY_ID=${{ secrets.E2E_AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY=${{ secrets.E2E_AWS_SECRET_ACCESS_KEY }}
- name: Create GCP provider configuration
run: |
make local-setup-gcp-clean local-setup-gcp-generate GCP_GOOGLE_CREDENTIALS='${{ secrets.E2E_GCP_GOOGLE_CREDENTIALS }}' GCP_PROJECT_ID=${{ secrets.E2E_GCP_PROJECT_ID }}
- name: Create Azure provider configuration
run: |
make local-setup-azure-clean local-setup-azure-generate KUADRANT_AZURE_CREDENTIALS='${{ secrets.E2E_AZURE_CREDENTIALS }}'
- name: Setup environment
if: ${{ !inputs.ginkgoDryRun }}
run: |
make local-setup DEPLOY=true TEST_NAMESPACE=${{ env.TEST_NAMESPACE }}
kubectl -n ${{ env.TEST_NAMESPACE }} get secret/dns-provider-credentials-aws
kubectl -n ${{ env.TEST_NAMESPACE }} get secret/dns-provider-credentials-gcp
kubectl -n ${{ env.TEST_NAMESPACE }} get secret/dns-provider-credentials-azure
- name: Run suite AWS
run: |
export TEST_DNS_PROVIDER_SECRET_NAME=dns-provider-credentials-aws
export TEST_DNS_ZONE_DOMAIN_NAME=e2e.hcpapps.net
export TEST_DNS_NAMESPACE=${{ env.TEST_NAMESPACE }}
make test-e2e
- name: Run suite GCP
run: |
export TEST_DNS_PROVIDER_SECRET_NAME=dns-provider-credentials-gcp
export TEST_DNS_ZONE_DOMAIN_NAME=e2e.google.hcpapps.net
export TEST_DNS_NAMESPACES=${{ env.TEST_NAMESPACE }}
make test-e2e
- name: Run suite Azure
if: (github.event_name == 'push' && (github.ref_name == 'main' || startsWith(github.ref_name, 'release-')) || github.event_name == 'workflow_dispatch')
run: |
export TEST_DNS_PROVIDER_SECRET_NAME=dns-provider-credentials-azure
export TEST_DNS_ZONE_DOMAIN_NAME=e2e.azure.hcpapps.net
export TEST_DNS_NAMESPACES=${{ env.TEST_NAMESPACE }}
make test-e2e
- name: Dump Controller logs
if: ${{ failure() && !inputs.ginkgoDryRun }}
run: |
kubectl get deployments -A
kubectl logs --all-containers --ignore-errors deployments/dns-operator-controller-manager -n dns-operator-system
- name: Dump Controller metrics
if: ${{ success() && !inputs.ginkgoDryRun }}
run: |
kubectl run -q curl --image=curlimages/curl --rm -it --restart=Never --namespace dns-operator-system -- curl -XGET http://dns-operator-controller-manager-metrics-service:8080/metrics > metrics.txt
cat metrics.txt
- uses: actions/upload-artifact@v4
with:
name: metrics
path: metrics.txt
if-no-files-found: warn
- name: Exit as failure if dry run
if: ${{ success() && inputs.ginkgoDryRun }}
run: |
echo "Executed using dry run, exiting as failure"
exit 1
is_path_ignore:
if: always()
name: Check for changes on path_ignore
outputs:
should_ignore: ${{ steps.is_path_ignore.outputs.should_ignore }}
runs-on:
- ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 10
- id: check_files
name: Get changed files
uses: tj-actions/changed-files@v41
with:
files: |
LICENSE
file-types: "**.adoc,**.md"
- id: set_output
name: Set output based on only files being changed that should be ignored
run: |
if [[ "${{ steps.check_files.outputs.any_changed }}" == "true" ]] && "${{ steps.check_files.outputs.files }}" == "${{ steps.check_files.outputs.all_changed_files }}"; then
echo "should_ignore=true" >> $GITHUB_ENV
else
echo "should_ignore=false" >> $GITHUB_ENV
fi