Skip to content

Commit

Permalink
feat: adding helm tests for multicloud
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamir David authored and Tamir David committed Oct 14, 2024
1 parent b3f5cfd commit fecddcb
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 14 deletions.
26 changes: 16 additions & 10 deletions .github/workflows/cross-cloud-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
strategy:
matrix:
cloud-provider: [aks] # Add or remove providers as needed [TODO: later add -> eks + gke]
test-scenario: [multi-apps] # Add or remove scenarios as needed
test-scenario: [multi-apps, helm-chart] # Add or remove scenarios as needed

steps:

Expand All @@ -89,6 +89,12 @@ jobs:

- name: Configure Cloud Provider
run: |
# Set environment variable for cluster name to use in Terraform
CLUSTER_NAME="${{ matrix.test-scenario }}-${{ github.run_id }}"
echo "CLUSTER_NAME=${CLUSTER_NAME}" >> $GITHUB_ENV
echo "TF_VAR_cluster_name=${CLUSTER_NAME}" >> $GITHUB_ENV
if [ "${{ matrix.cloud-provider }}" = "aks" ]; then
echo "Configuring for AKS"
Expand All @@ -100,7 +106,6 @@ jobs:
az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
az account set --subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }}
az aks get-credentials --resource-group tests-rg --name tests-aks
elif [ "${{ matrix.cloud-provider }}" = "eks" ]; then
echo "Configuring for EKS"
Expand All @@ -125,6 +130,7 @@ jobs:
run: |
if [ "${{ matrix.cloud-provider }}" == "aks" ]; then
echo "TF_DIR=./tests-infrastructure/terraform/aks" >> $GITHUB_ENV
az aks get-credentials --resource-group tests-rg --name $CLUSTER_NAME
elif [ "${{ matrix.cloud-provider }}" == "eks" ]; then
echo "TF_DIR=./tests-infrastructure/terraform/eks" >> $GITHUB_ENV
elif [ "${{ matrix.cloud-provider }}" == "gke" ]; then
Expand All @@ -134,15 +140,15 @@ jobs:
exit 1
fi
# - name: Initialize OpenTofu
# run: tofu -chdir=$TF_DIR init
- name: Initialize OpenTofu
run: tofu -chdir=$TF_DIR init

# - name: Plan OpenTofu
# run: tofu -chdir=$TF_DIR plan
- name: Plan OpenTofu
run: tofu -chdir=$TF_DIR plan

# - name: Apply OpenTofu Configuration
# run: |
# tofu -chdir=$TF_DIR apply -auto-approve
- name: Apply OpenTofu Configuration
run: |
tofu -chdir=$TF_DIR apply -auto-approve
- name: Verify cluster Access
run: |
Expand All @@ -163,7 +169,7 @@ jobs:
run: |
cd frontend/webapp
yarn install
- name: Run E2E Tests
run: |
echo "MODE=cross-cloud-tests" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion tests-infrastructure/terraform/aks/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ variable "cluster_name" {

variable "node_count" {
description = "Number of nodes in the cluster"
default = 2
default = 1
}
2 changes: 1 addition & 1 deletion tests/e2e/helm-chart/assert-instrumented-and-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ status:
- key: process.runtime.version
(value != null): true
- key: telemetry.distro.version
value: e2e-test
(value != null): true
- key: process.pid
(value != null): true
---
Expand Down
6 changes: 5 additions & 1 deletion tests/e2e/helm-chart/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ spec:
P="../../.."
# "build" complete helm chart by copying CRDs into the template folder
cp -r $P/api/config/crd/bases/* $P/helm/odigos/templates/crds/
helm upgrade --install odigos $P/helm/odigos --create-namespace --namespace odigos-test-ns --set image.tag=e2e-test
if [ "$MODE" = "cross-cloud-tests" ]; then
helm upgrade --install odigos $P/helm/odigos --create-namespace --namespace odigos-test-ns --set image.tag=304e3b08d6346f9c16aa4440ff82178191c8d94a --set imagePrefix=public.ecr.aws/y2v0v6s7
else
helm upgrade --install odigos $P/helm/odigos --create-namespace --namespace odigos-test-ns --set image.tag=e2e-test
fi
kubectl label namespace odigos-test-ns odigos.io/system-object="true"
timeout: 60s
- name: Verify Odigos Installation
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/helm-chart/tracesql/resource-attributes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: |
B. Kubernetes attributes are correctly set on all spans
At the time of writing this test, TraceQL api does not support not equal to nil so we use regex instead.
query: |
{ resource.odigos.version != "e2e-test" ||
{ resource.odigos.version !~ ".*" ||
resource.k8s.deployment.name !~ ".*" ||
resource.k8s.node.name !~ "kind-control-plane" ||
resource.k8s.pod.name !~ ".*" }
Expand Down

0 comments on commit fecddcb

Please sign in to comment.