|
| 1 | +name: Regression Testing Operator Integration |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | +env: |
| 7 | + AGENT_TESTS: python nodejs java |
| 8 | + #go dotnet --- both pending |
| 9 | + |
| 10 | +jobs: |
| 11 | + integration-test: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - name: Checkout |
| 15 | + uses: actions/checkout@v4 |
| 16 | + with: |
| 17 | + fetch-depth: 0 |
| 18 | + |
| 19 | + - name: Create Kind cluster and local Docker registry |
| 20 | + run: |
| 21 | + bash test/operator/kind-with-registry.sh |
| 22 | + |
| 23 | + - name: Create Test Images |
| 24 | + run: | |
| 25 | + for t in ${AGENT_TESTS[@]} |
| 26 | + do |
| 27 | + echo "Creating image for $t" |
| 28 | + docker build -t $t-test-app test/operator/$t |
| 29 | + docker tag $t-test-app localhost:5001/registry/$t-test-app |
| 30 | + docker push localhost:5001/registry/$t-test-app |
| 31 | + done |
| 32 | +
|
| 33 | + - name: Set up Helm |
| 34 | + uses: azure/setup-helm@v4 |
| 35 | + with: |
| 36 | + version: v3.11.2 |
| 37 | + |
| 38 | + - name: Install Operator Skeleton |
| 39 | + run: | |
| 40 | + kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.15.3/cert-manager.yaml |
| 41 | + bash test/operator/wait_for_pod_start.sh cert-manager cert-manager- 1/1 3 |
| 42 | + helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts |
| 43 | + helm repo update |
| 44 | + helm install opentelemetry-operator --namespace opentelemetry-operator-system open-telemetry/opentelemetry-operator --create-namespace --set manager.collectorImage.repository="docker.elastic.co/beats/elastic-agent:8.15.0-SNAPSHOT",manager.extraArgs={"--enable-go-instrumentation=true"} |
| 45 | + bash test/operator/wait_for_pod_start.sh opentelemetry-operator-system opentelemetry-operator 2/2 1 |
| 46 | + kubectl get pods -A |
| 47 | +
|
| 48 | + - name: Add Namespaces And Instrumentation Skeleton |
| 49 | + run: | |
| 50 | + kubectl create namespace banana |
| 51 | + kubectl create -f test/operator/elastic-instrumentation.yml |
| 52 | +
|
| 53 | + - name: Start And Test Collector Skeleton |
| 54 | + run: | |
| 55 | + echo "Nothing here yet" |
| 56 | +
|
| 57 | + - name: Start Test Images |
| 58 | + run: | |
| 59 | + for t in ${AGENT_TESTS[@]} |
| 60 | + do |
| 61 | + if [ "x$t" = "xgo" ]; then CONTAINER_READY="2/2"; else CONTAINER_READY="1/1"; fi |
| 62 | + AGENT_START_GREP=`grep -A1 AGENT_HAS_STARTED_IF_YOU_SEE test/operator/$t/test-app.yaml | perl -ne '/value:\s*"(.*)"/ && print "$1\n"'` |
| 63 | + echo "Starting pod for $t" |
| 64 | + kubectl create -f test/operator/$t/test-app.yaml |
| 65 | + bash test/operator/wait_for_pod_start.sh banana $t-test-app $CONTAINER_READY 1 |
| 66 | + bash test/operator/wait_for_agent_start.sh banana $t-test-app "$AGENT_START_GREP" |
| 67 | + kubectl delete -f test/operator/$t/test-app.yaml |
| 68 | + done |
0 commit comments