Skip to content

test-integrations

test-integrations #688

# Copyright AGNTCY Contributors (https://github.com/agntcy)
# SPDX-License-Identifier: Apache-2.0
name: test-integrations
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
inputs:
kind_version:
description: "Kind version"
required: false
default: "0.24.0"
override_directory_image_tag:
description: "Override Directory image tag"
required: false
default: ""
override_directory_chart_tag:
description: "Override Directory chart tag"
required: false
default: ""
override_slim_image_tag:
description: "Override Slim image tag"
required: false
default: ""
override_slim_chart_tag:
description: "Override Slim chart tag"
required: false
default: ""
skip_directory_test:
description: "Skip directory tests"
required: false
default: true
type: boolean
skip_slim_test:
description: "Skip slim tests"
required: false
default: true
type: boolean
skip_slim_spire_test:
description: "Skip slim with SPIRE tests"
required: false
default: true
type: boolean
run_agentic_apps_test:
description: "Run agentic apps tests"
required: false
default: false
type: boolean
run_wfsm_test:
description: "Run WFSM tests"
required: false
default: false
type: boolean
schedule:
- cron: "0 4 * * *"
jobs:
set-kind-version:
runs-on: ubuntu-latest
outputs:
kind-version: ${{steps.set-kind-version.outputs.kind-version }}
steps:
- name: Set KinD version
id: set-kind-version
env:
KIND_VERSION: "0.24.0"
shell: bash
run: |
if [ "${{ github.event_name }}" == 'workflow_dispatch' ]; then
KIND_VERSION="${{ inputs.kind_version }}"
fi
echo "Set KinD version to: $KIND_VERSION"
echo "kind-version=$KIND_VERSION" >> "$GITHUB_OUTPUT"
run-tests-slim:
if: ${{ !inputs.skip_slim_test }}
needs: [set-kind-version]
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
packages: "read"
attestations: "read"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Environment
uses: ./.github/actions/setup-env
with:
python: true
go: false
- name: Setup K8S Tools
uses: ./.github/actions/setup-k8s
with:
kind-version: ${{ needs.set-kind-version.outputs.kind-version }}
- name: Deploy Slim
uses: ./.github/actions/deploy-components
with:
deploy-spire: "true"
deploy-slim: "true"
slim-image-tag: ${{ inputs.override_slim_image_tag }}
slim-chart-tag: ${{ inputs.override_slim_chart_tag }}
- name: Run slim sanity tests
env:
AZURE_OPENAI_ENDPOINT: ${{ vars.AZURE_OPENAI_ENDPOINT }}
AZURE_MODEL_VERSION: ${{ vars.AZURE_MODEL_VERSION }}
AZURE_DEPLOYMENT_NAME: ${{ vars.AZURE_DEPLOYMENT_NAME }}
AZURE_OPENAI_API_VERSION: ${{ vars.AZURE_OPENAI_API_VERSION }}
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
run: task integrations:slim:test:sanity
shell: bash
# - name: Run slim MCP integration tests
# env:
# AZURE_OPENAI_ENDPOINT: ${{ vars.AZURE_OPENAI_ENDPOINT }}
# AZURE_MODEL_VERSION: ${{ vars.AZURE_MODEL_VERSION }}
# AZURE_DEPLOYMENT_NAME: ${{ vars.AZURE_DEPLOYMENT_NAME }}
# AZURE_OPENAI_API_VERSION: ${{ vars.AZURE_OPENAI_API_VERSION }}
# AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
# run: task integrations:slim:test:mcp-server
# shell: bash
run-tests-slim-topology:
if: ${{ !inputs.skip_slim_test }}
needs: [set-kind-version]
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
packages: "read"
attestations: "read"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Environment
uses: ./.github/actions/setup-env
with:
python: true
go: false
- name: Setup K8S Tools
uses: ./.github/actions/setup-k8s
with:
kind-version: ${{ needs.set-kind-version.outputs.kind-version }}
- name: Deploy Slim with Controller
uses: ./.github/actions/deploy-components
with:
deploy-slim: "false"
deploy-spire: "false"
deploy-slim-topology: "true"
slim-config: "spire"
slim-image-tag: ${{ inputs.override_slim_image_tag }}
slim-chart-tag: ${{ inputs.override_slim_chart_tag }}
- name: Run slim topology test
run: task integrations:slim:test:topology
shell: bash
- name: Create artifact from integrations test reports
uses: ./.github/actions/create-artifact
with:
artifact-name: "slim-test-result"
run-tests-slim-spire:
if: ${{ !inputs.skip_slim_spire_test }}
needs: [set-kind-version]
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
packages: "read"
attestations: "read"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Environment
uses: ./.github/actions/setup-env
with:
python: true
go: false
- name: Setup K8S Tools
uses: ./.github/actions/setup-k8s
with:
kind-version: ${{ needs.set-kind-version.outputs.kind-version }}
- name: Deploy Slim with SPIRE
uses: ./.github/actions/deploy-components
with:
deploy-slim: "true"
deploy-spire: "true"
slim-config: "spire"
slim-image-tag: ${{ inputs.override_slim_image_tag }}
slim-chart-tag: ${{ inputs.override_slim_chart_tag }}
- name: Run slim sanity tests (mtls with SPIRE)
env:
AZURE_OPENAI_ENDPOINT: ${{ vars.AZURE_OPENAI_ENDPOINT }}
AZURE_MODEL_VERSION: ${{ vars.AZURE_MODEL_VERSION }}
AZURE_DEPLOYMENT_NAME: ${{ vars.AZURE_DEPLOYMENT_NAME }}
AZURE_OPENAI_API_VERSION: ${{ vars.AZURE_OPENAI_API_VERSION }}
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
SLIM_CONFIG: "spire"
run: task integrations:slim:test:sanity
shell: bash
- name: Create artifact from integrations test reports
uses: ./.github/actions/create-artifact
with:
artifact-name: "slim-spire-test-result"
run-tests-directory:
if: ${{ !inputs.skip_directory_test }}
needs: [set-kind-version]
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
packages: "read"
attestations: "read"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Environment
uses: ./.github/actions/setup-env
with:
python: true
go: false
- name: Setup K8S Tools
uses: ./.github/actions/setup-k8s
with:
kind-version: ${{ needs.set-kind-version.outputs.kind-version }}
- name: Deploy Directory
uses: ./.github/actions/deploy-components
with:
deploy-directory: "true"
directory-image-tag: ${{ inputs.override_directory_image_tag}}
directory-chart-tag: ${{ inputs.override_directory_chart_tag }}
- name: Run Directory tests
run: task integrations:directory:test
shell: bash
- name: Create artifact from integrations test reports
uses: ./.github/actions/create-artifact
with:
artifact-name: "directory-test-result"
run-agentic-apps:
if: ${{ inputs.run_agentic_apps_test }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Environment
uses: ./.github/actions/setup-env
with:
python: true
go: false
- name: Run Agentic Apps
env:
AZURE_OPENAI_ENDPOINT: ${{ vars.AZURE_OPENAI_ENDPOINT }}
AZURE_OPENAI_API_VERSION: ${{ vars.AZURE_OPENAI_API_VERSION }}
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
TEST_ENV_VAR: "anything"
run: task integrations:apps:run-marketing-campaign
shell: bash
run-tests-wfsm:
if: ${{ inputs.run_wfsm_test }}
needs: [set-kind-version]
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
packages: "read"
attestations: "read"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Environment
uses: ./.github/actions/setup-env
with:
python: true
go: false
- name: Setup K8S Tools
uses: ./.github/actions/setup-k8s
with:
kind-version: ${{ needs.set-kind-version.outputs.kind-version }}
- name: Deploy Directory
uses: ./.github/actions/deploy-components
with:
deploy-directory: "true"
directory-image-tag: "v0.2.3"
directory-chart-tag: "v0.2.3"
- name: Run Workflow Server Manger Test
env:
AZURE_OPENAI_ENDPOINT: ${{ vars.AZURE_OPENAI_ENDPOINT }}
AZURE_OPENAI_API_VERSION: ${{ vars.AZURE_OPENAI_API_VERSION }}
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
TEST_ENV_VAR: "anything"
DIRCTL_BIN_VERSION: "v0.2.3"
run: |
task integrations:directory:download:dirctl-bin
task integrations:wfsm:wfsm:test:e2e
shell: bash
combine-all-artifacts:
# Ensure this job runs only after all jobs that produce artifacts have completed
needs:
[
run-tests-slim,
run-tests-slim-spire,
run-tests-directory,
run-agentic-apps,
run-tests-wfsm,
]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository (required for local actions)
if: ${{ contains(join(needs.*.result, ','), 'success')}}
uses: actions/checkout@v4
- name: Combine and upload all artifacts
if: ${{ contains(join(needs.*.result, ','), 'success')}}
uses: ./.github/actions/collect-reports
with:
combined-artifact-name: "combined-test-reports"