github-action: use elastic/oblt-actions/check-dependent-jobs (#129) #134
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Agents Integration Testing | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '**.md' | |
- '**.asciidoc' | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- labeled | |
- ready_for_review | |
paths-ignore: | |
- '**.md' | |
- '**.asciidoc' | |
env: | |
AGENT_TESTS: dotnet java nodejs | |
jobs: | |
integration-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Create Kind cluster and local Docker registry | |
run: | |
sh test/mock/kind-with-registry.sh | |
- name: Create Mock APM server image | |
run: | |
cd test/mock; | |
docker build -t mock-apm-server .; | |
docker tag mock-apm-server localhost:5001/registry/mock-apm-server; | |
docker push localhost:5001/registry/mock-apm-server; | |
- name: Start Mock Apm Server | |
run: | | |
kubectl create -f test/mock/mock-apm-server-deployment.yaml | |
kubectl create -f test/mock/mock-apm-server-service.yaml | |
kubectl get pods -A | |
sh test/mock/wait_for_container_start.sh mock-apm-server | |
kubectl get pods -A | |
- name: Create Test Images | |
run: | | |
export START_WD=`pwd` | |
for t in ${AGENT_TESTS[@]} | |
do | |
echo "Creating image for $t" | |
cd test/$t | |
docker build -t $t-test-app . | |
docker tag $t-test-app localhost:5001/registry/$t-test-app | |
docker push localhost:5001/registry/$t-test-app | |
cd $START_WD | |
done | |
- name: Set up Helm | |
uses: azure/setup-helm@v4 | |
with: | |
version: v3.11.2 | |
- name: Build and install webhook | |
run: | | |
make .webhook # builds "apm/apm-attacher:latest" Docker image | |
docker tag apm/apm-attacher:latest localhost:5001/apm-attacher:latest | |
docker push localhost:5001/apm-attacher:latest | |
helm install webhook-chart ./charts/apm-attacher/ --namespace=elastic-apm --create-namespace --values test/mock/test_values.yaml | |
sleep 5 | |
export POD_NAME=`kubectl get pods -A | grep 'webhook-chart' | awk -F ' ' '{print $2}'` | |
sh test/mock/wait_for_container_start.sh $POD_NAME | |
- name: Start Test Images | |
run: | | |
for t in ${AGENT_TESTS[@]} | |
do | |
echo "Starting pod for $t" | |
kubectl create -f test/$t/test-app.yaml | |
sh test/mock/wait_for_container_start.sh $t-test-app | |
kubectl logs $t-test-app | |
sh test/$t/agent_has_started.sh | |
done |