Skip to content

Non Functional Testing #266

Non Functional Testing

Non Functional Testing #266

Workflow file for this run

name: Non Functional Testing
on:
workflow_dispatch:
inputs:
version:
description: Version of NGF under test
required: true
default: edge
image_tag:
description: Tag of the NGF and NGINX Docker images
required: true
default: edge
type:
description: Type of NGINX image to test
required: true
default: both
type: choice
options: [oss, plus, both]
schedule:
- cron: "0 16 1,15 * *" # Run on the 1st and 15th of every month at 16:00 UTC
defaults:
run:
shell: bash
env:
PLUS_USAGE_ENDPOINT: ${{ secrets.JWT_PLUS_REPORTING_ENDPOINT }}
permissions:
contents: read
jobs:
vars:
name: Set up vars
runs-on: ubuntu-24.04
outputs:
version: ${{ github.event.inputs.version || 'edge' }}
image_tag: ${{ github.event.inputs.image_tag || 'edge' }}
types: ${{ steps.var.outputs.types }}
permissions:
contents: read
steps:
- name: Set vars
id: var
run: |
if ${{ github.event.inputs.type == 'both' || github.event_name == 'schedule' }}; then
echo 'types=["oss","plus"]' >> $GITHUB_OUTPUT
else
echo 'types=["${{ github.event.inputs.type }}"]' >> $GITHUB_OUTPUT
fi
setup-and-run-tests:
name: Run IPv6-Only Tests
runs-on: ubuntu-24.04
permissions:
contents: read
id-token: write # needed for authenticating to GCP
needs: vars
strategy:
fail-fast: false
matrix:
type: ${{ fromJson(needs.vars.outputs.types) }}
env:
DOCKER_BUILD_SUMMARY: false
steps:
- name: Checkout Repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
### Authenticate to GCP and set up gcloud, kubectl, and Docker
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3.0.0
with:
token_format: access_token
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
- name: Login to GAR
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
with:
registry: us-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db # v3.0.1
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
install_components: kubectl
###
- name: Setup dotenv file
working-directory: ./tests/scripts
run: |
echo "RESOURCE_NAME=nfr-tests-${{ github.run_id }}-${{ matrix.type }}" >> vars.env
echo "TAG=${{ needs.vars.outputs.image_tag }}" >> vars.env
echo "PREFIX=ghcr.io/nginx/nginx-gateway-fabric" >> vars.env
echo "NGINX_PREFIX=ghcr.io/nginx/nginx-gateway-fabric/nginx" >> vars.env
echo "NGINX_PLUS_PREFIX=us-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/nginx-gateway-fabric/nginx-plus" >> vars.env
echo "GKE_CLUSTER_NAME=nfr-tests-${{ github.run_id }}-${{ matrix.type }}" >> vars.env
echo "GKE_CLUSTER_ZONE=us-west1-b" >> vars.env
echo "GKE_CLUSTER_REGION=us-west1" >> vars.env
echo "GKE_CLUSTER_STACK_TYPE=ipv4-ipv6" >> vars.env
echo "GKE_CLUSTER_IPV6_ACCESS_TYPE=external" >> vars.env
echo "GKE_PROJECT=${{ secrets.GCP_PROJECT_ID }}" >> vars.env
echo "GKE_SVC_ACCOUNT=${{ secrets.GCP_SERVICE_ACCOUNT }}" >> vars.env
echo "GKE_NODES_SERVICE_ACCOUNT=${{ secrets.GKE_NODES_SERVICE_ACCOUNT }}" >> vars.env
echo "NETWORK_TAGS=nfr-tests-${{ github.run_id }}-${{ matrix.type }}" >> vars.env
echo "NGF_BRANCH=${{ github.ref_name }}" >> vars.env
echo "SOURCE_IP_RANGE=$(curl -sS -4 icanhazip.com)/32" >> vars.env
echo "ADD_VM_IP_AUTH_NETWORKS=true" >> vars.env
echo "PLUS_ENABLED=${{ matrix.type == 'plus' }}" >> vars.env
echo "GINKGO_LABEL=" >> vars.env
echo "NGF_VERSION=${{ needs.vars.outputs.version }}" >> vars.env
echo "GKE_NUM_NODES=1" >> vars.env
echo "GKE_MACHINE_TYPE=n2d-standard-16" >> vars.env
echo "IPV6_ENABLED=true" >> vars.env
echo "PLUS_USAGE_ENDPOINT=${{ secrets.JWT_PLUS_REPORTING_ENDPOINT }}" >> vars.env
- name: Setup license file for plus
if: matrix.type == 'plus'
env:
PLUS_LICENSE: ${{ secrets.JWT_PLUS_REPORTING }}
run: echo "${PLUS_LICENSE}" > license.jwt
- name: Create GKE cluster
working-directory: ./tests
run: make create-gke-cluster CI=true
# - name: Create and setup VM
# working-directory: ./tests
# run: make create-and-setup-vm
# - name: Create and setup Router
# working-directory: ./tests
# run: make create-gke-router || true
# - name: Setup Golang Environment
# uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
# with:
# go-version: stable
# - name: Set GOPATH
# run: echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
# - name: NGF Docker meta
# id: ngf-meta
# uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
# with:
# images: |
# name=ghcr.io/nginx/nginx-gateway-fabric
# tags: |
# type=semver,pattern={{version}}
# type=schedule
# type=edge
# type=ref,event=pr
# type=ref,event=branch,suffix=-rc,enable=${{ startsWith(github.ref, 'refs/heads/release') }}
# - name: NGINX Docker meta
# id: nginx-meta
# uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
# with:
# images: |
# name=ghcr.io/nginx/nginx-gateway-fabric/${{ inputs.image_tag == 'plus' && 'nginx-plus' || inputs.image_tag }}
# tags: |
# type=semver,pattern={{version}}
# type=edge
# type=schedule
# type=ref,event=pr
# type=ref,event=branch,suffix=-rc,enable=${{ startsWith(github.ref, 'refs/heads/release') }}
# - name: Install and test NGF with IPv6 Configuration
# run: |
# ./scripts/run-tests-gcp-vm.sh
# working-directory: ./tests
- name: Cleanup
working-directory: ./tests
if: always()
run: |
bash scripts/cleanup-vm.sh true
bash scripts/cleanup-router.sh true
make delete-gke-cluster
rm -rf scripts/vars.env